View train_valid_split.py
import np | |
from torch.utils.data import Dataset | |
class GenHelper(Dataset): | |
def __init__(self, mother, length, mapping): | |
# here is a mapping from this index to the mother ds index | |
self.mapping=mapping | |
self.length=length | |
self.mother=mother |
View gist:01da3874bf014d8a8c53406c2b95d56b
conda uninstall --force pillow -y | |
# install libjpeg-turbo to $HOME/turbojpeg | |
git clone https://github.com/libjpeg-turbo/libjpeg-turbo | |
pushd libjpeg-turbo | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg | |
make | |
make install |
View data_loader.py
""" | |
Create train, valid, test iterators for CIFAR-10 [1]. | |
Easily extended to MNIST, CIFAR-100 and Imagenet. | |
[1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4 | |
""" | |
import torch | |
import numpy as np |