Skip to content

Commit 49003df

Browse files
author
Chris Elion
authored
rename to Perceive() (#3527)
1 parent 74a53e7 commit 49003df

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2222
- A tutorial on adding custom SideChannels was added (#3391)
2323
- The stepping logic for the Agent and the Academy has been simplified (#3448)
2424
- Update Barracuda to 0.6.0-preview
25-
- The interface for `RayPerceptionSensor.PerceiveStatic()` was changed to take an input class and write to an output class.
25+
* The interface for `RayPerceptionSensor.PerceiveStatic()` was changed to take an input class and write to an output class, and the method was renamed to `Perceive()`.
2626
- The checkpoint file suffix was changed from `.cptk` to `.ckpt` (#3470)
2727
- The command-line argument used to determine the port that an environment will listen on was changed from `--port` to `--mlagents-port`.
2828
- `DemonstrationRecorder` can now record observations outside of the editor.

com.unity.ml-agents/Runtime/Sensor/RayPerceptionSensor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public virtual SensorCompressionType GetCompressionType()
347347
/// </summary>
348348
/// <param name="input">Input defining the rays that will be cast.</param>
349349
/// <returns>Output struct containing the raycast results.</returns>
350-
public static RayPerceptionOutput PerceiveStatic(RayPerceptionInput input)
350+
public static RayPerceptionOutput Perceive(RayPerceptionInput input)
351351
{
352352
RayPerceptionOutput output = new RayPerceptionOutput();
353353
output.rayOutputs = new RayPerceptionOutput.RayOutput[input.angles.Count];

docs/Migrating.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The versions can be found in
1414
* The `SetActionMask` method must now be called on the optional `ActionMasker` argument of the `CollectObservations` method. (We now consider an action mask as a type of observation)
1515
* The `Monitor` class has been moved to the Examples Project. (It was prone to errors during testing)
1616
* The `MLAgents.Sensor` namespace has been removed. All sensors now belong to the `MLAgents` namespace.
17-
* The interface for `RayPerceptionSensor.PerceiveStatic()` was changed to take an input class and write to an output class.
17+
* The interface for `RayPerceptionSensor.PerceiveStatic()` was changed to take an input class and write to an output class, and the method was renamed to `Perceive()`.
1818
* The `SetActionMask` method must now be called on the optional `ActionMasker` argument of the `CollectObservations` method. (We now consider an action mask as a type of observation)
1919
* The method `GetStepCount()` on the Agent class has been replaced with the property getter `StepCount`
2020
* The `--multi-gpu` option has been removed temporarily.
@@ -23,7 +23,8 @@ The versions can be found in
2323
* Add the `using MLAgents.Sensors;` in addition to `using MLAgents;` on top of your Agent's script.
2424
* Replace your Agent's implementation of `CollectObservations()` with `CollectObservations(VectorSensor sensor)`. In addition, replace all calls to `AddVectorObs()` with `sensor.AddObservation()` or `sensor.AddOneHotObservation()` on the `VectorSensor` passed as argument.
2525
* Replace your calls to `SetActionMask` on your Agent to `ActionMasker.SetActionMask` in `CollectObservations`
26-
* If you call `RayPerceptionSensor.PerceiveStatic()` manually, add your inputs to a `RayPerceptionInput`. To get the previous float array output, use `RayPerceptionOutput.ToFloatArray()`
26+
* If you call `RayPerceptionSensor.PerceiveStatic()` manually, add your inputs to a `RayPerceptionInput`. To get the previous float array output,
27+
iterate through `RayPerceptionOutput.rayOutputs` and call `RayPerceptionOutput.RayOutput.ToFloatArray()`.
2728
* Re-import all of your `*.NN` files to work with the updated Barracuda package.
2829
* Replace all calls to `Agent.GetStepCount()` with `Agent.StepCount`
2930

0 commit comments

Comments
 (0)