Example #1
0
  def cal_relative_mutual_strength(self, n_neighbors=3, mean=True):
    r""" Relative strength for both axes of mutual information matrix.
    Basically, is the mean of normalized maximum mutual information per code,
    and per factor.

    Return:
      a scalar - higher is better
    """
    matrix = self.create_mutualinfo_matrix(n_neighbors=n_neighbors)
    return dict(rms=metrics.relative_strength(matrix))
Example #2
0
  def cal_relative_disentanglement_strength(self, method='spearman', mean=True):
    r""" Relative strength for both axes of correlation matrix.
    Basically, is the mean of normalized maximum correlation per code, and
    per factor.

    Arguments:
      method : {'spearman', 'pearson', 'lasso', 'avg'}
          spearman - rank or monotonic correlation
          pearson - linear correlation
          lasso - lasso regression

    Return:
      a scalar - higher is better
    """
    corr_matrix = self.create_correlation_matrix(mean=mean, method=method)
    return dict(rds=metrics.relative_strength(corr_matrix))