当前位置: 首页>>代码示例>>Python>>正文


Python Callback.__init__方法代码示例

本文整理汇总了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() 
开发者ID:AgnezIO,项目名称:agnez,代码行数:20,代码来源:keras_callbacks.py

示例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 
开发者ID:UKPLab,项目名称:coling2018_fake-news-challenge,代码行数:25,代码来源:Keras_utils.py

示例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 = ' - ' 
开发者ID:idealo,项目名称:imageatm,代码行数:8,代码来源:tf_keras.py

示例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) 
开发者ID:zeppaman,项目名称:KerasUI,代码行数:10,代码来源:progress.py

示例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 
开发者ID:avolkov1,项目名称:keras_experiments,代码行数:12,代码来源:timing.py

示例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 
开发者ID:vdorobantu,项目名称:lyapy,代码行数:5,代码来源:util.py

示例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 
开发者ID:ECP-CANDLE,项目名称:Benchmarks,代码行数:5,代码来源:p1b1_baseline_keras2.py

示例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)) 
开发者ID:ECP-CANDLE,项目名称:Benchmarks,代码行数:16,代码来源:combo_dose.py

示例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() 
开发者ID:ECP-CANDLE,项目名称:Benchmarks,代码行数:6,代码来源:uno_model_utils.py


注:本文中的keras.callbacks.Callback.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。