Don't understand findmax()

findmax(model(preprocess(images[i]))) .- (0,1)

code link code link

1 Like

Perhaps a little more context as far as what you understand and where you are getting stuck would help here


As the comment in the code explains, findmax returns the largest element of an array and its index. Here, the array seems to be a vector of length ten with each element being the probability of the image representing one of the digits 0 to 9. Findmax tells you that the highest predicted probability is 0.82, and that it is element number 8 in the vector. As Julia indexing is one based, 1 is subtracted from this to translate the array index into the relevant digit (array element 1 corresponds to digit 0, element 2 to digit 1 etc so element 8 corresponds up digit 7)