Example #1
0
import aim
aim.init()

from aim import Profiler
Profiler.init()

import tensorflow as tf

# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)

from examples.tf_profiler_model import neural_net

learning_rate = 0.1
num_steps = 500
batch_size = 128
display_step = 100

# Network Parameters
n_hidden_1 = 256  # 1st layer number of neurons
n_hidden_2 = 256  # 2nd layer number of neurons
num_input = 784  # MNIST data input (img shape: 28*28)
num_classes = 10  # MNIST total classes (0-9 digits)

# tf Graph input
X = tf.placeholder('float', [None, num_input])
Y = tf.placeholder('float', [None, num_classes])

# Store layers weight & bias
weights = {
Example #2
0
from torchvision import models
from PIL import Image
import torch
import torchvision.transforms as T
import numpy as np

from aim import track
import aim

aim.init(True)

images = [
    Image.open('./data/bird.jpg'),
    Image.open('./data/car.jpeg'),
]

labels = {
    0: 'background',
    1: 'aeroplane',
    2: 'bicycle',
    3: 'bird',
    4: 'boat',
    5: 'bottle',
    6: 'bus',
    7: 'car',
    8: 'cat',
    9: 'chair',
    10: 'cow',
    11: 'diningtable',
    12: 'dog',
    13: 'horse',
Example #3
0
import time
import tensorflow as tf

# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data

import aim
aim.init(overwrite=True)

from aim import Profiler
Profiler.init(auto_detect_cycles=False, aggregate=Profiler.MEAN)

mnist = input_data.read_data_sets('/tmp/data/', one_hot=True)

learning_rate = 0.1
num_steps = 500
batch_size = 128
display_step = 100

# Network Parameters
n_hidden_1 = 256
n_hidden_2 = 256
num_input = 784
num_classes = 10

# tf Graph input
X = tf.placeholder('float', [None, num_input])
Y = tf.placeholder('float', [None, num_classes])

# Store layers weight & bias
weights = {
Example #4
0
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K

import aim
# Init aim with overwrite=False, every run will be committed and pushed
aim.init(overwrite=False)

from aim import Profiler
# initialize profiler
Profiler.init(sec_interval=2, squash=10)

batch_size = 128
num_classes = 10
epochs = 12

# input image dimensions
img_rows, img_cols = 28, 28

# the data, split between train and test sets
(x_train, y_train), (x_test, y_test) = mnist.load_data()

if K.image_data_format() == 'channels_first':
    x_train = x_train.reshape(x_train.shape[0], 1, img_rows, img_cols)
    x_test = x_test.reshape(x_test.shape[0], 1, img_rows, img_cols)
    input_shape = (1, img_rows, img_cols)
else:
    x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1)