C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 3

loss_layer_forward_types.h
1 /* file: loss_layer_forward_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the forward loss layer types.
19 //--
20 */
21 
22 #ifndef __LOSS_LAYER_FORWARD_TYPES_H__
23 #define __LOSS_LAYER_FORWARD_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "data_management/data/homogen_tensor.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/neural_networks/layers/layer_forward_types.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace neural_networks
36 {
37 namespace layers
38 {
39 namespace loss
40 {
50 namespace forward
51 {
56 enum InputId
57 {
58  data = layers::forward::data,
59  weights = layers::forward::weights,
60  biases = layers::forward::biases, /* Biases of the neural network layer */
61  groundTruth = layers::forward::lastInputLayerDataId + 1,
62  lastInputId = groundTruth
63 };
67 namespace interface1
68 {
73 class DAAL_EXPORT Input : public layers::forward::Input
74 {
75 public:
76  typedef layers::forward::Input super;
78  Input(size_t nElements = lastInputId + 1);
79 
83  using layers::forward::Input::get;
84 
88  using layers::forward::Input::set;
89 
95  data_management::TensorPtr get(forward::InputId id) const;
96 
102  void set(InputId id, const data_management::TensorPtr &ptr);
103 
108  virtual const services::Collection<size_t> getWeightsSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
109 
114  virtual const services::Collection<size_t> getBiasesSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
115 
116  virtual ~Input() {}
117 };
118 
124 class DAAL_EXPORT Result : public layers::forward::Result
125 {
126 public:
128  Result();
129  virtual ~Result() {};
130 
134  using layers::forward::Result::get;
135 
139  using layers::forward::Result::set;
140 
149  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
150 
159  template <typename algorithmFPType>
160  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
161 
166  virtual const services::Collection<size_t> getValueSize(const services::Collection<size_t> &inputSize,
167  const daal::algorithms::Parameter *par, const int method) const DAAL_C11_OVERRIDE;
168 };
169 } // namespace interface1
170 using interface1::Input;
171 using interface1::Result;
172 } // namespace forward
174 } // namespace loss
175 } // namespace layers
176 } // namespace neural_networks
177 } // namespace algorithm
178 } // namespace daal
179 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::loss::forward::groundTruth
Definition: loss_layer_forward_types.h:61
daal::algorithms::neural_networks::layers::loss::forward::interface1::Result
Provides methods to access the result obtained with the compute() method of the forward loss layer...
Definition: loss_layer_forward_types.h:124
daal::algorithms::neural_networks::layers::loss::forward::interface1::Input
Input objects for the forward loss layer
Definition: loss_layer_forward_types.h:73
daal::algorithms::neural_networks::layers::loss::forward::data
Definition: loss_layer_forward_types.h:58
daal_defines.h
daal::algorithms::neural_networks::layers::loss::forward::weights
Definition: loss_layer_forward_types.h:59
daal::algorithms::neural_networks::layers::loss::forward::InputId
InputId
Definition: loss_layer_forward_types.h:56
daal::algorithms::neural_networks::layers::forward::data
Definition: layer_forward_types.h:63

For more complete information about compiler optimizations, see our Optimization Notice.