def __init__(self, source=None, **kwargs): kwargs = super(SimTB, self).__init__(**kwargs) if source is None: raise ValueError('No source provided') # Fetch simTB data from "source" source can be file, directory, etc. self.X = self.get_data(source) self.n = self.X.shape[0] # Reference for the dimension of the dataset. A dict is used for # multimodal data (e.g., mri and labels) self.dims = dict() self.dims[self.name] = self.X.shape[1] # This is reference for models to decide how the data should be modelled # E.g. with a binomial or gaussian variable self.distributions = dict() self.distributions[self.name] = 'gaussian' # We will probably center the data in the main script using this # global mean image. self.mean_image = self.X.mean(axis=0) warn_kwargs(self, kwargs)
def __init__(self, name='', excludes=[], learn=True, **kwargs): self.name = name self.params = None self.excludes = excludes self.learn = learn self.set_params() self.n_params = len(self.params) warn_kwargs(kwargs)
def __init__(self, model, name='IRVI', inference_rate=0.1, n_inference_samples=20, n_inference_steps=20, pass_gradients=True, init_inference='recognition_network', **kwargs): self.name = name self.model = model self.init_inference = init_inference self.inference_rate = inference_rate self.n_inference_steps = n_inference_steps self.n_inference_samples = n_inference_samples self.pass_gradients = pass_gradients warn_kwargs(self, **kwargs)
def __init__(self, model, name='RWS', **kwargs): self.name = name self.model = model warn_kwargs(self, **kwargs)