Skip to content

Unable to use np.dot due to "Specified method unsupported" error #446

@moonlitlyra

Description

@moonlitlyra

I have recently been working on a unity project involving the genetic algorithm, but have run into an error while trying to use the function np.dot(). NumSharp has been installed using the NuGet client NuGetForUnity

The error message is as follows:

NotSupportedException: Specified method is not supported.
NumSharp.NPTypeCodeExtensions.GetAccumulatingType (NumSharp.NPTypeCode typeCode) (at <7807b007e09c46aca587061f8867e538>:0)
NumSharp.Backends.DefaultEngine.ReduceAdd (NumSharp.NDArray& arr, System.Nullable1[T] axis_, System.Boolean keepdims, System.Nullable1[T] typeCode, NumSharp.NDArray out) (at <7807b007e09c46aca587061f8867e538>:0)
NumSharp.Backends.DefaultEngine.Sum (NumSharp.NDArray& nd, System.Nullable1[T] axis, System.Nullable1[T] typeCode, System.Boolean keepdims) (at <7807b007e09c46aca587061f8867e538>:0)
NumSharp.np.sum (NumSharp.NDArray& a, System.Int32 axis) (at <7807b007e09c46aca587061f8867e538>:0)
NumSharp.Backends.DefaultEngine.Dot (NumSharp.NDArray& left, NumSharp.NDArray& right) (at <7807b007e09c46aca587061f8867e538>:0)
NumSharp.np.dot (NumSharp.NDArray& a, NumSharp.NDArray& b) (at <7807b007e09c46aca587061f8867e538>:0)
NN.FeedForward () (at Assets/scripts/NeuralNetwork.cs:73)
Bot.FixedUpdate () (at Assets/scripts/Bot.cs:70)

Line 73 of the FeedForward script:

  1. NDArray activations = np.dot(layers[i].weights, layers[i].activations);

Other sections of relevant code:

  1. layer.weights = np.random.rand(3, 2);
  2. layer.activations = np.zeros(2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions