This file contains 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
# AlexNet | |
name: "AlexNet" | |
layer { | |
name: "train-data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
transform_param { | |
mirror: false | |
crop_size: 227 |
This file contains 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 sklearn.kernel_approximation import RBFSampler | |
from sklearn.decomposition import PCA | |
kernel_svm = svm.SVC(gamma=.2) | |
linear_svm = svm.LinearSVC() | |
feature_map_fourier = RBFSampler(gamma=.2, random_state=SEED) | |
feature_map_nystroem = Nystroem(gamma=.2, random_state=SEED) | |
fourier_approx_svm = pipeline.Pipeline([("feature_map", feature_map_fourier), | |
("svm", svm.LinearSVC())]) |
This file contains 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
# Importing data from csv file | |
csv_filename = './tweets.csv' | |
dataset = tf.contrib.data.make_csv_dataset(csv_filename, batch_size=32) | |
dataset = dataset.shuffle(buffer_size=100) | |
iter = dataset.make_one_shot_iterator() | |
next = iter.get_next() | |
features, labels = next['text'], next['sentiment'] | |
with tf.Session() as sess: | |
sess.run([features, labels]) |
This file contains 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
#! /usr/bin/env python | |
from __future__ import absolute_import, division, print_function | |
import os | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
import keras | |
import tensorflow.contrib.eager as tfe |
This file contains 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 urllib.request import urlopen | |
html = urlopen("http://www.google.com/") | |
print(html) |
This file contains 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
name: "ResNet-50" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { |
This file contains 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
name: "AlexNet" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
# transform_param { |
This file contains 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
name: "VGG_ILSVRC_16_layers" | |
layer { | |
name: "data" | |
type: "Data" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
crop_size: 224 | |
mean_value: 104 |
This file contains 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
name: "VGG_ILSVRC_19_layers" | |
input: "data" | |
input_dim: 10 | |
input_dim: 3 | |
input_dim: 224 | |
input_dim: 224 | |
layers { | |
bottom: "data" | |
top: "conv1_1" | |
name: "conv1_1" |
This file contains 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
>>> class Library(object): | |
... def __init__(self): | |
... self.books = { 'title' : object, 'title2' : object, 'title3' : object, } | |
... def __getitem__(self, i): | |
... return self.books[i] | |
... def __iter__(self): | |
... return self.books.itervalues() | |
... | |
>>> library = Library() | |
>>> library['title'] |
NewerOlder