import tensorflow as tf


        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)

