Skip to content

Instantly share code, notes, and snippets.

@hgaiser
hgaiser / test.prototxt
Created October 5, 2016 08:18
ResNet50 light 3-stage
name: "ResNet50"
input: "data"
input_shape {
dim: 1
dim: 3
dim: 224
dim: 224
}
name: "ResNet-101"
layer {
name: 'input-data'
type: 'Python'
top: 'data'
top: 'im_info'
top: 'gt_boxes'
python_param {
module: 'roi_data_layer.layer'
name: "SimpleTriNet"
layer {
name: "data"
type: "Module"
top: "anchor"
top: "negative"
top: "positive"
module_param {
module: "triplet_layers"
train_net: "models/apc/ResNet18/faster_rcnn_end2end/train.prototxt"
base_lr: 0.1
lr_policy: "step"
gamma: 0.1
stepsize: 50000
display: 20
average_loss: 100
# iter_size: 1
momentum: 0.9
weight_decay: 0.0005
name: "fkp_net"
layers {
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param {
batch_size: 1783 #batch size, so how many prediction youu want to do at once. Best is "1", but higher number get better performance
channels: 1
height: 96
def get_session():
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
return tf.Session(config=config)
keras.backend.tensorflow_backend.set_session(get_session())
@hgaiser
hgaiser / mnist_tf.py
Last active July 13, 2017 07:29
MNIST example with Keras model and TF ops
#!/usr/bin/env python
import tensorflow as tf
from tensorflow.contrib.keras.api import keras
from tensorflow.contrib.keras.api.keras.models import Model, load_model
from tensorflow.contrib.keras.api.keras.layers import Input, Dense, Dropout, Flatten, Conv2D, MaxPooling2D, Activation, Lambda
from tensorflow.contrib.keras.api.keras.datasets import mnist
from tensorflow.contrib.keras.api.keras.utils import to_categorical
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.