softplus.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/node.hpp"
8 #include "ngraph/op/op.hpp"
9 
10 namespace ngraph
11 {
12  namespace op
13  {
14  namespace v4
15  {
16  /// \brief A Self Regularized Non-Monotonic Neural Activation Function
17  /// f(x) = ln(exp(x) + 1.)
18  ///
19  class NGRAPH_API SoftPlus : public ngraph::op::Op
20  {
21  public:
22  NGRAPH_RTTI_DECLARATION;
23 
24  SoftPlus() = default;
25  /// \brief Constructs an SoftPlus operation.
26  ///
27  /// \param data Input tensor
28  SoftPlus(const Output<Node>& arg);
29  bool visit_attributes(AttributeVisitor& visitor) override;
30  void validate_and_infer_types() override;
31 
32  virtual std::shared_ptr<Node>
33  clone_with_new_inputs(const OutputVector& new_args) const override;
34 
35  bool evaluate(const HostTensorVector& outputs,
36  const HostTensorVector& inputs) const override;
37  bool has_evaluate() const override;
38  };
39  } // namespace v4
40  } // namespace op
41 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Root of all actual ops.
Definition: op.hpp:17
A Self Regularized Non-Monotonic Neural Activation Function f(x) = ln(exp(x) + 1.)
Definition: softplus.hpp:20
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
SoftPlus(const Output< Node > &arg)
Constructs an SoftPlus operation.
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16