summaryrefslogtreecommitdiff
path: root/src/caffe/layers/hdf5_data_layer.cu
diff options
context:
space:
mode:
authorJeff Donahue <jeff.donahue@gmail.com>2014-07-11 01:55:17 -0700
committerJeff Donahue <jeff.donahue@gmail.com>2014-08-13 13:22:04 -0700
commit512a626fc71c69ed4460024b31c5fe8dff1e668c (patch)
treef3d11beb593a4e64e779a99b82538ceee7fae21a /src/caffe/layers/hdf5_data_layer.cu
parent7a3ed9b8edf43895770b63cb4d9f5cacf0dba047 (diff)
downloadcaffeonacl-512a626fc71c69ed4460024b31c5fe8dff1e668c.tar.gz
caffeonacl-512a626fc71c69ed4460024b31c5fe8dff1e668c.tar.bz2
caffeonacl-512a626fc71c69ed4460024b31c5fe8dff1e668c.zip
Generalize loss by allowing any top blob to be used as a loss in which
its elements are summed with a scalar coefficient. Forward for layers no longer returns a loss; instead all loss layers must have top blobs. Existing loss layers are given a top blob automatically by Net::Init, with an associated top_loss_weight of 1 (set in LossLayer::FurtherSetUp). Due to the increased amount of common SetUp logic, the SetUp interface is modified such that all subclasses should normally override FurtherSetUp only, which is called by SetUp.
Diffstat (limited to 'src/caffe/layers/hdf5_data_layer.cu')
-rw-r--r--src/caffe/layers/hdf5_data_layer.cu3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/caffe/layers/hdf5_data_layer.cu b/src/caffe/layers/hdf5_data_layer.cu
index 1f682d57..79cc536e 100644
--- a/src/caffe/layers/hdf5_data_layer.cu
+++ b/src/caffe/layers/hdf5_data_layer.cu
@@ -17,7 +17,7 @@ TODO:
namespace caffe {
template <typename Dtype>
-Dtype HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
+void HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
vector<Blob<Dtype>*>* top) {
const int batch_size = this->layer_param_.hdf5_data_param().batch_size();
const int data_count = (*top)[0]->count() / (*top)[0]->num();
@@ -44,7 +44,6 @@ Dtype HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
&label_blob_.cpu_data()[current_row_ * label_data_count],
&(*top)[1]->mutable_gpu_data()[i * label_data_count]);
}
- return Dtype(0.);
}
INSTANTIATE_CLASS(HDF5DataLayer);