Dataloader generate random pairs

Dear All,

I am working on domain adaptation and looking for a solution to generate random pairs.

Xs = [xs_1, xs_2, …, xs_m]
Xt = [xt_1, xt_2, …, xt_n]

I want to Dataloader to output random pairs e.g.

(xs_2, xt_3), (xs_1, xt_6), …

Thank you.

Create a custom dataloader class and use any random package (python has a default one) to generate and integer to index x_s and x_t

1 Like