Implementing K-fold cross validation in pytorch

is there a guide on how to implement k-fold cross validation in pytorch in clean and optimized way?

You could take a look at skorch, which is a scikit-learn compatible neural network library for PyTorch allowing you to use the k-fold CV methods from scikit-learn directly.

1 Like

i looked at the documentation it is kind of unorganized , they do not provide a snippet explaining the k-fold strategy