pyod icon indicating copy to clipboard operation
pyod copied to clipboard

callbacks in autoencoder

Open satrum opened this issue 5 years ago • 6 comments

How can i implement callback parameter in fit moder Autoencoder ? There is not parameter.

from keras.callbacks.callbacks import EarlyStopping cb_earlystop = EarlyStopping(monitor='val_loss', min_delta=0, patience=0, verbose=0, mode='auto', baseline=None, restore_best_weights=False) pyod_model.fit(scaler, callbacks=[cb_earlystop])

TypeError: fit() got an unexpected keyword argument 'callbacks'

Can you implement this parameter? Its very usefull for monitor, early stop and another cases.

satrum avatar Dec 16 '19 16:12 satrum

Thanks for noting me on this. I would be happy to add this in...while may take some time. You could overwrite the autoencoder module to get it for now...

yzhao062 avatar Dec 18 '19 21:12 yzhao062

or maybe @ZainNasrullah can do this?

yzhao062 avatar Dec 18 '19 21:12 yzhao062

Hi satrum and Yue,

I added keyword arguments to the fit call on the autoencoder. This should allow you to pass any additional keras arguments including callbacks. I've also updated the auto encoder example to include your callback and no longer receive the type error mentioned in the initial post.

Can you test this implementation (b401c328194dc0918c79f19d138112e802258f4b) and let me know if this is what you were looking for? If so, we'll include it in a future release.

Update: Quick reminder to test in a virtual environment where pyod is not already installed (safest bet is to do a fresh install via github and the provided commit hash) or you may be running the existing implementation instead of the modified one.

ZainNasrullah avatar Dec 18 '19 23:12 ZainNasrullah

Did this ever make it to a release?

WorksWellWithOthers avatar May 14 '21 03:05 WorksWellWithOthers

Are there any releases that have this?

saraghasemifp avatar Feb 28 '24 11:02 saraghasemifp

any updates on when this will be added to the release?

jason-stratyfy avatar May 07 '24 13:05 jason-stratyfy