當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。