montreal_forced_aligner/corpus/acoustic_corpus.py
def calc_fmllr(self) -> None:
        """
        Multiprocessing function that computes speaker adaptation transforms via
        Feature space Maximum Likelihood Linear Regression (fMLLR).

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.CalcFmllrFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.calc_fmllr_arguments`
            Job method for generating arguments for the helper function
        :kaldi_steps:`align_fmllr`
            Reference Kaldi script
        :kaldi_steps:`train_sat`
            Reference Kaldi script
        """
        begin = time.time()
        self.log_info("Calculating fMLLR for speaker adaptation...")

        arguments = self.calc_fmllr_arguments()
        with tqdm.tqdm(total=self.num_speakers) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(arguments):
                    function = CalcFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        _ = return_queue.get(timeout=1)
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(1)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in arguments:
                    function = CalcFmllrFunction(args)
                    for _ in function.run():
                        pbar.update(1)

        self.speaker_independent = False
        self.log_debug(f"Fmllr calculation took {time.time() - begin}")

        Multiprocessing function that computes speaker adaptation transforms via
        Feature space Maximum Likelihood Linear Regression (fMLLR).

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.CalcFmllrFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.calc_fmllr_arguments`
            Job method for generating arguments for the helper function
        :kaldi_steps:`align_fmllr`
            Reference Kaldi script
        :kaldi_steps:`train_sat`
            Reference Kaldi script
        
Multiprocessing function that computes speaker adaptation transforms via
Feature space Maximum Likelihood Linear Regression (fMLLR).

See Also
Multiprocessing function that computes speaker adaptation transforms via Feature space Maximum Likelihood Linear Regression ( fMLLR ) . See Also
def calc_fmllr(self) -> None:
        begin = time.time()
        self.log_info("Calculating fMLLR for speaker adaptation...")
        arguments = self.calc_fmllr_arguments()
        with tqdm.tqdm(total=self.num_speakers) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(arguments):
                    function = CalcFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        _ = return_queue.get(timeout=1)
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(1)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in arguments:
                    function = CalcFmllrFunction(args)
                    for _ in function.run():
                        pbar.update(1)
        self.speaker_independent = False
        self.log_debug(f"Fmllr calculation took {time.time() - begin}")
def calc_fmllr ( self ) -> None : begin = time . time ( ) self . log_info ( "Calculating fMLLR for speaker adaptation..." ) arguments = self . calc_fmllr_arguments ( ) with tqdm . tqdm ( total = self . num_speakers ) as pbar : if self . use_mp : manager = mp . Manager ( ) error_dict = manager . dict ( ) return_queue = manager . Queue ( ) stopped = Stopped ( ) procs = [ ] for i , args in enumerate ( arguments ) : function = CalcFmllrFunction ( args ) p = KaldiProcessWorker ( i , return_queue , function , error_dict , stopped ) procs . append ( p ) p . start ( ) while True : try : _ = return_queue . get ( timeout = 1 ) if stopped . stop_check ( ) : continue except Empty : for proc in procs : if not proc . finished . stop_check ( ) : break else : break continue pbar . update ( 1 ) for p in procs : p . join ( ) if error_dict : for v in error_dict . values ( ) : raise v else : for args in arguments : function = CalcFmllrFunction ( args ) for _ in function . run ( ) : pbar . update ( 1 ) self . speaker_independent = False self . log_debug ( f"Fmllr calculation took {time.time() - begin}" )
Multiprocessing function that computes speaker adaptation transforms via
Feature space Maximum Likelihood Linear Regression (fMLLR).
Multiprocessing function that computes speaker adaptation transforms via Feature space Maximum Likelihood Linear Regression ( fMLLR ) .
"""
        Multiprocessing function that computes speaker adaptation transforms via
        Feature space Maximum Likelihood Linear Regression (fMLLR).

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.CalcFmllrFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.calc_fmllr_arguments`
            Job method for generating arguments for the helper function
        :kaldi_steps:`align_fmllr`
            Reference Kaldi script
        :kaldi_steps:`train_sat`
            Reference Kaldi script
        """
self
class
`~montreal_forced_aligner.corpus.features.CalcFmllrFunction`
Multiprocessing helper function for each job
` ~montreal_forced_aligner . corpus . features . CalcFmllrFunction ` Multiprocessing helper function for each job
meth
`.AcousticCorpusMixin.calc_fmllr_arguments`
Job method for generating arguments for the helper function
` . AcousticCorpusMixin . calc_fmllr_arguments ` Job method for generating arguments for the helper function
kaldi_steps
`align_fmllr`
Reference Kaldi script
` align_fmllr ` Reference Kaldi script
kaldi_steps
`train_sat`
Reference Kaldi script
` train_sat ` Reference Kaldi script