Last active
January 29, 2016 18:59
-
-
Save kashefy/72205d7c2da39520f893 to your computer and use it in GitHub Desktop.
network definition for an Auto-encoder with tied weights. The weight are tied by sharing parameter names in 'permissive mode' and setting the decoder's ip params to use tranposed weigts.
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
name: "MNISTAutoencoderTiedWeights" | |
layer { | |
name: "mnist" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
scale: 0.00390625 | |
} | |
data_param { | |
source: "examples/mnist/mnist_train_lmdb" | |
batch_size: 100 | |
backend: LMDB | |
} | |
} | |
layer { | |
name: "mnist" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TEST | |
} | |
transform_param { | |
scale: 0.00390625 | |
} | |
data_param { | |
source: "examples/mnist/mnist_test_lmdb" | |
batch_size: 100 | |
backend: LMDB | |
} | |
} | |
layer { | |
name: "silence_label" | |
type: "Silence" | |
bottom: "label" | |
} | |
layer { | |
name: "flatdata" | |
type: "Flatten" | |
bottom: "data" | |
top: "flatdata" | |
} | |
layer { | |
name: "encode1" | |
type: "InnerProduct" | |
bottom: "data" | |
top: "encode1" | |
param { | |
name: "w" | |
lr_mult: 1 | |
decay_mult: 1 | |
share_mode: PERMISSIVE | |
} | |
param { | |
lr_mult: 2 | |
decay_mult: 0 | |
} | |
inner_product_param { | |
num_output: 10 | |
weight_filler { | |
type: "gaussian" | |
std: 1 | |
} | |
bias_filler { | |
type: "constant" | |
value: 0 | |
} | |
} | |
} | |
layer { | |
name: "encode1neuron" | |
type: "Sigmoid" | |
bottom: "encode1" | |
top: "encode1neuron" | |
} | |
layer { | |
name: "decode1" | |
type: "InnerProduct" | |
bottom: "encode1neuron" | |
top: "decode1" | |
param { | |
name: "w" | |
lr_mult: 1 | |
decay_mult: 1 | |
share_mode: PERMISSIVE | |
} | |
param { | |
lr_mult: 2 | |
decay_mult: 0 | |
} | |
inner_product_param { | |
num_output: 784 | |
weight_filler { | |
type: "gaussian" | |
std: 1 | |
} | |
bias_filler { | |
type: "constant" | |
value: 0 | |
} | |
} | |
} | |
layer { | |
name: "loss" | |
type: "SigmoidCrossEntropyLoss" | |
bottom: "decode1" | |
bottom: "flatdata" | |
top: "cross_entropy_loss" | |
loss_weight: 1 | |
} | |
layer { | |
name: "decode1neuron" | |
type: "Sigmoid" | |
bottom: "decode1" | |
top: "decode1neuron" | |
} | |
layer { | |
name: "loss" | |
type: "EuclideanLoss" | |
bottom: "decode1neuron" | |
bottom: "flatdata" | |
top: "l2_error" | |
loss_weight: 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment