Class Bernoulli
Represents a Bernoulli
random layer. This generates an output tensor with values 0 or 1 from a Bernoulli distribution. The input tensor contains the probabilities used for generating the output values.
Inherited Members
Namespace: Unity.Sentis.Layers
Syntax
[Serializable]
public class Bernoulli : RandomLayer
Constructors
Bernoulli(String, String, DataType, Nullable<Single>)
Initializes and returns an instance of Bernoulli
random layer.
Declaration
public Bernoulli(string name, string input, DataType dataType, float? seed)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name to use for the output tensor of the layer. |
String | input | The name to use for the probabilities tensor of the layer. |
DataType | dataType | The data type of the output as a |
Nullable<Single> | seed | The optional seed to use for the random number generation. If this is |
Fields
dataType
The data type of the output as a DataType
.
Declaration
public DataType dataType
Field Value
Type | Description |
---|---|
DataType |
Methods
Execute(Tensor[], ExecutionContext)
Executes the layer using the operations and variables from the ExecutionContext
and returns the output tensor.
If the layer has more than one output, output tensors are saved to variables.
Declaration
public override Tensor Execute(Tensor[] inputTensors, ExecutionContext ctx)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | inputTensors | |
ExecutionContext | ctx |
Returns
Type | Description |
---|---|
Tensor |
Overrides
ToString()
Returns a string that represents the Layer
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |