Visualisierung 2 CNN
ConvLayer Class Reference

Represents a Convolutional Layer of a CNN. More...

Inheritance diagram for ConvLayer:
Layer

Public Member Functions

 ConvLayer ()
 
override void SetExpansion (float expansion)
 
override List< List< Shape > > GetLineStartShapes (Vector2Int convShape, Vector2Int outputShape, Vector2 theoreticalOutputShape, Vector2Int stride, float allCalcs)
 Calculates and returns the positions of the line start points (for the CalcMesh() function) More...
 
override void CalcMesh ()
 Calculates and sets the mesh of the Layers game object. More...
 
override Vector3Int GetOutputShape ()
 
override Vector2Int Get2DOutputShape ()
 Returns a 2d Vector of the layers output shape. More...
 
void SetWeightTensorForEpoch (Array tensor, int epoch)
 
Array GetWeightTensorForEpoch (int epoch)
 
void SetWeightTensorShape (int[] tensorShape)
 
int [] GetWeightTensorShape ()
 
void SetActivationTensorForEpoch (Array tensor, int epoch)
 
Array GetActivationTensorForEpoch (int epoch)
 
void SetActivationTensorShape (int[] tensorShape)
 
int [] GetActivationTensorShape ()
 
- Public Member Functions inherited from Layer
 Layer ()
 
virtual void Init ()
 
Vector3 CenterPosition ()
 Just returns a Vector on the Z Axis with the correct z positon. More...
 
Vector2Int GetPadding ()
 Calculates rounded padding based on filter size. More...
 
void AddObserver (Layer observer)
 Adds an observer to be notified on parameter changes on this layer to allow downstream updated of dependent layers. More...
 
void RemoveObserver (Layer observer)
 Removes an observer. More...
 
void NotifyObservers ()
 Notifies obsevers that a parameter change has occured. More...
 
Layer GetInputLayer ()
 Get the input layer of this Layer. More...
 
void SetEpoch (int epoch)
 Set the epoch of this layer to load the correct tensor values in the mesh calculation procedure. More...
 

Public Attributes

int reducedDepth = 4
 
int fullDepth = 64
 
float filterSpread
 
float filterSpacing
 
float lineToGrid
 
float edgeBundle
 
float allCalculations
 
float allFiltersSpacing = 0.5f
 
float lineXToZ
 
float fullResHeight = 5.0f
 
float nodeSize
 
bool showOriginalDepth = false
 
- Public Attributes inherited from Layer
GameObject _input
 
Vector2Int reducedShape
 
Vector2Int stride = new Vector2Int(1, 1)
 
bool padding = true
 
float pointBrightness = 1.0f
 
float zOffset = 1.0f
 
float _scale = 1.0f
 
int epoch = 0
 

Protected Member Functions

override void SubUpdate ()
 
override void UpdateForParams ()
 Checks if parameters have been updated and reinitializes necessary data. More...
 
override List< ShapeGetPointShapes ()
 Returns a List of Shapes representing the pixels of the feature maps. More...
 
- Protected Member Functions inherited from Layer
float ZPosition ()
 Recursively returns the right ZOffset based on input layers. More...
 
void OnValidate ()
 Called after each parameter change in the editor. Contains main update procedures. More...
 
virtual void AddNodes (List< Vector3 > verts, List< int > inds)
 Adds the "pixels" to the mesh. More...
 
Vector3 GetEdgeBundleCenter (Vector3 originalPoint, float edgeBundle)
 Returns the edgebundle position for the corresponding point. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Layer
static int [] GetMultiDimIndices (int[] shape, int singleDimInd)
 Returns a multi dimensional index from a single dimensional one based on the shape of the multidimensional array. More...
 
- Protected Attributes inherited from Layer
Layer _inputLayer
 
Mesh _mesh
 
Renderer _renderer
 
bool _initialized = false
 
Vector2Int _tempRes = new Vector2Int(5, 5)
 
bool renderColored = false
 

Detailed Description

Represents a Convolutional Layer of a CNN.

Constructor & Destructor Documentation

◆ ConvLayer()

ConvLayer.ConvLayer ( )

Member Function Documentation

◆ CalcMesh()

override void ConvLayer.CalcMesh ( )
virtual

Calculates and sets the mesh of the Layers game object.

Reimplemented from Layer.

◆ Get2DOutputShape()

override Vector2Int ConvLayer.Get2DOutputShape ( )
virtual

Returns a 2d Vector of the layers output shape.

Returns

Reimplemented from Layer.

◆ GetActivationTensorForEpoch()

Array ConvLayer.GetActivationTensorForEpoch ( int  epoch)

◆ GetActivationTensorShape()

int [] ConvLayer.GetActivationTensorShape ( )

◆ GetLineStartShapes()

override List<List<Shape> > ConvLayer.GetLineStartShapes ( Vector2Int  convShape,
Vector2Int  outputShape,
Vector2  theoreticalOutputShape,
Vector2Int  stride,
float  allCalcs 
)
virtual

Calculates and returns the positions of the line start points (for the CalcMesh() function)

Parameters
convShape
outputShape
theoreticalOutputShape
stride
allCalcs
Returns

Implements Layer.

◆ GetOutputShape()

override Vector3Int ConvLayer.GetOutputShape ( )
virtual

Implements Layer.

◆ GetPointShapes()

override List<Shape> ConvLayer.GetPointShapes ( )
protectedvirtual

Returns a List of Shapes representing the pixels of the feature maps.

Returns

Implements Layer.

◆ GetWeightTensorForEpoch()

Array ConvLayer.GetWeightTensorForEpoch ( int  epoch)

◆ GetWeightTensorShape()

int [] ConvLayer.GetWeightTensorShape ( )

◆ SetActivationTensorForEpoch()

void ConvLayer.SetActivationTensorForEpoch ( Array  tensor,
int  epoch 
)

◆ SetActivationTensorShape()

void ConvLayer.SetActivationTensorShape ( int []  tensorShape)

◆ SetExpansion()

override void ConvLayer.SetExpansion ( float  expansion)
virtual

Reimplemented from Layer.

◆ SetWeightTensorForEpoch()

void ConvLayer.SetWeightTensorForEpoch ( Array  tensor,
int  epoch 
)

◆ SetWeightTensorShape()

void ConvLayer.SetWeightTensorShape ( int []  tensorShape)

◆ SubUpdate()

override void ConvLayer.SubUpdate ( )
protectedvirtual

Reimplemented from Layer.

◆ UpdateForParams()

override void ConvLayer.UpdateForParams ( )
protectedvirtual

Checks if parameters have been updated and reinitializes necessary data.

Reimplemented from Layer.

Member Data Documentation

◆ allCalculations

float ConvLayer.allCalculations

◆ allFiltersSpacing

float ConvLayer.allFiltersSpacing = 0.5f

◆ edgeBundle

float ConvLayer.edgeBundle

◆ filterSpacing

float ConvLayer.filterSpacing

◆ filterSpread

float ConvLayer.filterSpread

◆ fullDepth

int ConvLayer.fullDepth = 64

◆ fullResHeight

float ConvLayer.fullResHeight = 5.0f

◆ lineToGrid

float ConvLayer.lineToGrid

◆ lineXToZ

float ConvLayer.lineXToZ

◆ nodeSize

float ConvLayer.nodeSize

◆ reducedDepth

int ConvLayer.reducedDepth = 4

◆ showOriginalDepth

bool ConvLayer.showOriginalDepth = false

The documentation for this class was generated from the following file: