Skip to content

Instantly share code, notes, and snippets.

@yueyericardo
yueyericardo / toy_linear_regression.py
Last active June 18, 2019 14:44
Toy linear regression model (Keras)
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
%matplotlib inline
class linear_reg(tf.keras.Model):
def __init__(self):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 1. openmpi-2.1.5 /home/qasdfgtyuiop/program/openmpi/
cd ~
mkdir program
cd program/
wget https://download.open-mpi.org/release/open-mpi/v2.1/openmpi-2.1.5.tar.gz
tar -zxvf openmpi-2.1.5.tar.gz
rm openmpi-2.1.5.tar.gz
cd openmpi-2.1.5/
./configure --prefix="/home/qasdfgtyuiop/program/openmpi"
make # take a while
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def loadmodel():
H_model = tf.keras.models.load_model('./models/H_tf.model', custom_objects={'AniCELU':AniCELU})
C_model = tf.keras.models.load_model('./models/C_tf.model', custom_objects={'AniCELU':AniCELU})
N_model = tf.keras.models.load_model('./models/N_tf.model', custom_objects={'AniCELU':AniCELU})
O_model = tf.keras.models.load_model('./models/O_tf.model', custom_objects={'AniCELU':AniCELU})
modelist = [H_model, C_model, N_model, O_model]
return modelist
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
@yueyericardo
yueyericardo / note.md
Last active January 19, 2019 05:26
Pytorch TF Environment
# tensorflow
conda create -n tf python=3.5 tensorflow-gpu

# pytorch
conda install pytorch torchvision -c pytorch

# .bashrc
source activate tf
@yueyericardo
yueyericardo / version 1.md
Last active January 8, 2019 05:14
hide_all in mac
on run {input, parameters}
	
	tell application "System Events" to set all_apps to the name of every process whose visible is true
	
	repeat with a in all_apps
		tell application "System Events" to try
			keystroke "h" using command down
			delay 0.1
 on error