【发布时间】:2017-12-19 17:05:26
【问题描述】:
这是一个简单的层,它将底部的 blob 传递到顶部,并且什么都不做。
import caffe
import numpy as np
class MyCustomLayer(caffe.Layer):
def setup(self, bottom, top):
if len(bottom) != 1:
raise Exception("Wrong number of bottom blobs")
def forward(self, bottom, top):
top[0].data[...] = bottom[0].data
def reshape(self, bottom, top):
top[0].reshape(*bottom[0].shape)
pass
def backward(self, propagate_down, bottom, top):
"""
This layer does not back propagate
"""
pass
但是,当在网络中使用时,网络不会收敛,并且会保持在 0.1 精度(而在使用此层之前为 0.75%)
我在这里做错了什么?
【问题讨论】:
标签: neural-network deep-learning caffe gradient-descent pycaffe