metrics package

Submodules

metrics.base module

class metrics.base.BaseDivergence[source]

Bases: object

Kullback-Leibler divergence class.

classmethod divergence(m1_log_scores, m2_log_scores, z, proposal_log_scores=None)[source]

Computes an IS of the KL divergence between 2 distributions

Parameters:
m1_log_scores: floats

log-scores for samples according to network 1

m2_log_scores: floats

log-scores for samples according to network 2

z: float

partition function of network 1

proposal_log_scores: floats

log-scores for samples according to proposal (by default m2_log_scores)

Returns:
divergence between m1 and m2

metrics.js module

class metrics.js.JS[source]

Bases: BaseDivergence

Jensen-Shannon divergence class.

classmethod pointwise_estimates(m1_log_scores, m2_log_scores, z, proposal_log_scores=None)[source]

Computes the KL divergence between 2 distributions

Parameters:
m1_log_scores: floats

log-scores for samples according to network 1

m2_log_scores: floats

log-scores for samples according to network 2

z: float

partition function of network 1

proposal_log_scores: floats

log-scores for samples according to proposal (by default m2_log_scores)

Returns:
divergence between m1 and m2

metrics.kl module

class metrics.kl.KL[source]

Bases: BaseDivergence

Kullback-Leibler divergence class

classmethod pointwise_estimates(m1_log_scores, m2_log_scores, z, proposal_log_scores=None)[source]

computes the KL divergence between 2 distributions

Parameters:
m1_log_scores: floats

log-scores for samples according to network 1

m2_log_scores: floats

log-scores for samples according to network 2

z: float

partition function of network 1

proposal_log_scores: floats

log-scores for samples according to proposal (by default m2_log_scores)

Returns:
divergence between m1 and m2

metrics.tv module

class metrics.tv.TV[source]

Bases: BaseDivergence

classmethod pointwise_estimates(m1_log_scores, m2_log_scores, z, proposal_log_scores=None)[source]

computes the TVD between 2 distributions

Parameters:
m1_log_scores: floats

log-scores for samples according to network 1

m2_log_scores: floats

log-scores for samples according to network 2

z: float

partition function of network 1

proposal_log_scores: floats

log-scores for samples according to proposal (by default m2_log_scores)

Returns:
divergence between m1 and m2

Module contents