Skip to content

Instantly share code, notes, and snippets.

@yang-zhang
yang-zhang / sample_dict.py
Created July 9, 2018 13:53
Randomly sample a dictionary
def sample_dct(dct, n=3):
idx = np.random.choice(len(dct), n)
return dict(np.array(list(dct.items()))[idx])
@yang-zhang
yang-zhang / add_destination.md
Last active July 23, 2018 02:24
Add destination to commands
tar -xf archive.tar -C /target/directory

wget url -P /path/to/folder

gunzip -c file.gz > /THERE/file

unzip source.zip -d /path/to/folder
@yang-zhang
yang-zhang / howto format date time python
Last active August 24, 2018 18:05
Format printable date time in python
import datetime
datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
datetime.datetime.now().strftime('%Y-%m-%d-%H')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / planet.ipynb
Last active October 22, 2018 17:57
multi-label example for fastai v1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / fastai-ImageMultiDataset-debug.ipynb
Last active October 24, 2018 19:42
fastai-ImageMultiDataset-debug
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / fastai-ImageRegressionDataset-y_range-dev.ipynb
Created November 7, 2018 21:55
fastai-ImageRegressionDataset-y_range-dev
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / t-tests.ipynb
Created November 21, 2018 17:09
git/yang-zhang.github.io/ds_math/t-tests.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / proportion-test.ipynb
Created November 21, 2018 17:09
git/yang-zhang.github.io/ds_math/Untitled1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / dropout-scaling.ipynb
Last active December 6, 2018 02:00
git/yang-zhang.github.io/ds_math/dropout-scaling.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.