Closed uttamdhakal closed 5 years ago
@uttamdhakal no, sorry, you didn't do as in the posted examples, in which you see how to register custom functions in optim.minimize
with the functions
argument:
https://github.com/maxpumperla/hyperas/blob/master/examples/hyperas_in_intermediate_fns.py#L124 https://github.com/maxpumperla/hyperas/blob/master/examples/use_intermediate_functions.py#L88
Thanks and sorry I overlooked
I am trying to use hyperas to optimize my keras model but I keep getting
NameError: processing (function_name) is not defined.
I have already looked at this and this example from hyperas and done exactly that. It doesn't seem to work for me.This is my code:
I don't even need the intermediate function, I had to create it because hyperas didn't find the global variable. for e.g. if I had a variable
x
outside the hyperas function saycreate_model()
, It would sayNameError: x is not defined
I need this because as you can see I am using pre-trained glove embedding. I can't put everything in either
data()
orcreate_model()
. For e.g.data()
needs the variablesequences
andlabel
andcreate_model
needs the variableembedding_matrix
, so there is no way (as far as I know) to split everything in two functions.Only way this worked for me was by putting everything in both
data()
andcreate_model()
functions, which definitely is not efficient and not the way to do.