Skip to content

Commit

Permalink
Added new include workflow to save HMM to pickle file
Browse files Browse the repository at this point in the history
  • Loading branch information
ncguilbeault committed Jan 20, 2025
1 parent 5fa19f4 commit 2545e51
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions src/Bonsai.ML.HiddenMarkovModels/SaveHMMToPkl.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:Bonsai.ML;assembly=Bonsai.ML"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:py="clr-namespace:Bonsai.Scripting.Python;assembly=Bonsai.Scripting.Python"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="ExternalizedMapping">
<Property Name="Name" Category="ModelReference" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:CreateModelReference">
<p1:Name>hmm</p1:Name>
</Combinator>
</Expression>
<Expression xsi:type="rx:BehaviorSubject">
<Name>hmm</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Name</Selector>
</Expression>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="Value" DisplayName="PathToPklFile" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>model.pkl</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Zip" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="py:ObserveOnGIL" />
</Expression>
<Expression xsi:type="Format">
<Format>{0}.save_model("{1}")</Format>
<Selector>Item1,Item2</Selector>
</Expression>
<Expression xsi:type="InputMapping">
<PropertyMappings>
<Property Name="Expression" Selector="it" />
</PropertyMappings>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>HMMModule</Name>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Module" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="py:Eval" />
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="0" To="2" Label="Source2" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="7" Label="Source1" />
<Edge From="4" To="6" Label="Source1" />
<Edge From="5" To="6" Label="Source2" />
<Edge From="6" To="7" Label="Source2" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="13" Label="Source1" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="12" To="13" Label="Source2" />
<Edge From="13" To="14" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>

0 comments on commit 2545e51

Please sign in to comment.