Input a value to a Neural Network, Kotlin for android

I built a tflite model for a very basic android app in kotlin, that accepts a float or double as input and yields double as output. The model is a NN. I don’t know how to give inputs to the interpreter. And I can’t find a good documentation about kotlin interpreter class.

var input = 3 // ??
var output = ?? // Do I need to declare an Array?, output)

In the second case, I would like the input to be entered by the user into an editText field.
inputText = findViewById(
input = (Int) inputText?.getText() // do I need to cast to an Int or Double?

Hi @maths_soso

There is a splendid guide here
and of course you can see a lot of good examples there.


1 Like

Hi @George_Soloupis
Thank you, I appreciate your help.
Nevertheless, one is dealing with Java, and I’m looking for a Kotlin documentation. And the other examples are way complicated, I’m looking for a solution to my very simple case.