def __init__(self, nonlin=tf.identity, N=1, name=None, logging=False): self.N = N if name is None: layer = self.__class__.__name__.lower() name = layer + '_' + str(get_layer_uid(layer)) self.name = name self.logging = logging self.nonlinearity = nonlin self.build() print('Logging: {}'.format(self.logging))
def __init__(self, incoming, n_flows=2, n_hidden=0, dim_h=10, name=None, scope=None, nonlin=tf.nn.tanh, **kwargs): self.incoming = incoming self.n_flows = n_flows self.n_hidden = n_hidden if name is None: layer = self.__class__.__name__.lower() self.name = layer + '_' + str(get_layer_uid(layer)) else: self.name = name self.dim_h = dim_h self.params = [] self.nonlin = nonlin self.scope = scope self.build() print 'MaskedNVP flow {} with length: {}, n_hidden: {}, dim_h: {}, name: {}, ' \ 'scope: {}'.format(self.name, n_flows, n_hidden, dim_h, name, scope)