|
|
|
|
|
|
/// </remarks>
|
|
|
|
public InplaceArray<DimensionProperty> DimensionProperties; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The type of the observation, e.g. whether they are generic or
|
|
|
|
/// help determine the goal for the Agent.
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
public static ObservationSpec Vector(int length) |
|
|
|
{ |
|
|
|
InplaceArray<int> shape = new InplaceArray<int>(length); |
|
|
|
InplaceArray<DimensionProperty> dimProps = new InplaceArray<DimensionProperty>(DimensionProperty.None); |
|
|
|
return new ObservationSpec(shape, dimProps); |
|
|
|
return new ObservationSpec( |
|
|
|
new InplaceArray<int>(length), |
|
|
|
new InplaceArray<DimensionProperty>(DimensionProperty.None) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
public static ObservationSpec VariableLength(int obsSize, int maxNumObs) |
|
|
|
{ |
|
|
|
InplaceArray<int> shape = new InplaceArray<int>(obsSize, maxNumObs); |
|
|
|
InplaceArray<DimensionProperty> dimProps = new InplaceArray<DimensionProperty>(DimensionProperty.VariableSize, DimensionProperty.None); |
|
|
|
return new ObservationSpec(shape, dimProps); |
|
|
|
var dimProps = new InplaceArray<DimensionProperty>( |
|
|
|
DimensionProperty.VariableSize, |
|
|
|
DimensionProperty.None |
|
|
|
); |
|
|
|
return new ObservationSpec( |
|
|
|
new InplaceArray<int>(obsSize, maxNumObs), |
|
|
|
dimProps |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
public static ObservationSpec Visual(int height, int width, int channels) |
|
|
|
{ |
|
|
|
InplaceArray<int> shape = new InplaceArray<int>(height, width, channels); |
|
|
|
InplaceArray<DimensionProperty> dimProps = new InplaceArray<DimensionProperty>( |
|
|
|
DimensionProperty.TranslationalEquivariance, DimensionProperty.TranslationalEquivariance, DimensionProperty.None |
|
|
|
var dimProps = new InplaceArray<DimensionProperty>( |
|
|
|
DimensionProperty.TranslationalEquivariance, |
|
|
|
DimensionProperty.TranslationalEquivariance, |
|
|
|
DimensionProperty.None |
|
|
|
return new ObservationSpec(shape, dimProps); |
|
|
|
return new ObservationSpec( |
|
|
|
new InplaceArray<int>(height, width, channels), |
|
|
|
dimProps |
|
|
|
); |
|
|
|
/// <remarks>
|
|
|
|
/// Note that not all combinations of DimensionProperty may be supported by the trainer.
|
|
|
|
/// shape and dimensionProperties must have the same size.
|
|
|
|
/// </remarks>
|
|
|
|
internal ObservationSpec( |
|
|
|
public ObservationSpec( |
|
|
|
InplaceArray<int> shape, |
|
|
|
InplaceArray<DimensionProperty> dimensionProperties, |
|
|
|
ObservationType observationType = ObservationType.Default |
|
|
|