jeudi 21 septembre 2017

Generate random and unique indexes with a range for n number of combinations

I'm want to make a random searcher of parameters but I don't know how to generate a random but unique combination of indexes, under a range. For example, I have these parameters:

    hyperparams  = {
        'size': [200, 300, 400],
        'min_count': [1, 2, 3, 4, 5],
        'iter': [50, 100],
        'window': [4, 5, 7, 10],
        'alpha': [0.025, 0.01],
        'min_alpha': [0.025, 1e-4],
    }

I want to generate unique combinations of them, and each index has a range for n number of time. i.e.

random_and_unique_combination=[1,3,2,1,2,1]

which...

Index 0 is the size.

Index 1 is min_count.

Index 2 is iter.

and so on...




Aucun commentaire:

Enregistrer un commentaire