Numsharp0.30.0 np.random.choice() method missing cause Exception
System.NotSupportedException
HResult=0x80131515
Source=NumSharp
StackTrace:
at NumSharp.NPTypeCodeExtensions.GetAccumulatingType(NPTypeCode typeCode)
at NumSharp.Backends.DefaultEngine.cumsum_elementwise(NDArray& arr, Nullable1 typeCode)
at NumSharp.Backends.DefaultEngine.ReduceCumAdd(NDArray& arr, Nullable1 axis_, Nullable`1 typeCode)
at NumSharp.NumPyRandom.choice(Int32 a, Shape shape, Boolean replace, Double[] probabilities)
at NumSharp.NumPyRandom.choice(NDArray arr, Shape shape, Boolean replace, Double[] probabilities)
at PolicyGradient_TF050.PolicyGradient.ChooseAction(NDArray observation, NDArray actions, NDArray actionmask)
I‘m new to this ,
Thanks for help.
This has been fixed. np.random.choice with probabilities now works correctly:
np.random.seed(42);
var probs = new double[] { 0.1, 0.2, 0.3, 0.4 };
var result = np.random.choice(4, 5, true, probs);
// Result: [2, 3, 3, 2, 1]
The underlying cumsum issue that caused the NotSupportedException has been resolved.
Resolved via #600, #602, #603, #596.