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
# Disclaimer: this is just an ugly solution to monitoring layer activations | |
# when training a model in tf keras. | |
# this code is executed right after the model is created. | |
class Callback(tf.keras.callbacks.Callback): | |
def __init__(self, logging_data): | |
super().__init__() | |
# `logging_data` is a namedtuple of the follwoing type: | |
# LoggingData = namedtuple("LoggingData", ['get_val_dataset_fn', 'get_writer_fn', 'freq']) |