Skip to content

Instantly share code, notes, and snippets.

View skrish13's full-sized avatar

Sri Krishna skrish13

View GitHub Profile
@skrish13
skrish13 / NLL_OHEM.py
Created April 20, 2018 13:51 — forked from erogol/NLL_OHEM.py
Online hard example mining PyTorch
import torch as th
class NLL_OHEM(th.nn.NLLLoss):
""" Online hard example mining.
Needs input from nn.LogSotmax() """
def __init__(self, ratio):
super(NLL_OHEM, self).__init__(None, True)
self.ratio = ratio
@skrish13
skrish13 / breachcompilation.txt
Created December 19, 2017 18:48
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@skrish13
skrish13 / data_loader.py
Created August 8, 2017 20:58 — forked from kevinzakka/data_loader.py
Train, Validation and Test Split for torchvision Datasets
# This is an example for the CIFAR-10 dataset.
# There's a function for creating a train and validation iterator.
# There's also a function for creating a test iterator.
# Inspired by https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4
from utils import plot_images
def get_train_valid_loader(data_dir,
batch_size,
augment,