本文整理汇总了Python中keras.callbacks.Callback.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Callback.__init__方法的具体用法?Python Callback.__init__怎么用?Python Callback.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keras.callbacks.Callback
的用法示例。
在下文中一共展示了Callback.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, name, fig_title, url):
"""
fig_title: Figure Title
url : str, optional
Url of the bokeh-server. Ex: when starting the bokeh-server with
``bokeh-server --ip 0.0.0.0`` at ``alice``, server_url should be
``http://alice:5006``. When not specified the default configured
by ``bokeh_server`` in ``.blocksrc`` will be used. Defaults to
``http://localhost:5006/``.
Reference: mila-udem/blocks-extras
"""
Callback.__init__(self)
self.name = name
self.fig_title = fig_title
self.plots = []
output_server(name, url=url)
cursession().publish()
示例2: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, log_dir='./logs',
histogram_freq=0,
batch_size=32,
write_graph=True,
write_grads=False,
write_images=False,
embeddings_freq=0,
embeddings_layer_names=None,
embeddings_metadata=None):
super(TensorBoard, self).__init__()
if K.backend() != 'tensorflow':
raise RuntimeError('TensorBoard callback only works '
'with the TensorFlow backend.')
self.log_dir = log_dir
self.histogram_freq = histogram_freq
self.merged = None
self.write_graph = write_graph
self.write_grads = write_grads
self.write_images = write_images
self.embeddings_freq = embeddings_freq
self.embeddings_layer_names = embeddings_layer_names
self.embeddings_metadata = embeddings_metadata or {}
self.batch_size = batch_size
示例3: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, logger: Logger) -> None:
Callback.__init__(self)
self.logger = logger
self.format_epoch = 'Epoch: {} - {}'
self.format_keyvalue = '{}: {:0.4f}'
self.format_separator = ' - '
示例4: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, dataset_id):
Callback.__init__(self)
self.seen = 0
self.dataset_id = dataset_id
self.samples=1000
self.oldperc=0
# print('inited '+self.samples+' '+self.dataset_id)
示例5: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self):
Callback.__init__(self)
self.train_beg_time = None
self.all_batch_times = None
self.all_epoch_times = None
self.epoch_batch_times = None
self._epoch_start_time = None
self.start_time = None
示例6: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, loss_threshold):
Callback.__init__(self)
self.loss_threshold = loss_threshold
示例7: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, print_fcn=print):
Callback.__init__(self)
self.print_fcn = print_fcn
示例8: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, data, partition='train', batch_size=32):
self.lock = threading.Lock()
self.data = data
self.partition = partition
self.batch_size = batch_size
if partition == 'train':
self.cycle = cycle(range(data.n_train))
self.num_data = data.n_train
elif partition == 'val':
self.cycle = cycle(range(data.total)[-data.n_val:])
self.num_data = data.n_val
else:
raise Exception('Data partition "{}" not recognized.'.format(partition))
示例9: __init__
# 需要导入模块: from keras.callbacks import Callback [as 别名]
# 或者: from keras.callbacks.Callback import __init__ [as 别名]
def __init__(self, save_all_models=False):
Callback.__init__(self)
self.save_all_models = save_all_models
candle.register_permanent_dropout()