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

softmax_cross_layer_forward_types.h
1 /* file: softmax_cross_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 softmax cross-entropy layer types.
19 //--
20 */
21 
22 #ifndef __NEURAL_NENTWORK_LOSS_SOFTMAX_CROSS_LAYER_FORWARD_TYPES_H__
23 #define __NEURAL_NENTWORK_LOSS_SOFTMAX_CROSS_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 #include "algorithms/neural_networks/layers/loss/loss_layer_forward_types.h"
31 #include "algorithms/neural_networks/layers/loss/softmax_cross_layer_types.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
37 namespace neural_networks
38 {
39 namespace layers
40 {
41 namespace loss
42 {
43 namespace softmax_cross
44 {
54 namespace forward
55 {
59 namespace interface1
60 {
65 class DAAL_EXPORT Input : public loss::forward::Input
66 {
67 public:
68  typedef loss::forward::Input super;
70  Input();
71 
73  Input(const Input& other);
74 
78  using loss::forward::Input::get;
79 
83  using loss::forward::Input::set;
84 
89  virtual const services::Collection<size_t> getWeightsSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
90 
95  virtual const services::Collection<size_t> getBiasesSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
96 
104  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
105 
106  virtual ~Input() {}
107 };
108 
114 class DAAL_EXPORT Result : public loss::forward::Result
115 {
116 public:
117  DECLARE_SERIALIZABLE_CAST(Result);
119  Result();
120  virtual ~Result() {};
121 
125  using loss::forward::Result::get;
126 
130  using loss::forward::Result::set;
131 
137  data_management::TensorPtr get(LayerDataId id) const;
138 
144  void set(LayerDataId id, const data_management::TensorPtr &value);
145 
154  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
155 
164  template <typename algorithmFPType>
165  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
166 
171  virtual const services::Collection<size_t> getValueSize(const services::Collection<size_t> &inputSize,
172  const daal::algorithms::Parameter *par, const int method) const DAAL_C11_OVERRIDE;
173 
180  virtual services::Status setResultForBackward(const daal::algorithms::Input *input) DAAL_C11_OVERRIDE;
181 
182 protected:
184  template<typename Archive, bool onDeserialize>
185  services::Status serialImpl(Archive *arch)
186  {
187  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
188  }
189 };
190 typedef services::SharedPtr<Result> ResultPtr;
191 
192 } // namespace interface1
193 using interface1::Input;
194 using interface1::Result;
195 using interface1::ResultPtr;
196 } // namespace forward
198 } // namespace softmax_cross
199 } // namespace loss
200 } // namespace layers
201 } // namespace neural_networks
202 } // namespace algorithm
203 } // namespace daal
204 #endif
daal::algorithms::neural_networks::layers::loss::softmax_cross::LayerDataId
LayerDataId
Identifiers of input objects for the backward softmax cross-entropy layer and results for the forward...
Definition: softmax_cross_layer_types.h:62
daal
Definition: algorithm_base_common.h:31
daal_defines.h
daal::algorithms::neural_networks::layers::loss::softmax_cross::forward::interface1::Result
Provides methods to access the result obtained with the compute() method of the forward softmax cross...
Definition: softmax_cross_layer_forward_types.h:114
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::neural_networks::layers::loss::softmax_cross::forward::interface1::Input
Input objects for the forward softmax cross-entropy layer
Definition: softmax_cross_layer_forward_types.h:65

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