hyperparameters icon indicating copy to clipboard operation
hyperparameters copied to clipboard

.choice() - option to actually return the choice?

Open rhysstubbs opened this issue 5 years ago • 0 comments

I am using the choice function in the following way:

  this.squash = hpjs.choice(methods.activation);

However, the choice function returns an object, the documentation makes out as if a random element in the array is returned. Am I misusing the function?

NB: I know that this could be achieved manually, but I am using the library so it makes sense to utilise functions that are available. The manual way could be:

this.squash = methods.activation[Object.keys(methods.activation)[Math.floor(Math.random() * Object.keys(methods.activation).length)]];

rhysstubbs avatar Apr 22 '19 13:04 rhysstubbs