This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| data = json.load(open('instances_train2017.json')) | |
| print data.keys() | |
| #OUTPUT : | |
| # [u'info', u'licenses', u'images', u'annotations', u'categories'] | |
| print data['categories'] | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /truba/home/{username}/python3 | |
| cd python3 | |
| wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz | |
| tar zxfv Python-3.5.2.tgz | |
| cd Python-3.5.2.tgz | |
| ./configure --prefix=/truba/home/{username}/python3 | |
| make && make install | |
| export PATH=/truba/home/{username}/python3/Python-3.5.2/:$PATH | |
| export PYTHONPATH=/truba/home/{username}/python3/Python-3.5.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def five_convnet(X, model, y=None, reg=0.0): | |
| W1, b1, W2, b2 = model['W1'], model['b1'], model['W2'], model['b2'] | |
| W3, b3, W4, b4 = model['W3'], model['b3'], model['W4'], model['b4'] | |
| W5, b5, W6, b6 = model['W5'], model['b5'], model['W6'], model['b6'] | |
| conv_filter_height, conv_filter_width = W1.shape[2:] | |
| assert conv_filter_height == conv_filter_width, 'Conv filter must be square' | |
| assert conv_filter_height % 2 == 1, 'Conv filter height must be odd' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import argparse | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| from torchvision import datasets, transforms | |
| import datetime | |
OlderNewer