forked from jpata/particleflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi-bin loss in TF, plot fixes (jpata#234)
* training with multi-bin loss component
- Loading branch information
Showing
26 changed files
with
159 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"""CMS PF TTbar dataset.""" | ||
import cms_utils | ||
import tensorflow as tf | ||
|
||
import tensorflow_datasets as tfds | ||
|
||
X_FEATURES = cms_utils.X_FEATURES | ||
Y_FEATURES = cms_utils.Y_FEATURES | ||
|
||
_DESCRIPTION = """ | ||
Dataset generated with CMSSW and full detector sim. | ||
SMS-T1tttt events with PU~55 in a Run3 setup. | ||
""" | ||
|
||
# TODO(cms_pf): BibTeX citation | ||
_CITATION = """ | ||
""" | ||
|
||
|
||
class CmsPfSmsT1tttt(tfds.core.GeneratorBasedBuilder): | ||
"""DatasetBuilder for cms_pf dataset.""" | ||
|
||
VERSION = tfds.core.Version("1.6.0") | ||
RELEASE_NOTES = { | ||
"1.6.0": "Regenerate with ARRAY_RECORD", | ||
} | ||
MANUAL_DOWNLOAD_INSTRUCTIONS = """ | ||
rsync -r --progress \ | ||
lxplus.cern.ch:/eos/user/j/jpata/mlpf/tensorflow_datasets/cms/cms_pf_sms_t1tttt \ | ||
~/tensorflow_datasets/ | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
kwargs["file_format"] = tfds.core.FileFormat.ARRAY_RECORD | ||
super(CmsPfSmsT1tttt, self).__init__(*args, **kwargs) | ||
|
||
def _info(self) -> tfds.core.DatasetInfo: | ||
"""Returns the dataset metadata.""" | ||
# TODO(cms_pf): Specifies the tfds.core.DatasetInfo object | ||
return tfds.core.DatasetInfo( | ||
builder=self, | ||
description=_DESCRIPTION, | ||
features=tfds.features.FeaturesDict( | ||
{ | ||
"X": tfds.features.Tensor(shape=(None, len(X_FEATURES)), dtype=tf.float32), | ||
"ygen": tfds.features.Tensor(shape=(None, len(Y_FEATURES)), dtype=tf.float32), | ||
"ycand": tfds.features.Tensor(shape=(None, len(Y_FEATURES)), dtype=tf.float32), | ||
} | ||
), | ||
supervised_keys=("X", "ycand"), | ||
homepage="", | ||
citation=_CITATION, | ||
metadata=tfds.core.MetadataDict(x_features=X_FEATURES, y_features=Y_FEATURES), | ||
) | ||
|
||
def _split_generators(self, dl_manager: tfds.download.DownloadManager): | ||
"""Returns SplitGenerators.""" | ||
path = dl_manager.manual_dir | ||
sample_dir = "SMS-T1tttt_mGl-1500_mLSP-100_TuneCP5_14TeV_pythia8_cfi" | ||
return cms_utils.split_sample(path / sample_dir / "raw") | ||
|
||
def _generate_examples(self, files): | ||
return cms_utils.generate_examples(files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.