Class Layer
Barracuda Model Layer
Inherited Members
Namespace: Unity.Barracuda
Syntax
public class Layer
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 = Layer.Activation.None)
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
[NonSerialized]
public int[] axes
Field Value
Type | Description |
---|---|
Int32[] |
axis
Axis
Declaration
public int 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
[NonSerialized]
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
[NonSerialized]
public string[] outputs
Field Value
Type | Description |
---|---|
String[] |
pad
Padding shape
Declaration
public int[] pad
Field Value
Type | Description |
---|---|
Int32[] |
pool
Pooling
Declaration
public int[] pool
Field Value
Type | Description |
---|---|
Int32[] |
stride
Stride
Declaration
public int[] 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 BarracudaArray weights
Field Value
Type | Description |
---|---|
BarracudaArray |
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 |