Skip to content

Commit

Permalink
Compute conceptor's quota
Browse files Browse the repository at this point in the history
  • Loading branch information
nschaetti committed Jan 27, 2019
1 parent be0c6f9 commit fa3e042
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions echotorch/nn/Conceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ def __init__(self, conceptor_dim, aperture=0.0, with_bias=True, learning_algo='i
# PROPERTIES
###############################################

# Compute quota
@property
def quota(self):
"""
Compute quota
:return:
"""
# Conceptor matrix
conceptor_matrix = self.get_C()

# Compute sum of singular values devided by number of neurons
return float(torch.sum(conceptor_matrix.mm(torch.eye(self.conceptor_dim))) / self.conceptor_dim)
# end quota

###############################################
# PUBLIC
###############################################
Expand Down

0 comments on commit fa3e042

Please sign in to comment.