Как подготовить авто-кодер для набора данных MNIST в NVIDIA-Digits с помощью Caffe?
Я хочу реализовать автоматический кодировщик на mnist_generic с caffe в цифрах NVIDIA. Я сделал набор данных на основе подхода, описанного здесь: https://github.com/NVIDIA/DIGITS/tree/master/examples/autoencoder
Но я не хочу использовать Torch или Tensorflow для создания автоэнкодера. Я хочу сделать это с Кафе.
Я использовал mnist_autoencoder, предоставленный в caffe, и запустил его в DIGITS.
Но я получаю ошибку как:
ERROR: cannot specify two val image data layers
Когда я удалил слой для тестирования (третий слой в архитектуре), я получил эту ошибку:
ERROR: Check failed: bottom[0]->count() == bottom[1]->count() (78400 vs. 235200) SIGMOID_CROSS_ENTROPY_LOSS layer inputs must have the same count.
Вот архитектура автоэнкодера:
name: "MNISTAutoencoder"
layer {
name: "data"
type: "Data"
top: "data"
include {
phase: TRAIN
}
transform_param {
scale: 0.0039215684
}
data_param {
batch_size: 100
backend: LMDB
}
}
layer {
name: "data"
type: "Data"
top: "data"
include {
phase: TEST
stage: "test-on-train"
}
transform_param {
scale: 0.0039215684
}
data_param {
batch_size: 100
backend: LMDB
}
}
layer {
name: "data"
type: "Data"
top: "data"
include {
phase: TEST
stage: "test-on-test"
}
transform_param {
scale: 0.0039215684
}
data_param {
batch_size: 100
backend: LMDB
}
}
layer {
name: "flatdata"
type: "Flatten"
bottom: "data"
top: "flatdata"
}
layer {
name: "encode1"
type: "InnerProduct"
bottom: "data"
top: "encode1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 1000
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "encode1neuron"
type: "Sigmoid"
bottom: "encode1"
top: "encode1neuron"
}
layer {
name: "encode2"
type: "InnerProduct"
bottom: "encode1neuron"
top: "encode2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 500
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "encode2neuron"
type: "Sigmoid"
bottom: "encode2"
top: "encode2neuron"
}
layer {
name: "encode3"
type: "InnerProduct"
bottom: "encode2neuron"
top: "encode3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 250
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "encode3neuron"
type: "Sigmoid"
bottom: "encode3"
top: "encode3neuron"
}
layer {
name: "encode4"
type: "InnerProduct"
bottom: "encode3neuron"
top: "encode4"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 30
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "decode4"
type: "InnerProduct"
bottom: "encode4"
top: "decode4"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 250
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "decode4neuron"
type: "Sigmoid"
bottom: "decode4"
top: "decode4neuron"
}
layer {
name: "decode3"
type: "InnerProduct"
bottom: "decode4neuron"
top: "decode3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 500
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "decode3neuron"
type: "Sigmoid"
bottom: "decode3"
top: "decode3neuron"
}
layer {
name: "decode2"
type: "InnerProduct"
bottom: "decode3neuron"
top: "decode2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 1000
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "decode2neuron"
type: "Sigmoid"
bottom: "decode2"
top: "decode2neuron"
}
layer {
name: "decode1"
type: "InnerProduct"
bottom: "decode2neuron"
top: "decode1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 784
weight_filler {
type: "gaussian"
std: 1
sparse: 15
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "loss"
type: "SigmoidCrossEntropyLoss"
bottom: "decode1"
bottom: "flatdata"
top: "cross_entropy_loss"
loss_weight: 1
include {
phase: TRAIN
}
}
layer {
name: "decode1neuron"
type: "Sigmoid"
bottom: "decode1"
top: "decode1neuron"
}
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "decode1neuron"
bottom: "flatdata"
top: "l2_error"
loss_weight: 0
include {
phase: TRAIN
}
}
Знаете ли вы, как я могу обучить этот mnist autoencoder, используя caffe в nvidia-цифрах?