本文整理匯總了Python中neon.callbacks.callbacks.Callbacks.add_watch_ticker_callback方法的典型用法代碼示例。如果您正苦於以下問題:Python Callbacks.add_watch_ticker_callback方法的具體用法?Python Callbacks.add_watch_ticker_callback怎麽用?Python Callbacks.add_watch_ticker_callback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neon.callbacks.callbacks.Callbacks
的用法示例。
在下文中一共展示了Callbacks.add_watch_ticker_callback方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GRU
# 需要導入模塊: from neon.callbacks.callbacks import Callbacks [as 別名]
# 或者: from neon.callbacks.callbacks.Callbacks import add_watch_ticker_callback [as 別名]
output_size = 8
N = 120 # number of memory locations
M = 8 # size of a memory location
# model initialization
layers = [
GRU(hidden_size, init, activation=Tanh(), gate_activation=Logistic()),
Affine(train_set.nout, init, bias=init, activation=Logistic())
]
cost = GeneralizedCostMask(costfunc=CrossEntropyBinary())
model = Model(layers=layers)
optimizer = RMSProp(gradient_clip_value=gradient_clip_value,
stochastic_round=args.rounding)
# configure callbacks
callbacks = Callbacks(model, **args.callback_args)
# we can use the training set as the validation set,
# since the data is tickerally generated
callbacks.add_watch_ticker_callback(train_set)
# train model
model.fit(train_set,
optimizer=optimizer,
num_epochs=args.epochs,
cost=cost,
callbacks=callbacks)