Skip to content

Instantly share code, notes, and snippets.

@yang-zhang
yang-zhang / cross-entropy.ipynb
Last active March 18, 2024 06:05
Cross entropy implementation in pytorch
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 / multi-face.ipynb
Last active December 27, 2023 05:28
Multi-task Deep Learning Experiment using fastai Pytorch
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 / cheat_sheet_pickle.py
Created June 12, 2018 20:32
Cheatsheet pickle
pickle.dump(something, open('something.p', 'wb'))
something = pickle.load(open('something.p', 'rb'))
@yang-zhang
yang-zhang / binary_cross_entropy_with_logits.ipynb
Created October 16, 2018 20:46
binary cross entropy implementation in pytorch
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 / pytorch-losses-in-plain-python.ipynb
Last active December 21, 2022 07:14
git/yang-zhang.github.io/ds_code/pytorch-losses-in-plain-python.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 / fastai_ml_course_notes.md
Last active December 27, 2020 20:55
fast.ai machine learning course notes
@yang-zhang
yang-zhang / boilerplates.md
Last active July 4, 2020 12:51
boilerplates
  • pin_memory=True
  • sigmoid used in cross_entropy_loss
  • set_seed before fold and train
@yang-zhang
yang-zhang / logging_template.py
Last active January 26, 2020 01:02
logging template
import logging
log = logging.getLogger(__name__)
log.setLevel(level=logging.DEBUG)
fmtr = logging.Formatter("[%(asctime)s] [%(levelname)-8.8s] %(message)s", "%Y-%m-%d %H:%M:%S")
fhdlr = logging.FileHandler(f"log.log", mode='w')
fhdlr.setFormatter(fmtr)
log.addHandler(fhdlr)