Unity-Technologies / barracuda-release

Other
564 stars 76 forks source link

How to structure tensor input for LSTM network that takes as input a sequence of length 10 with 88-channel state. #312

Open digitalmonkey opened 1 year ago

digitalmonkey commented 1 year ago

We've trained an LSTM that takes as input a sequence of length 10 of 22 body segment orientations represented with quaternions (22*4 = 88), consisting of a state vector of size 88. So overall my input is 10x88= 880 floats.

I'm having trouble figuring out how do initialize the Tensor class properly. I have all 880 floats stored in a float[] list called inputData.

If I try to initialize the tensor and later execute by:


 Tensor output = m_Worker.Execute(input).PeekOutput();```

 I get an assertion error  in BarracudaCompute saying: 
` Assert.AreEqual(X.flatWidth, W.flatHeight);`
with X.flatWidth = 88 and W.flatHeight = 10.

Can anyone offer me insight how to select the right tensor constructor arguments?