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 numpy as np | |
def __one_hot__(num, dim=1000): | |
vec = np.zeros(dim) | |
vec[num] = 1 | |
return vec | |
def transform_to_input_output(input_output, dim=1000): |
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 numpy import * | |
import tensorflow as tf | |
image_size = 224 | |
train_x = zeros((1, image_size, image_size ,3)).astype(float32) | |
xdim = train_x.shape[1:] | |
net_data = load(open("pretrained/bvlc_alexnet.npy", "rb"), encoding="latin1").item() |
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 tensorflow as tf | |
n_classes = 10 | |
image_size = 32 | |
dropout = tf.placeholder(tf.float32, name="dropout_rate") | |
input_images = tf.placeholder(tf.float32, | |
shape=[None, image_size, image_size, 3], | |
name="input_images") |
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 numpy as np | |
import pickle | |
import os | |
import math | |
def __extract_file__(fname): | |
with open(fname, 'rb') as fo: | |
d = pickle.load(fo, encoding='bytes') | |
return d |
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 cifar import Cifar | |
from tqdm import tqdm | |
import tensorflow as tf | |
import model | |
import helper | |
learning_rate = 0.001 | |
batch_size = 16 | |
no_of_epochs = 10 | |
dropout_rate = 0.8 |
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 tensorflow as tf | |
n_classes = 10 | |
image_size = 32 | |
dropout = tf.placeholder(tf.float32, name="dropout_rate") | |
input_images = tf.placeholder(tf.float32, | |
shape=[None, image_size, image_size, 3], | |
name="input_images") |
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 tensorflow as tf | |
n_classes = 10 | |
image_size = 32 | |
dropout = tf.placeholder(tf.float32, name="dropout_rate") | |
input_images = tf.placeholder(tf.float32, | |
shape=[None, image_size, image_size, 3], | |
name="input_images") |
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 cifar import Cifar | |
from tqdm import tqdm | |
import tensorflow as tf | |
import model | |
import helper | |
learning_rate = 0.001 | |
batch_size = 16 | |
no_of_epochs = 10 |
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 numpy as np | |
import pickle | |
import os | |
import math | |
def __extract_file__(fname): | |
with open(fname, 'rb') as fo: | |
d = pickle.load(fo, encoding='bytes') | |
return d |
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 cifar import Cifar | |
from tqdm import tqdm | |
import tensorflow as tf | |
import model | |
import helper | |
learning_rate = 0.001 | |
batch_size = 16 | |
no_of_epochs = 10 |