In [ ]:
import time
import re
import torch
import torchvision
import torchvision.models as models
import torchvision.transforms as transforms
import torchvision.datasets as datasets
#import torchvision
from torchvision.utils import make_grid
from PIL import Image
#from skimage import io #, transform
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
# import torch.utils.trainer as trainer
# import torch.utils.trainer.plugins
from torch.utils.data import Dataset, DataLoader
from torch.autograd import Variable
import numpy as np
import os
import shutil, errno
from tqdm import tqdm_notebook
import data_science.j_utils as j_utils
# from torchsample.modules import ModuleTrainer
# from torchsample.metrics import CategoricalAccuracy
%matplotlib notebook
# %pdb
In [ ]:
# Set some path stuff
path = "data/"
# path = "data/sample/"
use_cuda = torch.cuda.is_available()
print('Using CUDA:', use_cuda)
trainpath = os.path.join(path, 'train.tsv')
validpath = os.path.join(path, 'valid.tsv')
testpath = os.path.join(path, 'test.tsv')
In [ ]:
# if 'train.tsv' not in os.listdir(path):
# !p7zip -d data/train.tsv.7z
# !mv train.tsv data/
# if 'test.tsv' not in os.listdir(path):
# !p7zip -d data/test.tsv.7z
# !mv test.tsv data/
# if 'sample_submssion.csv' not in os.listdir(path):
# !p7zip -d data/sample_submission.csv.7z
# !mv sample_submission.csv data/
In [ ]:
# check how much data I have
train = pd.read_table('data/train.tsv')
In [ ]:
train.shape
In [ ]:
test = pd.read_table('data/test.tsv')
In [ ]:
test.shape
In [ ]: