input
stringlengths
10
828
output
stringlengths
5
107
public int get index of first candidate return ci
get the value of first candidate ie ci
public int get index of second candidate return cj
get the value of the second candidate ie cj
public void add model g int length double p models add g model lengths add length int s models size for int i 0 i length i states add s 1 g init score accumulator penalty add p
define a hmm
public gmm get model int i return cluster and model list get i get model
get the i rank model
public void add model model new model double exit penalty double loop penalty add model with duration constraint new model exit penalty loop penalty no duration constraint 0
define a hmm
public double get tdist score of clustering throws diarization exception ioexception throw new diarization exception get tdist score of clustering not implemented
gets the t distance score of clustering
public double get score of candidates for merging throws diarization exception double min double max value ci 1 cj 1 int size clusters cluster get size if size 1 ci 1 cj 1 for int i 0 i size i for int j i 1 j size j if distances get i j min ci i cj j min distances get i j return min
find the next candidates for merging
protected double compute llh score model int feature index start int idx model throws diarization exception model model models get idx model model init score accumulator int end math min feature index start shift features get number of features for int feature index feature index start feature index end feature index if nb top gaussians 0 model get and accumulate likelihood features feature index else model get and accumulate likelihood for component subset features feature index top gaussian indices get feature index return model get sum log likelihood
compute log likelihood score for the model
protected void add model with duration constraint model new model double exit penalty double loop penalty int constraint int constraint value models add new model model duration constraints add constraint int new model index models size 1 model entry state indices add states size if constraint no duration constraint duration constraints values add 1 states add new model index else duration constraints values add constraint value for int i 0 i constraint value i states add new model index new model init score accumulator exit penalties add exit penalty loop penalties add loop penalty initialization required true
define a hmm
public cluster get second candidate return cluster and model list get cj get cluster
get the cluster with index cj
protected void compute score for all models int feature index throws diarization exception if compute llh r compute llh rscore ubm feature index for int idx model 0 idx model models size idx model model scores set idx model compute llh rscore model feature index idx model else if nb top gaussians 0 compute llh rscore ubm feature index for int idx model 0 idx model models size idx model model scores set idx model compute llh score model feature index idx model top gaussian indices clear
compute the scores of all models
protected void update world model scores throws diarization exception ioexception cluster and gmm cluster and gmm cluster and model list get ci cluster cluster cluster and gmm get cluster iterator segment it seg cluster iterator cluster and gmm set ubmscore distance get score world model it seg features param parameter top gaussian get score ntop 0
update world model scores
public void increment index of first candidate ci
increment by 1 the value of ci
public void increment index of second candidate cj
increment by 1 the value of cj
public void add model with fixed duration model new model double exit penalty double loop penalty int duration add model with duration constraint new model exit penalty loop penalty fixed duration constraint duration
adds the model with fixed duration
public void decrement index of first candidate ci
decrement by 1 the value of ci
public void decrement index of second candidate cj
decrement by 1 the value of cj
public void add model with minimal duration model new model double exit penalty double loop penalty int duration add model with duration constraint new model exit penalty loop penalty minimal duration constraint duration
adds the model with minimal duration
protected double get score of model int idx return model scores get states get idx
gets the score of the model
public void init int index of first candidate int index of second candidate throws diarization exception ioexception ci index of first candidate cj index of second candidate
initialize the clustering method
public void init for viterbi column states vect data values vect clear iterator viterbi col enum data data values iterator while enum data has next enum data next clear data clear segment list clear
define a hmm
public void merge candidates throws diarization exception ioexception update order of candidates merge clusters update distance matrix size update models update cluster and gmm update distances
merge the two candidate clusters ci and cj update model and distances
protected void make path tree map integer integer path double max scores get 0 int idx 0 for int i 1 i states size i if max scores get i max scores get i idx i integer data tab new integer data size data key set to array data tab int i data tab length 1 for i data tab length 1 i 0 i path put data tab i states get idx idx data get data tab i get idx data clear
compute the path backward pass
protected void merge clusters clusters merge cluster cluster and model list get ci get cluster get name cluster and model list get cj get cluster get name
merge the two candidate clusters ci and cj
protected void train clusters throws diarization exception ioexception for int i 0 i cluster and model list size i train cluster i
train all cluster models
protected void update cluster and gmm cluster and model list remove cj
remove cj index in cluster and model list
public void set compute llh r boolean compute llh r this compute llh r compute llh r
sets the compute log likelihood ratio
public void set gmmfor top gaussian int n gmm gmm system out println trace decoder t set ntop nb top gaussians n ubm gmm current top gaussian feature index 1
use ntop gaussian in likelihood computation
protected void update distances throws diarization exception ioexception for int i 0 i ci i distances set i ci compute distance i ci for int i ci 1 i cluster and model list size i distances set ci i compute distance ci i
compute new distances for the cluster ci after a merge
public void set shift int declay this shift declay
sets the shift
protected void update order of candidates if ci cj int tmp ci ci cj cj tmp
swap ci and cj if ci cj
public int get size return cluster and model list size
return the number of models
public int get index of last candidate return cluster and model list size 1
return the index of the last candidate
public double get mean non target return mean non target
gets the mean non target
public int get base size int base size vector size if get energy presence base size if get delta energy presence base size if get double delta energy presence base size int nb components 0 if get static coeff presence nb components if get delta coeff presence nb components if get double delta coeff presence nb components if nb components 0 return 0 else return base size nb components
gets the base size
public double get mean target return mean target
gets the mean target
public double get probability non targer return probability non targer
gets the probability non target
public double get probability targer return probability targer
gets the probability target
public double get std non traget return std non traget
gets the std non target
public double get std traget return std traget
gets the std target
private double normal pdfscore double x double mean double std return 1 0 std math sqrt 2 math pi math exp 0 5 math pow x mean std 2 0
normal pdf score
public void set mean non target double mean non target this mean non target mean non target
sets the mean non target
public void set mean target double mean target this mean target mean target
sets the mean target
public void set probability non targer double probability non targer this probability non targer probability non targer
sets the probability non target
public void set probability targer double probability targer this probability targer probability targer
sets the probability target
public boolean get delta coeff must be computed return present parts delta coeff mask 0 needed parts delta coeff mask 0
gets the delta coefficient must be computed
public void set std non traget double std non traget this std non traget std non traget
sets the standard deviation non target
public void set std traget double std traget this std traget std traget
sets the standard deviation target
public boolean get delta coeff must be deleted return present parts delta coeff mask 0 needed parts delta coeff mask 0
gets the delta coefficient must be deleted
protected void apply norm to segment segment segment throws diarization exception ioexception if current show name compare to segment get show name 0 features set current show seg get show index if reduce for int i segment get start i segment get start segment get length i center and reduce i else for int i segment get start i segment get start segment get length i center i
apply pre computed normalization to a segment
public gaussian add component gaussian g throws diarization exception components add gaussian g clone return components get components size 1
copy a gaussian
public void set gmmfor top gaussian int n gmm gmm nb top gaussians n ubm gmm current top gaussian feature index 1
use ntop gaussian in likelihood computation
public boolean get delta coeff needed return needed parts delta coeff mask 0
gets the delta coefficient needed
public gaussian add new component return add new component 1 0
create a gaussian
protected void center int frame index throws diarization exception float frame features get feature frame index int dim features get dim for int i 0 i dim i frame i float frame i local distribution get mean i
center the feature at position frame index
private gaussian add new component double weight gaussian g null if kind gaussian full g new full gaussian dim else g new diag gaussian dim components add g g set weight weight return components get components size 1
create a gaussian
public boolean get delta coeff presence return present parts delta coeff mask 0
gets the delta coefficient presence
public void add frame float values throws diarization exception if values length get dim throw new diarization exception features add frame error dim get dim new frame dim values length current data add values
add a frame at the end of the feature set
protected void center and reduce int frame index throws diarization exception float frame features get feature frame index int dim features get dim for int i 0 i dim i frame i float frame i local distribution get mean i local std dev i
center and reduce the feature at position frame index
public boolean get delta energy must be computed return present parts deltaenergy mask 0 needed parts deltaenergy mask 0
gets the delta energy must be computed
protected void compute local std dev throws diarization exception for int i 0 i features get dim i local std dev i math sqrt local distribution get covariance i i
compute local standard deviation
public void add gaussian m1 throws diarization exception add m1 1 0
accumulator add the statistic accumulator e m1
public void add feature feature set features int frame index throws diarization exception add feature features frame index 1 0
accumulator add feature of index e i
public void add feature float frame throws diarization exception add feature frame weight
adds the feature
public object clone feature set result null try result feature set super clone catch clone not supported exception e if current data null result current data feature data current data clone if initial desc null result initial desc feature description initial desc clone if current file desc null result current file desc feature description current file desc clone result data map new tree map string feature data return result
perform a shallow copy of the feature set
public void add features from segments iterator segment it seg feature set features throws diarization exception ioexception add features from segments it seg features 1 0
adds the features from segments
public void add features from segments iterator segment it seg feature set features double weight throws diarization exception ioexception while it seg has next segment seg it seg next int s seg get start int e s seg get length features set current show seg get show name for int i s i e i add feature features i weight
accumulator add the weighted feature contained in the segment set
public boolean get delta energy needed return needed parts deltaenergy mask 0
gets the delta energy needed
public double get mean int i return mean get i
model get the e i mean value
public boolean compare frames int i int j for int k 0 k get dim k if current data get i k current data get j k return false return true
comparison of two frames
public boolean get delta energy presence return present parts deltaenergy mask 0
gets the delta energy presence
public void remove feature from accumulator feature set features int frame index throws diarization exception remove feature from accumulator features frame index 1 0
accumulator subtract from the accumulator the e i feature
protected void set accumulator count int c count c
accumulator set the number of features in the accumulator
protected void compute norm on segment segment segment throws diarization exception ioexception local distribution init statistic accumulator if current show name compare to segment get show name 0 for int i segment get start i segment get start segment get length i local distribution add feature features i if local distribution set model from accululator 0 system out print warning features start segment get start len system out println segment get length normalized using global information local distribution diag gaussian global distribution clone local distribution reset statistic accumulator if reduce compute local std dev
compute normalization over a segment
public boolean get double delta coeff must be computed return present parts doubledelta coeff mask 0 needed parts doubledelta coeff mask 0
gets the double delta coefficient must be computed
protected void set weight double w weight w
model acc set the weight of features in the accumulator
public boolean get double delta coeff must be deleted return present parts doubledelta coeff mask 0 needed parts doubledelta coeff mask 0
gets the double delta coefficient must be deleted
public boolean get double delta coeff needed return needed parts doubledelta coeff mask 0
gets the double delta coefficient needed
public void map feature cluster set cluster set clusters array list gmm ubms throws diarization exception ioexception system out println trace feature normalization t mapping cluster set iterator cluster it cluster clusters cluster set value iterator while it cluster has next cluster cluster it cluster next map feature cluster cluster ubms
map feature cluster set
public gaussian get component int idx return components get idx
get a gaussian by index e idx
public boolean get double delta energy must be computed return present parts doubledeltaenergy mask 0 needed parts doubledeltaenergy mask 0
gets the double delta energy must be computed
public int set adapted model from accumulator gmm wld parameter map map control throws diarization exception int res 0 if map control get method parameter map mapmethod map lin for int i 0 i components size i res components get i set linear adapted model from accumulator wld get component i map control else for int i 0 i components size i res components get i set adapted model from accumulator wld get component i map control return res
accumulator compute model from accumulator map mode
public void normalize cluster by window cluster cluster throws diarization exception ioexception for segment segment cluster normalize segment by window segment iterator segment it segment cluster iterator while it segment has next normalize segment by window it segment next
normalize a cluster using a sliding window
public boolean get double delta energy needed return needed parts doubledeltaenergy mask 0
gets the double delta energy needed
public int get nb of components return components size
get the number of components
public boolean get double delta energy presence return present parts doubledeltaenergy mask 0
gets the double delta energy presence
public boolean get energy needed return needed parts energy mask 0
gets the energy needed
public void norm weights double s 0 for int i 0 i components size i s components get i get weight system out println trace gmm t norm weights count s for int i 0 i components size i components get i set weight components get i get weight s
normalize the weights
public boolean get energy presence return present parts energy mask 0
gets the energy presence
public void normalize file by window throws diarization exception ioexception segment segment new segment current show name 0 features get number of features new cluster unknown normalize segment by window segment
normalize a file using a sliding window
public int get index of delta energy if get delta energy presence return 1 int result 0 if get static coeff presence result get base size if get energy presence result 1 if get delta coeff presence result get base size return result
gets the index of delta energy
public int get index of double delta energy if get double delta energy presence return 1 int result 0 if get static coeff presence result get base size if get energy presence result 1 if get delta coeff presence result get base size if get delta energy presence result 1 if get double delta coeff presence result get base size return result
gets the index of double delta energy
public void update count int c for int i 0 i components size i components get i update count c
normalize the weights
public int get index of energy if get energy presence return 1 if get static coeff presence return get base size else return 0
gets the index of energy
public string get current show name return current show
gets the current show name
public int get count log likelihood return score count log lh
score get the number of accumulated log likelihood
public int get index of first delta coeff if get delta coeff presence return 1 int result 0 if get static coeff presence result get base size if get energy presence result 1 return result
gets the index of first delta coefficient
public double get partial glr return score glr
score get the glr ie generalized log likelihood ratio
public int get index of first double delta coeff if get double delta coeff presence return 1 int result 0 if get static coeff presence result get base size if get energy presence result 1 if get delta coeff presence result get base size if get delta energy presence result 1 return result
gets the index of first double delta coefficient
public double get likelihood return score lh
score get the likelihood of the current features