You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use your framework to optimize hiperparameters in my LSTM network in order to implement a sentiment analysis classifier.
I used some snippet you posted but I cannot make it work. I think the main issue is how to calculate embedding_matrix (I'm using word embedings) to train the network. I trained separately tokenize to get weights file.
First of all thank you very much for your work,
I'm trying to use your framework to optimize hiperparameters in my LSTM network in order to implement a sentiment analysis classifier.
I used some snippet you posted but I cannot make it work. I think the main issue is how to calculate embedding_matrix (I'm using word embedings) to train the network. I trained separately tokenize to get weights file.
I'm getting the following error:
def get_space():
return {
'Dropout': hp.uniform('Dropout', 0, 1),
'optimizer': hp.choice('optimizer', ['rmsprop', 'adam', 'sgd']),
}
Traceback (most recent call last):
File "optim_keras.py", line 132, in
best_run = optim.minimize(model=keras_model,data=get_data(),algo=tpe.suggest,max_evals=10,trials=Trials())
File "/usr/bin/anaconda3/lib/python3.7/site-packages/hyperas/optim.py", line 69, in minimize
keep_temp=keep_temp)
File "/usr/bin/anaconda3/lib/python3.7/site-packages/hyperas/optim.py", line 98, in base_minimizer
model_str = get_hyperopt_model_string(model, data, functions, notebook_name, verbose, stack)
File "/usr/bin/anaconda3/lib/python3.7/site-packages/hyperas/optim.py", line 198, in get_hyperopt_model_string
data_string = retrieve_data_string(data, verbose)
File "/usr/bin/anaconda3/lib/python3.7/site-packages/hyperas/optim.py", line 219, in retrieve_data_string
data_string = inspect.getsource(data)
File "/usr/bin/anaconda3/lib/python3.7/inspect.py", line 973, in getsource
lines, lnum = getsourcelines(object)
File "/usr/bin/anaconda3/lib/python3.7/inspect.py", line 955, in getsourcelines
lines, lnum = findsource(object)
File "/usr/bin/anaconda3/lib/python3.7/inspect.py", line 768, in findsource
file = getsourcefile(object)
File "/usr/bin/anaconda3/lib/python3.7/inspect.py", line 684, in getsourcefile
filename = getfile(object)
File "/usr/bin/anaconda3/lib/python3.7/inspect.py", line 666, in getfile
type(object).name))
TypeError: module, class, method, function, traceback, frame, or code object was expected, got tuple
Thank you in advance for your help
Here's my code
The text was updated successfully, but these errors were encountered: