Commit 45073b88 authored by Florent Desnous 's avatar Florent Desnous
Browse files

edited comments

parent 50694289
......@@ -38,7 +38,7 @@ def sanity_check(cep, show, cluster='init'):
def init_seg(cep, show='empty', cluster='init'):
"""
Return a initial segmentation composed of one segment from the first to the
Return an initial segmentation composed of one segment from the first to the
last feature in *cep*.
:param cep: numpy.ndarry containing MFCC
......@@ -55,9 +55,9 @@ def init_seg(cep, show='empty', cluster='init'):
def adjust(cep, diarization):
"""
Moves the border of segment of *diarization* into lowest energy region and split
segments gretter than 30s
segments greater than 30s
:todo: changes numpy.convolve to the panada version
:todo: change numpy.convolve to the panada version
:param cep: a numpy.ndarray containing MFCC
:param diarization: a Diarization object
......@@ -100,10 +100,10 @@ def _adjust(smooth, diarization, window_size=25):
def _split_e(smooth, diarization, split_size):
"""
Long segments of *diarization* are cut recursively at their points of lowest energy
in order to yield segments shorter than *split_size* seconds.
Long segments of *diarization* are cut recursively at their points of lowest
energy in order to yield segments shorter than *split_size* seconds.
:param smooth: sliding means of the energy (numpy.ndarry)
:param smooth: sliding means of the energy (numpy.ndarray)
:param diarization: a Diarization object
:param split_size: maximum size of a segment
:return: a Diar object
......@@ -118,7 +118,7 @@ def _split_seg(smooth, segment, min_seg_size, split_size, lst):
"""
*segment*, a long segment, is cut recursively at their points of lowest energy
in order to yield segments shorter than *split_size* seconds. The new
segments gretter than *min_seg_size* are append into *lst*
segments greater than *min_seg_size* are appended into *lst*
:param smooth: sliding means of the energy (numpy.ndarry)
:param segment: a segment
......@@ -145,23 +145,23 @@ def _split_seg(smooth, segment, min_seg_size, split_size, lst):
def div_gauss(cep, show='empty', win=250, shift=0):
"""
Segmentation based on divergence gaussien.
Segmentation based on gaussian divergence.
The segmentation detects the instantaneous change points corresponding to
segment boundaries. The proposed algorithm is based on the detection of
local maxima. It detects the change points through a gaussian divergence
(see equation below),
computed using Gaussians with diagonal covariance matrices. The left and
right gaussians are estimated over a five-second window sliding along the
whole signal (2.5 seconds for each gaussian, given *win* =250 features).
(see equation below), computed using Gaussians with diagonal covariance
matrices. The left and right gaussians are estimated over a five-second
window sliding along the whole signal (2.5 seconds for each gaussian,
given *win* =250 features).
A change point, i.e. a segment boundary, is present in the middle of the
window when the gaussian diverence score reaches a local maximum.
window when the gaussian divergence score reaches a local maximum.
:math:`GD(s_l,s_r)=(\\mu_r-\\mu_l)^t\\Sigma_l^{-1/2}\\Sigma_r^{-1/2}(\\mu_r-\\mu_l)`
where :math:`s_l` is the left segment modeled by the mean :math:`\mu_l` and
the diagonal covariance matrix :math:`\\Sigma_l`, :math:`s_l` is the right
the diagonal covariance matrix :math:`\\Sigma_l`, :math:`s_r` is the right
segment modeled by the mean :math:`\mu_r` and the diagonal covariance
matrix :math:`\\Sigma_r`.
......@@ -245,17 +245,17 @@ def bic_linear(cep, diarization, alpha, sr=False):
:math:`cst = \\frac{1}{2} \\alpha \\left(d + \\frac{d(d+1)}{2}\\right)`
:math:`P = cst + log(n_i+n_j)`
:math:`P = cst \\times log(n_i+n_j)`
where :math:`|\\Sigma_i|`, :math:`|\\Sigma_j|` and :math:`|\\Sigma|` are the
determinants of gaussians associated to the left and right segmnents
determinants of gaussians associated to the left and right segments
:math:`i`, :math:`j`
and :math:`i+j`. :math:`\\alpha` is a parameter to set up. The penalty
factor :math:`P` depends on :math:`d`, the dimension of the cep, as
well as on :math:`n_i` and :math:`n_j`, refering to the total length of
left segment :math:`i` and right segment :math:`j` respectively.
if *sr* is True, BIC distance is replace by the square root bic
if *sr* is True, BIC distance is replaced by the square root bic
(see :py:func:`clustering.hac_utils.bic_square_root`)
:param cep: numpy.ndarray
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment