SmartEngine  1.6.0
Pooling.h
1 // Copyright (C) Entropy Software LLC - All Rights Reserved
2 
3 #pragma once
4 
5 #include "GraphNode.h"
6 
7 namespace SmartEngine
8 {
9 
10 class IPoolingLayer;
11 
12 #pragma pack(push, 4)
13 enum class PoolType : byte
14 {
18  Max,
19 
23  Average,
24 
25  Count,
26 };
27 SMARTENGINE_ENUM_STRING(PoolType, "Max", "Average");
28 
33 {
37  IGraphNode* input = nullptr;
38 
42  PoolType type = PoolType::Max;
43 
48  int inputWidth = -1;
49 
54  int inputHeight = -1;
55 };
56 
61 {
65  IGraphNode* input = nullptr;
66 
73 };
74 #pragma pack(pop)
75 
80 class SMARTENGINE_EXPORT IPoolingLayer : public IGraphNode
81 {
82 public:
83  SMARTENGINE_DECLARE_CLASS(IPoolingLayer)
84 };
85 
90 class SMARTENGINE_EXPORT IUnpoolingLayer : public IGraphNode
91 {
92 public:
93  SMARTENGINE_DECLARE_CLASS(IUnpoolingLayer)
94 };
95 
100 
105 
107 extern "C"
108 {
109  SMARTENGINE_EXPORT ObjPtr PoolingLayer_CreateInstance(const PoolingLayerCInfo& cinfo);
110  SMARTENGINE_EXPORT ObjPtr UnpoolingLayer_CreateInstance(const UnpoolingLayerCInfo& cinfo);
111 }
113 
114 } // 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::PoolingLayerCInfo::inputWidth
int inputWidth
Input width. If the previous layer is a Conv2D layer, you can set this to -1 to have it auto-calculat...
Definition: Pooling.h:48
SmartEngine::PoolType::Max
@ Max
Outputs the maximum value of the block of inputs
SmartEngine::GeneticAgentScoringMethod::Sum
@ Sum
Sum the scores of all agents associated with the chromosome
SmartEngine::GraphNodeCInfo
Data used to construct an IGraphNode instance
Definition: GraphNode.h:17
SmartEngine::CreatePoolingLayer
SMARTENGINE_EXPORT ObjectPtr< IPoolingLayer > CreatePoolingLayer(const PoolingLayerCInfo &cinfo)
Creates an instance of IPoolingLayer
SmartEngine::PoolingLayerCInfo::inputHeight
int inputHeight
Input height. If the previous layer is a Conv2D layer, you can set this to -1 to have it auto-calcula...
Definition: Pooling.h:54
SmartEngine::CreateUnpoolingLayer
SMARTENGINE_EXPORT ObjectPtr< IUnpoolingLayer > CreateUnpoolingLayer(const UnpoolingLayerCInfo &cinfo)
Creates an instance of IUnpoolingLayer
SmartEngine::ObjectPtr
Smart pointer to an IObject. Automatic ref counting.
Definition: ObjectPtr.h:16
SmartEngine
Definition: A2CTrainer.h:10
SmartEngine::PoolType
PoolType
Definition: Pooling.h:14
SmartEngine::IUnpoolingLayer
2D unpooling layer. Typically used before a conv2d transpose layer to expand the output dimension....
Definition: Pooling.h:91
SmartEngine::UnpoolingLayerCInfo::input
IGraphNode * input
The input into this pool.
Definition: Pooling.h:65
SmartEngine::PoolingLayerCInfo
Pool constructor info
Definition: Pooling.h:33
SmartEngine::UnpoolingLayerCInfo
Unpool constructor info
Definition: Pooling.h:61
SmartEngine::IPoolingLayer
2D pooling layer. Typically used after a conv2d layer to reduce the output dimension....
Definition: Pooling.h:81
SmartEngine::UnpoolingLayerCInfo::poolingLayer
IPoolingLayer * poolingLayer
Reference to the original pooling layer. This is used to determine which of the output components to ...
Definition: Pooling.h:72
SmartEngine::PoolingLayerCInfo::input
IGraphNode * input
The input into this pool.
Definition: Pooling.h:37
SmartEngine::PoolingLayerCInfo::type
PoolType type
The type of pooling to apply.
Definition: Pooling.h:42