0

Background:

I have experience implementing TensorFlow models in dotnet using TensorFlow.Net, and the models I use are trained in python/TF and generally take in multidimensional arrays and return multidimensional arrays. I want to do something similar, but purely using ML.Net.

The question:

I want to do a little solo fun project which takes in a jagged array and returns a jagged array. All of the documentation and tutorials I have watched only give examples of training data using strings or singles. Am I barking up the wrong tree, attempting to do this in ML.NET? I'm not asking anyone to do the work for me, but if someone could point me towards resources/documentation relating to model training using jagged/multidimensional arrays, I'd be very grateful!

Further info:

My intended project is a noughts and crosses (tic-tac-toe) model which takes in the current state of the board in the format: short[rows: 3][columns: 3] and returns the next state of the board, also in the format short[3][3]

example input:

[1,-1,0],[1,-1,-1],[-1,-1,-1]

where 1 is an 'x', 0 is a '0' and -1 is an empty grid space.

The model should then return the state of board once it has made its move

example output:

[1,-1,0],[1,-1,-1],[0,-1,-1]

RCru
  • 57
  • 4

1 Answers1

0

ML.NET currently does not support multidimensional arrays. However, if you flattened that array into a 1D array / vector. It's possible.

This documentation shows a sample using VectorType which effectively is a float[]

https://learn.microsoft.com/dotnet/machine-learning/how-to-guides/load-data-ml-net#annotating-the-data-model-with-column-attributes