def __init__(self, model): """ Initialize the population of GLMs connected by a network. """ self.model = model self.N = model['N'] # Initialize a list of data sequences self.data_sequences = [] # Initialize latent variables of the population self.latent = LatentVariables(model) # Create a network model to connect the GLMs self.network = Network(model, self.latent) # Create a single GLM that is shared across neurons # This is to simplify the model and reuse parameters. # Basically it speeds up the gradient calculations since we # can manually leverage conditional independencies among GLMs self.glm = Glm(model, self.network, self.latent)