Class Layer
Barracuda Model Layer
Namespace: Unity.Barracuda
Syntax
public class Layer : object
Constructors
Layer(String, Layer.Activation)
Constructs Activation Layer
Declaration
public Layer(string layerName, Layer.Activation activationType)
Parameters
Type | Name | Description |
---|---|---|
String | layerName | layer name |
Layer.Activation | activationType | layer activation type |
Layer(String, Layer.Type, Layer.Activation)
Constructs Layer
Declaration
public Layer(string layerName, Layer.Type layerType, Layer.Activation activationType = default(Layer.Activation))
Parameters
Type | Name | Description |
---|---|---|
String | layerName | layer name |
Layer.Type | layerType | layer type |
Layer.Activation | activationType | layer activation type |
Fields
activation
Layer activation type
Declaration
public Layer.Activation activation
Field Value
Type | Description |
---|---|
Layer.Activation |
alpha
Alpha
Declaration
public float alpha
Field Value
Type | Description |
---|---|
Single |
axes
Axes (not serialized) - used for conversion
Declaration
public Int32[] axes
Field Value
Type | Description |
---|---|
Int32[] |
axis
Axis
Declaration
public Int32 axis
Field Value
Type | Description |
---|---|
Int32 |
beta
Beta
Declaration
public float beta
Field Value
Type | Description |
---|---|
Single |
datasets
Datasets bound to layer
Declaration
public Layer.DataSet[] datasets
Field Value
Type | Description |
---|---|
Layer.DataSet[] |
flags
Layer flags (not serialized) - used for conversion
Declaration
public Layer.Flags flags
Field Value
Type | Description |
---|---|
Layer.Flags |
inputs
Input (layer) names
Declaration
public string[] inputs
Field Value
Type | Description |
---|---|
String[] |
name
Layer name
Declaration
public string name
Field Value
Type | Description |
---|---|
String |
outputs
Output (layer) names (not serialized) - used for conversion
Declaration
public string[] outputs
Field Value
Type | Description |
---|---|
String[] |
pad
Padding shape
Declaration
public Int32[] pad
Field Value
Type | Description |
---|---|
Int32[] |
pool
Pooling
Declaration
public Int32[] pool
Field Value
Type | Description |
---|---|
Int32[] |
stride
Stride
Declaration
public Int32[] stride
Field Value
Type | Description |
---|---|
Int32[] |
type
Layer type
Declaration
public Layer.Type type
Field Value
Type | Description |
---|---|
Layer.Type |
weights
Flat weights array (for actual shape see datasets
)
Declaration
public float[] weights
Field Value
Type | Description |
---|---|
Single[] |
Methods
ApplyTensorToDataSet(Tensor, Int32)
Converts Tensor to DataSet
Declaration
public void ApplyTensorToDataSet(Tensor X, int index)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | input |
Int32 | index | dataset index |
DataSetToTensor(Int32)
Converts DataSet to Tensor
Declaration
public Tensor DataSetToTensor(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | dataset index |
Returns
Type | Description |
---|---|
Tensor | Tensor |
ToString()
Layer summary string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | layer summary string |