Mar-02-2020, 06:46 AM
For a Graph based machine learning task, I need to input a Numpy array in the following format.
array([array([[1., 0., 0., 0., 0.],
[0., 1., 0., 0., 0.],
[0., 0., 0., 0., 1.]], dtype=float32),
array([[1., 0., 0., 0., 0.],
[1., 0., 0., 0., 0.],
[0., 0., 0., 0., 1.]], dtype=float32)], dtype=object)
However, currently I'm having the input as below.
array([[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]],
[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]]], dtype=float32)
This has the shape (2, 3, 5), but I need to have an input with shape (2,). When I analyze the smaple input I understood that its an array of arrays. But I'm sturggling to convert my input into that format. Can anyone please help on this matter?
array([array([[1., 0., 0., 0., 0.],
[0., 1., 0., 0., 0.],
[0., 0., 0., 0., 1.]], dtype=float32),
array([[1., 0., 0., 0., 0.],
[1., 0., 0., 0., 0.],
[0., 0., 0., 0., 1.]], dtype=float32)], dtype=object)
However, currently I'm having the input as below.
array([[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]],
[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]]], dtype=float32)
This has the shape (2, 3, 5), but I need to have an input with shape (2,). When I analyze the smaple input I understood that its an array of arrays. But I'm sturggling to convert my input into that format. Can anyone please help on this matter?