@ptrblck: thank you for this clarification. I think I got confused because my folder_names were also integers. It does make sense, since we compute the probability of classes at the end and thus indexing makes sense.
Thank you again. This was VERY helpful.