Skip to content

Commit

Permalink
Added default value for transition mask parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ncguilbeault committed Sep 17, 2024
1 parent 52b1349 commit 86986a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Bonsai.ML.HiddenMarkovModels.Transitions
[JsonObject(MemberSerialization.OptIn)]
public class ConstrainedStationaryTransitions : TransitionsModel
{
private int[,] transitionMask = null;
private int[,] transitionMask = new int[,] { { 1, 1 }, { 1, 1 } };

/// <summary>
/// The mask which gets applied to the transition matrix to prohibit certain transitions.
Expand All @@ -30,7 +30,7 @@ public class ConstrainedStationaryTransitions : TransitionsModel
[Description("The mask which gets applied to the transition matrix to prohibit certain transitions. It must be written in JSON format as an int[,] with the same shape as the transition matrix (nStates x nStates). For example, the mask [[1, 0], [1, 1]] is valid and would prohibit transitions from state 0 to state 1.")]
public string TransitionMask
{
get => transitionMask != null ? StringFormatter.FormatToPython(transitionMask) : "";
get => transitionMask != null ? StringFormatter.FormatToPython(transitionMask) : "[[1, 1], [1, 1]]";
set => transitionMask = (int[,])ArrayHelper.ParseString(value, typeof(int));
}

Expand Down

0 comments on commit 86986a9

Please sign in to comment.