3d95882c14d31f3d1e358c39dcf34dfecdcc75a3,tgen/tfclassif.py,RerankingClassifier,__init__,#RerankingClassifier#Any#,94
Before Change
// Train Summaries
self.loss_summary_reranker = None
self.train_summary_op = None
self.train_summary_dir = None
self.train_summary_writer = None
timestamp = str(int(time.time()))
self.out_dir = os.path.abspath(os.path.join(os.path.curdir, "seq_runs", timestamp))
def save_to_file(self, model_fname):
Save the classifier to a file (actually two files, one for configuration and one
After Change
A classifier for trees that decides which DAIs are currently represented
(to be used in limiting candidate generator and/or re-scoring the trees).
def __init__(self, cfg):
super(RerankingClassifier, self).__init__(scope_name="rerank-" +
cfg.get("scope_suffix", ""))
self.cfg = cfg
self.language = cfg.get("language", "en")
self.selector = cfg.get("selector", "")
self.tree_embs = cfg.get("nn", "").startswith("emb")
if self.tree_embs:
self.tree_embs = TreeEmbeddingClassifExtract(cfg)
self.emb_size = cfg.get("emb_size", 50)
self.mode = cfg.get("mode", "tokens" if cfg.get("use_tokens") else "trees")
self.nn_shape = cfg.get("nn_shape", "ff")
self.num_hidden_units = cfg.get("num_hidden_units", 512)
self.passes = cfg.get("passes", 200)
self.min_passes = cfg.get("min_passes", 0)
self.alpha = cfg.get("alpha", 0.1)
self.randomize = cfg.get("randomize", True)
self.batch_size = cfg.get("batch_size", 1)
self.validation_freq = cfg.get("validation_freq", 10)
self.max_cores = cfg.get("max_cores")
self.cur_da = None
self.cur_da_bin = None
self.checkpoint_path = None
self.delex_slots = cfg.get("delex_slots", None)
if self.delex_slots:
self.delex_slots = set(self.delex_slots.split(","))
// Train Summaries
self.train_summary_dir = cfg.get("tb_summary_dir", None)
if self.train_summary_dir:
self.loss_summary_reranker = None
self.train_summary_op = None
self.train_summary_dir = None
self.train_summary_writer = None
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 12
Instances
Project Name: UFAL-DSG/tgen
Commit Name: 3d95882c14d31f3d1e358c39dcf34dfecdcc75a3
Time: 2017-12-14
Author: o.dusek@hw.ac.uk
File Name: tgen/tfclassif.py
Class Name: RerankingClassifier
Method Name: __init__
Project Name: pantsbuild/pants
Commit Name: 0a6edd21b9ab29a1f733b90ff15092e7a03f665d
Time: 2014-01-15
Author: jsirois@twitter.com
File Name: src/python/twitter/pants/python/thrift_builder.py
Class Name: PythonThriftBuilder
Method Name: __init__
Project Name: UFAL-DSG/tgen
Commit Name: 3d95882c14d31f3d1e358c39dcf34dfecdcc75a3
Time: 2017-12-14
Author: o.dusek@hw.ac.uk
File Name: tgen/tfclassif.py
Class Name: RerankingClassifier
Method Name: __init__
Project Name: pantsbuild/pants
Commit Name: 3f5e994767718a930681d75bd59154525b02cd18
Time: 2014-01-19
Author: benjyw@gmail.com
File Name: src/python/twitter/pants/python/thrift_builder.py
Class Name: PythonThriftBuilder
Method Name: __init__
Project Name: UFAL-DSG/tgen
Commit Name: 3d95882c14d31f3d1e358c39dcf34dfecdcc75a3
Time: 2017-12-14
Author: o.dusek@hw.ac.uk
File Name: tgen/seq2seq.py
Class Name: Seq2SeqGen
Method Name: __init__