Skip to content

2.0 verified to main #5385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0e6ac12
check for missing AbstractBoard, display warning (#5276) (#5278)
Apr 16, 2021
66cfd91
[Release 17] Updating the release table on README.md (#5289)
vincentpierre Apr 19, 2021
af761d1
POCA Attention will use h_size for embedding size and not 128 (#5281)…
vincentpierre Apr 19, 2021
417c51d
Add doc for deriving from grid sensor base (#5282) (#5292)
Apr 19, 2021
5767791
Run package tests with warn-as-error (#5290) (#5293)
Apr 19, 2021
bc8f219
Updating the barracuda 1.4.0 (#5291) (#5294)
vincentpierre Apr 19, 2021
2d39303
Release 17 version bumps and docs version bumps (#5280)
vincentpierre Apr 19, 2021
cacfc8c
collecting latest step as a stat (#5264) (#5295)
maryamhonari Apr 20, 2021
506ddd2
Fix inference CI timeouts in Match3 and VisualFoodCollector (#5298) (…
Apr 21, 2021
ee80368
update packages-lock.json (#5306)
Apr 22, 2021
06488b0
[debug] Require all behavior names to have a matching YAML entry (#52…
Apr 22, 2021
72fd631
Migration guide - list removed APIs with replacements (#5307)
Apr 22, 2021
403a9f0
[docs] Update changelog (#5308)
Apr 22, 2021
c4d5077
doc cleanup (#5309)
Apr 22, 2021
b629b49
remove MaxStep from Soccer agents (#5310)
Apr 23, 2021
9e03966
[MLA-1952] Add optional seed for gym action spaces (#5303) (#5315)
Apr 23, 2021
1c405c8
Bring back root reference in grid sensor (#5300) (#5313)
Apr 24, 2021
39cf806
Update test filter to exclude all Test namespaces. (#5327)
surfnerd Apr 29, 2021
4e62778
Update version to 'pre.2' (#5326)
surfnerd Apr 29, 2021
425be08
Test 2021.2 (#5329)
surfnerd Apr 29, 2021
c1870fa
Fix stacked grid sensor (#5335) (#5336)
May 3, 2021
88c2ece
Update barracuda to 2.0.0-pre.3, update ml-agents to pre.3.
surfnerd May 6, 2021
9f88169
Readding the validation of the minimal cnn input size (#5345) (#5346)
vincentpierre May 10, 2021
0d0c77f
Light proofreading.
jo3w4rd May 10, 2021
167e7e3
dotnet-format
May 11, 2021
fd1562d
clarify BoardSize.NumCellTypes and BoardSize.NumSpecialTypes
May 11, 2021
6011cde
Update com.unity.ml-agents/Runtime/Sensors/ISensor.cs
surfnerd May 11, 2021
58e5cbc
limit trigger to this file (#5360) (#5361)
May 12, 2021
b4b1ced
Update triggers. (#5362)
surfnerd May 12, 2021
e6a6ea1
[bug-fix] Make resnet barracuda-compatible (#5358) (#5364)
surfnerd May 13, 2021
c40d626
Update to Unity Package licenses (#5340) (#5365)
surfnerd May 13, 2021
439b938
Merge remote-tracking branch 'origin/main' into 2.0-verified-to-main
May 24, 2021
81c79c7
change branch targets
May 24, 2021
7f759c2
update package locks, changelog, change ml-agents back to exp.1
May 24, 2021
92cf183
Merge remote-tracking branch 'origin/main' into 2.0-verified-to-main
May 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_editors:
- version: 2020.2
testProject: DevProject
enableNoDefaultPackages: !!bool true
- version: 2021.1
- version: 2021.2
testProject: DevProject
enableNoDefaultPackages: !!bool true

Expand Down
2 changes: 1 addition & 1 deletion .yamato/test_versions.metafile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ test_editors:
extra_test: gym
- version: 2020.3
extra_test: sensor
- version: 2021.1
- version: 2021.2
extra_test: llapi
2 changes: 1 addition & 1 deletion DevProject/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.package-manager-doctools": "1.7.0-preview",
"com.unity.package-validation-suite": "0.19.0-preview",
"com.unity.test-framework": "1.1.22",
"com.unity.test-framework": "1.1.24",
"com.unity.test-framework.performance": "2.2.0-preview",
"com.unity.testtools.codecoverage": "1.0.0-pre.3",
"com.unity.modules.imageconversion": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions DevProject/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"com.unity.barracuda": {
"version": "1.4.0-preview",
"version": "2.0.0-pre.3",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -55,7 +55,7 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.unity.barracuda": "1.4.0-preview",
"com.unity.barracuda": "2.0.0-pre.3",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
Expand Down Expand Up @@ -112,7 +112,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.test-framework": {
"version": "1.1.22",
"version": "1.1.24",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions DevProject/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2020.3.0f1
m_EditorVersionWithRevision: 2020.3.0f1 (c7b5465681fb)
m_EditorVersion: 2020.3.5f1
m_EditorVersionWithRevision: 2020.3.5f1 (8095aa901b9b)
2 changes: 1 addition & 1 deletion Project/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.unity.test-framework": "1.1.22",
"com.unity.test-framework": "1.1.24",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.20-preview",
"com.unity.ugui": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions Project/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"com.unity.barracuda": {
"version": "1.4.0-preview",
"version": "2.0.0-pre.3",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.unity.barracuda": "1.4.0-preview",
"com.unity.barracuda": "2.0.0-pre.3",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
Expand Down Expand Up @@ -91,7 +91,7 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.22",
"version": "1.1.24",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions Project/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.4.20f1
m_EditorVersionWithRevision: 2019.4.20f1 (6dd1c08eedfa)
m_EditorVersion: 2019.4.25f1
m_EditorVersionWithRevision: 2019.4.25f1 (01a0494af254)
1 change: 1 addition & 0 deletions com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to
### Major Changes
### Minor Changes
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
- update Barracuda to 2.0.0-pre.3. (#5385)
- Fixed NullReferenceException when adding Behavior Parameters with no Agent. (#5382)
#### ml-agents / ml-agents-envs / gym-unity (Python)
- Added a fully connected visual encoder for environments with very small image inputs. (#5351)
Expand Down
6 changes: 3 additions & 3 deletions com.unity.ml-agents/Documentation~/com.unity.ml-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The _ML-Agents_ package contains the primary C# SDK for the [Unity ML-Agents
Toolkit].

The package allows you to convert any Unity scene to into a learning environment
The package allows you to convert any Unity scene into a learning environment
and train character behaviors using a variety of machine learning algorithms.
Additionally, it allows you to embed these trained behaviors back into Unity
scenes to control your characters. More specifically, the package provides the
Expand All @@ -12,7 +12,7 @@ following core functionalities:
- Define Agents: entities, or characters, whose behavior will be learned. Agents
are entities that generate observations (through sensors), take actions, and
receive rewards from the environment.
- Define Behaviors: entities that specifiy how an agent should act. Multiple
- Define Behaviors: entities that specify how an agent should act. Multiple
agents can share the same Behavior and a scene may have multiple Behaviors.
- Record demonstrations of an agent within the Editor. You can use
demonstrations to help train a behavior for that agent.
Expand Down Expand Up @@ -55,7 +55,7 @@ To install the companion Python package to enable training behaviors, follow the
[installation instructions] on our [GitHub repository].

### Advanced Installation
With the changes to Unity Package Manager in 2021, experimental packages will not show up in package list and have to be installed manually. There are two recommended ways to install the package manually:
With the changes to Unity Package Manager in 2021, experimental packages will not show up in the package list and have to be installed manually. There are two recommended ways to install the package manually:

#### Github via Package Manager

Expand Down
8 changes: 1 addition & 7 deletions com.unity.ml-agents/Documentation~/filter.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
apiRules:
- exclude:
uidRegex: ^Unity.MLAgents\.Tests$
uidRegex: .*Test.*
type: Namespace
- exclude:
uidRegex: ^Unity.MLAgents\.CommunicatorObjects$
type: Namespace
- exclude:
uidRegex: ^Unity.MLAgents\.Tests\.Communicator$
type: Namespace
- exclude:
uidRegex: ^Unity.MLAgents\.Tests\.Actuators$
type: Namespace
- exclude:
uidRegex: ^Unity.MLAgents\.Editor$
type: Namespace
Expand Down
8 changes: 4 additions & 4 deletions com.unity.ml-agents/Runtime/Actuators/IDiscreteActionMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ public interface IDiscreteActionMask
/// <remarks>
/// By default, all discrete actions are allowed.
/// If isEnabled is false, the agent will not be able to perform the actions passed as argument
/// at the next decision for the specified action branch. The actionIndex correspond
/// at the next decision for the specified action branch. The actionIndex corresponds
/// to the action options the agent will be unable to perform.
///
/// See [Agents - Actions] for more information on masking actions.
///
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#masking-discrete-actions
/// </remarks>
/// <param name="branch">The branch for which the actions will be masked.</param>
/// <param name="actionIndex">Index of the action</param>
/// <param name="isEnabled">Whether the action is allowed or now.</param>
/// <param name="actionIndex">Index of the action.</param>
/// <param name="isEnabled">Whether the action is allowed or not.</param>
void SetActionEnabled(int branch, int actionIndex, bool isEnabled);
}
}
34 changes: 17 additions & 17 deletions com.unity.ml-agents/Runtime/Integrations/Match3/AbstractBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct BoardSize
public static bool operator <=(BoardSize lhs, BoardSize rhs)
{
return lhs.Rows <= rhs.Rows && lhs.Columns <= rhs.Columns && lhs.NumCellTypes <= rhs.NumCellTypes &&
lhs.NumSpecialTypes <= rhs.NumSpecialTypes;
lhs.NumSpecialTypes <= rhs.NumSpecialTypes;
}

/// <summary>
Expand All @@ -53,7 +53,7 @@ public struct BoardSize
public static bool operator >=(BoardSize lhs, BoardSize rhs)
{
return lhs.Rows >= rhs.Rows && lhs.Columns >= rhs.Columns && lhs.NumCellTypes >= rhs.NumCellTypes &&
lhs.NumSpecialTypes >= rhs.NumSpecialTypes;
lhs.NumSpecialTypes >= rhs.NumSpecialTypes;
}

/// <summary>
Expand Down Expand Up @@ -81,8 +81,8 @@ public abstract class AbstractBoard : MonoBehaviour

/// <summary>
/// Return the current size of the board. The values must less than or equal to the values returned from
/// GetMaxBoardSize().
/// By default, this will return GetMaxBoardSize(); if your board doesn't change size, you don't need to
/// <see cref="GetMaxBoardSize"/>.
/// By default, this will return <see cref="GetMaxBoardSize"/>; if your board doesn't change size, you don't need to
/// override it.
/// </summary>
/// <returns></returns>
Expand All @@ -93,7 +93,7 @@ public virtual BoardSize GetCurrentBoardSize()

/// <summary>
/// Returns the "color" of the piece at the given row and column.
/// This should be between 0 and NumCellTypes-1 (inclusive).
/// This should be between 0 and BoardSize.NumCellTypes-1 (inclusive).
/// The actual order of the values doesn't matter.
/// </summary>
/// <param name="row"></param>
Expand All @@ -103,7 +103,7 @@ public virtual BoardSize GetCurrentBoardSize()

/// <summary>
/// Returns the special type of the piece at the given row and column.
/// This should be between 0 and NumSpecialTypes (inclusive).
/// This should be between 0 and BoardSize.NumSpecialTypes (inclusive).
/// The actual order of the values doesn't matter.
/// </summary>
/// <param name="row"></param>
Expand All @@ -113,23 +113,23 @@ public virtual BoardSize GetCurrentBoardSize()

/// <summary>
/// Check whether the particular Move is valid for the game.
/// The actual results will depend on the rules of the game, but we provide SimpleIsMoveValid()
/// The actual results will depend on the rules of the game, but we provide <see cref="SimpleIsMoveValid(Move)"/>
/// that handles basic match3 rules with no special or immovable pieces.
/// </summary>
/// <remarks>
/// Moves that would go outside of GetCurrentBoardSize() are filtered out before they are
/// Moves that would go outside of <see cref="GetCurrentBoardSize"/> are filtered out before they are
/// passed to IsMoveValid().
/// </remarks>
/// <param name="m"></param>
/// <param name="m">The move to check.</param>
/// <returns></returns>
public abstract bool IsMoveValid(Move m);

/// <summary>
/// Instruct the game to make the given Move. Returns true if the move was made.
/// Instruct the game to make the given <see cref="Move"/>. Returns true if the move was made.
/// Note that during training, a move that was marked as invalid may occasionally still be
/// requested. If this happens, it is safe to do nothing and request another move.
/// </summary>
/// <param name="m"></param>
/// <param name="m">The move to carry out.</param>
/// <returns></returns>
public abstract bool MakeMove(Move m);

Expand All @@ -149,7 +149,7 @@ public int NumMoves()
public Action OnNoValidMovesAction;

/// <summary>
/// Iterate through all Moves on the board.
/// Iterate through all moves on the board.
/// </summary>
/// <returns></returns>
public IEnumerable<Move> AllMoves()
Expand All @@ -169,7 +169,7 @@ public IEnumerable<Move> AllMoves()
}

/// <summary>
/// Iterate through all valid Moves on the board.
/// Iterate through all valid moves on the board.
/// </summary>
/// <returns></returns>
public IEnumerable<Move> ValidMoves()
Expand All @@ -189,9 +189,9 @@ public IEnumerable<Move> ValidMoves()
}

/// <summary>
/// Returns true if swapped the cells specified by the move would result in
/// Returns true if swapping the cells specified by the move would result in
/// 3 or more cells of the same type in a row. This assumes that all pieces are allowed
/// to be moved; to add extra logic, incorporate it into you IsMoveValid() method.
/// to be moved; to add extra logic, incorporate it into your <see cref="IsMoveValid"/> method.
/// </summary>
/// <param name="move"></param>
/// <returns></returns>
Expand Down Expand Up @@ -226,7 +226,7 @@ public bool SimpleIsMoveValid(Move move)

/// <summary>
/// Check if one of the cells that is swapped during a move matches 3 or more.
/// Since these checks are similar for each cell, we consider the Move as two "half moves".
/// Since these checks are similar for each cell, we consider the move as two "half moves".
/// </summary>
/// <param name="newRow"></param>
/// <param name="newCol"></param>
Expand Down Expand Up @@ -291,7 +291,7 @@ bool CheckHalfMove(int newRow, int newCol, int newValue, Direction incomingDirec
}

/// <summary>
/// Make sure that the current BoardSize isn't larger than the original value of GetMaxBoardSize().
/// Make sure that the current BoardSize isn't larger than the original value of <see cref="GetMaxBoardSize"/>.
/// If it is, log a warning.
/// </summary>
/// <param name="originalMaxBoardSize"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override ISensor[] CreateSensors()
return Array.Empty<ISensor>();
}
var cellSensor = Match3Sensor.CellTypeSensor(board, m_ObservationType, m_SensorName + " (cells)");
// This can be null if numSpecialTypes is 0
// This can be null if BoardSize.NumSpecialTypes is 0
var specialSensor = Match3Sensor.SpecialTypeSensor(board, m_ObservationType, m_SensorName + " (special)");
m_Sensors = specialSensor != null
? new ISensor[] { cellSensor, specialSensor }
Expand Down
4 changes: 2 additions & 2 deletions com.unity.ml-agents/Runtime/Sensors/ISensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public interface ISensor
/// Returns a description of the observations that will be generated by the sensor.
/// See <see cref="ObservationSpec"/> for more details, and helper methods to create one.
/// </summary>
/// <returns></returns>
/// <returns>An object describing the observation.</returns>
ObservationSpec GetObservationSpec();

/// <summary>
Expand Down Expand Up @@ -92,7 +92,7 @@ public interface ISensor
/// Return information on the compression type being used. If no compression is used, return
/// <see cref="CompressionSpec.Default()"/>.
/// </summary>
/// <returns>CompressionSpec used by the sensor.</returns>
/// <returns>An object describing the compression used by the sensor.</returns>
CompressionSpec GetCompressionSpec();

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"unity": "2019.4",
"description": "Use state-of-the-art machine learning to create intelligent character behaviors in any Unity environment (games, robotics, film, etc.).",
"dependencies": {
"com.unity.barracuda": "1.4.0-preview",
"com.unity.barracuda": "2.0.0-pre.3",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/Integrations-Match3.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ the current board size.

##### `public abstract int GetCellType(int row, int col)`
Returns the "color" of piece at the given row and column.
This should be between 0 and NumCellTypes-1 (inclusive).
This should be between 0 and BoardSize.NumCellTypes-1 (inclusive).
The actual order of the values doesn't matter.

##### `public abstract int GetSpecialType(int row, int col)`
Returns the special type of the piece at the given row and column.
This should be between 0 and NumSpecialTypes (inclusive).
This should be between 0 and BoardSize.NumSpecialTypes (inclusive).
The actual order of the values doesn't matter.

##### `public abstract bool IsMoveValid(Move m)`
Expand Down