Hi,
I’m trying to adapt the code from the PyTorch tutorial “Hyper-parameter tuning with Ray Tune 2”. I set the config variable like this:
config = {"batch_size" : tune.sample_from(lambda _: 2**np.random.randint(2, 9))}
but when I use it in the training function:
n_samps = n_feats * config["batch_size"]
I get a
TypeError: unsupported operand type(s) for *: 'int' and 'Function'
Also if I use
config = {"lr" : tune.loguniform(1e-4, 1e-1)}
then doing
2 * config["lr"] 
results in a
TypeError: unsupported operand type(s) for *: 'int' and 'Float'
Indeed, config["lr"] is a ray.tune.sample.Float, and I don’t undrstand how to use it.
Any help would be appreciated.
Thanks!