Blog Archive

Wednesday, November 22, 2017

How to clone a specific Git branch?



git checkout -b <branch-name> <origin/branch_name>
To be specific, you need know your desired branch name, which can be figured out by issuing:  
git branch -a
For example: 
 git branch -a
* master
  origin/HEAD
  origin/enum-account-number
  origin/master
  origin/rel_table_play
  origin/sugarfield_customer_number_show_c
So to create a new branch based on my enum-account-number branch I do:
git checkout -b enum-account-number origin/enum-account-number
After you hit return the following happens:
Branch enum-account-number set up to track remote branch refs/remotes/origin/enum-account-number.
Switched to a new branch "enum-account-number


Reference:

How to clone a specific Git branch? - Stack Overflow:



Monday, November 20, 2017

--snip-edges=false policy

Background:

WARNING (select-voiced-frames[5.2.183~1-32310]:main():select-voiced-frames.cc:75) Mismatch in number for frames 307 for features and VAD 305, for utterance file1.wav
LOG (select-voiced-frames[5.2.183~1-32310]:main():select-voiced-frames.cc:105) Done selecting voiced frames; processed 0 utterances, 1 had errors.

Solution:
--snip-edges=true  # conf/mfcc.conf



Everyone,
Whenever we start a new recipe (e.g. using new data, or a new version of an existing recipe, like s5c->s5d), let's make it a practice to add the config variable
--snip-edges=false
in all feature-extraction config files in conf/, such as mfcc.conf and mfcc_hires.conf.
This will ensure that the number of frames is related to the length of the file in a consistent and obvious way.

The original Kaldi feature-extraction code aimed to be compatible with HTK, which truncates two or three frames so each frame fits entirely in the file; but this is a hassle and has led to all kinds of inconsistency regarding the meaning of 'segments' files.  It's been hard to switch away from that, because if you change the config any existing recipe, the alignments would no longer match the existing extracted features if people re-ran the mfcc feature extraction.

I think the only way is to make the change is to use --snip-edges=false whenever we write recipes from scratch.

Dan



ref:

https://groups.google.com/forum/#!topic/kaldi-developers/NhdT6nc_Ldc
https://sourceforge.net/p/kaldi/discussion/1355348/thread/7a745cac/?limit=25

IIRC there's an options called --snip-edges or something like that. If you set that to false, the number of frames only depend on the frame shift (by reflecting the data at the end of the audio file).

Monday, November 6, 2017

How To Use Linux Screen

How To Use Linux Screen:



https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/



Reattach to screen:

screen -r

'via Blog this'

Saturday, November 4, 2017

python program to read and write matrix from/to a given file

python program to read a matrix from a given file - Stack Overflow:



https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.loadtxt.html#numpy.loadtxt



#FILE NAME: readANDWrite.py

#!/usr/bin/python

#USING EXAMPLE:  python readANDWrite.py input.txt output.txt

import numpy as np

col0=np.loadtxt(sys.argv[1], dtype='str',usecols=0);  # READ

col1=np.loadtxt(sys.argv[1], dtype='f',usecols=1);



names=np.array(['NAME_1', 'NAME_2', 'NAME_3'])

floats  =np.array([ 0.1234 ,  0.5678 ,  0.9123 ])


ab = np.zeros(names.size, dtype=[('var1', 'U6'), ('var2', float)])

ab['var1'] = names
ab['var2'] = floats
np.savetxt(sys.argv[2], ab, fmt="%10s %10.3f") #Write












'via Blog this'