Skip to content
Snippets Groups Projects
Commit 3b4633b7 authored by Neta Zmora's avatar Neta Zmora
Browse files

activation stats collection: add more layer types to default module list

Added ReLU6 and LeakyReLU to the list of default module types for which
we collect activation stats.
parent 84240654
No related branches found
No related tags found
No related merge requests found
...@@ -146,7 +146,9 @@ class SummaryActivationStatsCollector(ActivationStatsCollector): ...@@ -146,7 +146,9 @@ class SummaryActivationStatsCollector(ActivationStatsCollector):
light-weight and quicker than collecting a record per activation. light-weight and quicker than collecting a record per activation.
The statistic function is configured in the constructor. The statistic function is configured in the constructor.
""" """
def __init__(self, model, stat_name, summary_fn, classes=[torch.nn.ReLU]): def __init__(self, model, stat_name, summary_fn, classes=[torch.nn.ReLU,
torch.nn.ReLU6,
torch.nn.LeakyReLU]):
super(SummaryActivationStatsCollector, self).__init__(model, stat_name, classes) super(SummaryActivationStatsCollector, self).__init__(model, stat_name, classes)
self.summary_fn = summary_fn self.summary_fn = summary_fn
...@@ -223,7 +225,9 @@ class RecordsActivationStatsCollector(ActivationStatsCollector): ...@@ -223,7 +225,9 @@ class RecordsActivationStatsCollector(ActivationStatsCollector):
For obvious reasons, this is slower than SummaryActivationStatsCollector. For obvious reasons, this is slower than SummaryActivationStatsCollector.
""" """
def __init__(self, model, classes=[torch.nn.ReLU]): def __init__(self, model, classes=[torch.nn.ReLU,
torch.nn.ReLU6,
torch.nn.LeakyReLU]):
super(RecordsActivationStatsCollector, self).__init__(model, "statistics_records", classes) super(RecordsActivationStatsCollector, self).__init__(model, "statistics_records", classes)
def _activation_stats_cb(self, module, input, output): def _activation_stats_cb(self, module, input, output):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment