Skip to content

Instantly share code, notes, and snippets.

View yueyericardo's full-sized avatar

Jinze Xue yueyericardo

View GitHub Profile
@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
@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
/******************************************************************************
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>
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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):
plt.figure(figsize=(15,8))
plt.subplot(4, 1, 1)
plt.plot(OH.iloc[:,0],OH.iloc[:,1])
plt.ylim(0, 3.5e-18)
plt.xlim(3580, 3900)
plt.title('R branch', fontsize=16, pad=-20)
plt.subplot(4, 1, 2)
plt.plot(OH.iloc[:,0],OH.iloc[:,1])
class Progbar(object):
"""Displays a progress bar.
Arguments:
target: Total number of steps expected, None if unknown.
width: Progress bar width on screen.
verbose: Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose)
stateful_metrics: Iterable of string names of metrics that
should *not* be averaged over time. Metrics in this list
will be displayed as-is. All others will be averaged
by the progbar before display.