import tensorflow as tf

    def sussillo_reg(self):

        states = self.states

        reg = 0

        for state in states:
            dJr = tf.matmul(tf.nn.relu(state),
                      tf.matmul(tf.abs(self.W_rec) * self.rec_Connectivity, self.Dale_rec))
            reg += tf.reduce_sum(tf.square(dJr))

        return reg / (self.N_steps * self.N_batch)

    # train the model using Adam
    def train(self, sess, generator,
              learning_rate=.001, training_iters=50000,
              batch_size=64, display_step=10,weight_save_step=100, save_weights_path= None,
              generator_function= None, training_weights_path = None):
