You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copy all trained parameters to the cloned agent
598
+
varcurrentParams=GetParameters();
599
+
clonedAgent.SetParameters(currentParams);
600
+
601
+
returnclonedAgent;
552
602
}
553
603
554
604
publicoverrideVector<T>ComputeGradients(
@@ -578,15 +628,35 @@ public override void ApplyGradients(Vector<T> gradients, T learningRate)
578
628
SetParameters(newParams);
579
629
}
580
630
631
+
/// <summary>
632
+
/// Saves the trained model to a file.
633
+
/// </summary>
634
+
/// <param name="filepath">Path to save the model.</param>
635
+
/// <exception cref="NotSupportedException">
636
+
/// MADDPG serialization is not currently supported.
637
+
/// </exception>
638
+
/// <remarks>
639
+
/// Issue #6 fix: SaveModel now throws NotSupportedException since Serialize() is not supported.
640
+
/// For saving trained weights, use GetParameters() to extract the parameter vector and save it separately.
641
+
/// </remarks>
581
642
publicoverridevoidSaveModel(stringfilepath)
582
643
{
583
-
vardata=Serialize();
584
-
System.IO.File.WriteAllBytes(filepath,data);
644
+
thrownewNotSupportedException("MADDPG model saving is not currently supported. Use GetParameters() to extract trained weights for manual persistence.");
585
645
}
586
646
647
+
/// <summary>
648
+
/// Loads a trained model from a file.
649
+
/// </summary>
650
+
/// <param name="filepath">Path to load the model from.</param>
651
+
/// <exception cref="NotSupportedException">
652
+
/// MADDPG deserialization is not currently supported.
653
+
/// </exception>
654
+
/// <remarks>
655
+
/// Issue #6 fix: LoadModel now throws NotSupportedException since Deserialize() is not supported.
656
+
/// For loading trained weights, use SetParameters() to restore a previously saved parameter vector.
657
+
/// </remarks>
587
658
publicoverridevoidLoadModel(stringfilepath)
588
659
{
589
-
vardata=System.IO.File.ReadAllBytes(filepath);
590
-
Deserialize(data);
660
+
thrownewNotSupportedException("MADDPG model loading is not currently supported. Use SetParameters() to restore trained weights from manual persistence.");
0 commit comments