SmartEngine  1.6.0
Parameter.h
1 // Copyright (C) Entropy Software LLC - All Rights Reserved
2 
3 #pragma once
4 
5 #include "GraphNode.h"
6 #include "Resource.h"
7 
8 namespace SmartEngine
9 {
10 
11 #pragma pack(push, 4)
12 struct ParameterCInfo : GraphNodeCInfo
16 {
20  int dimension = 1;
21 
26  float weightMean = 0.0f;
27 
33 };
34 #pragma pack(pop)
35 
42 class SMARTENGINE_EXPORT IParameter : public IGraphNode, public ISerializable
43 {
44 public:
45  SMARTENGINE_DECLARE_CLASS(IParameter)
46 
47 
48  virtual void SetRandomWeights() = 0;
51 };
52 
56 SMARTENGINE_EXPORT ObjectPtr<IParameter> CreateParameter(const ParameterCInfo& cinfo);
57 
59 extern "C"
60 {
61  SMARTENGINE_EXPORT ObjPtr Parameter_CreateInstance(const ParameterCInfo& cinfo);
62  SMARTENGINE_EXPORT void Parameter_SetRandomWeights(ObjPtr object);
63 }
65 
66 } // namespace SmartEngine
SmartEngine::IGraphNode
A logical node in the AI graph. Some nodes, like NeuralNetwork, are composed of other nodes (neuron l...
Definition: GraphNode.h:34
SmartEngine::ISerializable
Base class for objects that can be loaded from and saved to an in memory buffer.
Definition: Resource.h:54
SmartEngine::ParameterCInfo::weightMean
float weightMean
Defines the mean of the weights when randomizing the values.
Definition: Parameter.h:26
SmartEngine::ParameterCInfo::weightStandardDeviation
float weightStandardDeviation
Defines the standard deviation of the weights when randomizing the values.
Definition: Parameter.h:32
SmartEngine::ObjectPtr
Smart pointer to an IObject. Automatic ref counting.
Definition: ObjectPtr.h:16
SmartEngine
Definition: A2CTrainer.h:10
SmartEngine::ParameterCInfo
Data used to construct an IParameter instance
Definition: Parameter.h:16
SmartEngine::IParameter
A parameter is similar to a NeuronLayer in that it is trainable. However, it takes no input and is si...
Definition: Parameter.h:43
SmartEngine::ParameterCInfo::dimension
int dimension
The output dimension of the layer.
Definition: Parameter.h:20
SmartEngine::CreateParameter
SMARTENGINE_EXPORT ObjectPtr< IParameter > CreateParameter(const ParameterCInfo &cinfo)
Creates an instance of IParameter