Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define Learning Rates and Early_STOP #19

Closed
luoda888 opened this issue Dec 25, 2018 · 2 comments
Closed

How to define Learning Rates and Early_STOP #19

luoda888 opened this issue Dec 25, 2018 · 2 comments
Labels

Comments

@luoda888
Copy link

No description provided.

@shenweichen
Copy link
Owner

Hi,@luoda888
You can use any models in DeepCTR like a keras model object.
Here is a example of how to set learning rate and early_stop:

import deepctr
from tensorflow.python.keras.optimizers import Adam,Adagrad
from tensorflow.python.keras.callbacks import EarlyStopping

model = deepctr.models.DeepFM({"sparse": sparse_feature_dict, "dense": dense_feature_list})
model.compile(Adagrad('0.0808'),'binary_crossentropy',metrics=['binary_crossentropy'])

es = EarlyStopping(monitor='val_binary_crossentropy')
history = model.fit(model_input, data[target].values,batch_size=256, epochs=10, verbose=2, validation_split=0.2,callbacks=[es] )

@luoda888
Copy link
Author

OK! Thanks

@shenweichen shenweichen pinned this issue Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants