Monday, December 22, 2008

Gradient, Hessian, and Jacobian

The problem
A set y=f(x) of m equations in n variable x1,...,xn
f  
The first-order partial derivatives of a vector-valued function, so called Jacobian, or Jacobian Matrix, matrix size is n x m.

The problem 
A set y=f(x) of 1 equations in n variable x1,...,xn
f  
The first-order partial derivatives of a vector-valued function, so called Gradient, or Gradient vector. Matrix size is 1 x n.


The second-order partial derivatives of a vector-valued function, so called Hessain, or Hessain Matrix. Matrix size is n x n.

Sunday, December 21, 2008

Supercarrier in Seattle

I am looking forward to seeing the Supercarrier in US.
I just saw one with very far distance in San Diego.
So I hope that I can see real one Supercarrier when I stay in Seattle.
Fortunately, there are two near Seattle.

One is Abraham Lincoln(CVN-72), which's homeport is Everett.


Another one is John C. Stennis(CVN-74), which's homeport is Bremerton not far from Seattle.
There are another 3 inactive carriers in Bremerton military port.
They are
CV-61 Ranger
CV-62 Indenpendence
CV-64 Constellation



Someone suggest to driver on US-304 into Bremerton, so we can see the inactive 3 carriers very close. If we are lucky, we can also see the Stennis Supercarrier.

Saturday, December 20, 2008

hamachi 無法登入

keywords
hamachi 伺服器拒絕您的登入請求
hamachi:Mediation server has rejected your login request

建議就是反安裝後,重新安裝。
檢查一下是否完全清除了。
或是反安裝完後,
下載http://files.hamachi.cc/priv/hamachi-purge.reg

或是參照上面兩個網頁的說明即可。
灰熊好用。

連上線後,自己建立網路或是加入別人的,
連接好後,就可以用Hamachi的IP來玩Diablo, Starcraft, Warcraft等遊戲了。

SC和WC都是使用區域網路,有搜尋到遊戲,就可以加入遊戲。
Diablo則是輸入開遊戲的人的Hamachi IP就可以了。

Monday, December 15, 2008

Taylor Series

Taylor Series = Taylor Expansion = Taylor Series Expansion.

Brief introduction video in Chinese


Perfect Demo
Other Demo

Friday, December 12, 2008

HTK Chapter 3 - Section 1 - Step 2

Below paragraphs are belong to 
  • HTKBooks, 
  • 苏统华, 哈尔滨工业大学人工智能研究室, 2006年10月30日,
  • Howard Hung-Ju Chou, Intelligence Information Retrieval Lab., NCKU, Taiwan(R.O.C.).

Environment: 
  • HTK 3.4 
  • Cygwin NT-5.1 1.5.25
Section 1 is Data Preparation - 資料準備
Suppose we have the experiment data EXP like following,
================================================
S0001 ONE VALIDATED ACTS OF SCHOOL DISTRICTS
S0002 TWO OTHER CASES ALSO WERE UNDER ADVISEMENT
S0003 BOTH FIGURES WOULD GO HIGHER IN LATER YEARS
S0004 THIS IS NOT A PROGRAM OF SOCIALIZED MEDICINE
================================================
we hope to transform the sentence prompts to be sequence of phones.
For example, 
One -> w ah n
Validated -> v ae l ih d....
by the collection of phones, so called dictionary here.

Before we get the dictionary, we have to transform our experiment data EXP to wlist file.
In pp.26 of HTKBook, it mention that we can use perl cript, called "prompts2wlist.pl".
----------------------------------
$perl  prompts2wlist.pl EXP  wlist-test
----------------------------------

Then you will get this wlist-test file, words are sorted.
=======================
A
ACTS
ADVISEMENT
ALSO
BOTH
CASES
DISTRICTS
FIGURES
GO
HIGHER
IN
IS
LATER
MEDICINE
NOT
OF
ONE
OTHER
PROGRAM
SCHOOL
SOCIALIZED
THIS
TWO
UNDER
VALIDATED
WERE
WOULD
YEARS
======================
It is parsed by the four sentence in EXP file,
========================
S0001 ONE VALIDATED ACTS OF SCHOOL DISTRICTS
S0002 TWO OTHER CASES ALSO WERE UNDER ADVISEMENT
S0003 BOTH FIGURES WOULD GO HIGHER IN LATER YEARS
S0004 THIS IS NOT A PROGRAM OF SOCIALIZED MEDICINE
========================

Then, we can use HDMan Dictionary MAnager to constrcut the new files by referring dictionaries.

HDMan can mrege different dictionaries and transcript the words in inputfile to the phones description.
---------------------------------------------------------------------------------------------------
$ HDMan -m  -w input_word_list -n output_monophones -l output_log_file output_dict input_dict1 input_dict2 ... input_dictX
---------------------------------------------------------------------------------------------------
In this example, we will run the command like following,
---------------------------------------------------------------------------------------------------
$ HDMan -m  -w lists/wlist -n lists/monophones1 -l dlog dicts/dict1 dicts/beep dicts/names
---------------------------------------------------------------------------------------------------
First, check the input files which load in by HDMan.
  • ./lists/wlist
The file stores the words for our training setence.In other words, the training sentence is constructed by the words.
這個檔案儲存了我們要進行訓練的字詞。也就是我們的訓練句子是由這些字組成的。
=============================
CALL
DAVE
DIAL
EIGHT
FIVE
FOUR
JULIAN
LAW
LEE
NINE
OH
ONE
PHIL
PHONE
SENT-END
SENT-START
SEVEN
SIX
STEVE
SUE
THREE
TWO
TYLER
WOOD
YOUNG
ZERO
=============================
  • ./dicts/beep
The Pronouncing dictionary is built by the professional organization. We can use the information to build one own dictionary.
專業的字典檔案,我們可以利用這個檔案來建造自己的字典。
=============================
# British English Example Pronciation dictionary
#
# Version 1.0
#
# Friday 22 August 1997
#
# Commercial use is prohibited.
# See the file README for more details
#
# Tony Robinson ajr@eng.cam.ac.uk
#
A ah
A ax
A ey
A-BOMB ey b oh m
A-BOMBS ey b oh m z
A-LEVEL ey l eh v l
....omitted.
=============================
  • ./dicts/names
The above dictionary may not much enough for our training words.
上面的字典可能不夠足夠。
For example, TYLER t ay l ax, the word doesn't appear in beep dictionary.
Or, JULIAN jh uw l y ax n, the word appear, but the pronouncing doesn't. 
像TYLER並沒有出現在beep裡,JULIAN的另一個發音也沒有在beep裡。
所以針對我們的訓練資料,要檢查字典是否完備,否則日後訓練可能會有辨識錯誤的情況產生。
=============================
DAVE d ey v 
JULIAN jh uw l y ax n 
JULIAN jh uw l ia n 
LAW l ao 
LEE l iy 
PHIL f ih l 
SENT-END [] sil
SENT-START [] sil
STEVE s t iy v 
SUE s uw 
SUE s y uw 
TYLER t ay l ax 
WOOD w uh d 
YOUNG y ah ng
=============================
In order to make sure all neams will have pronunciations, we use "./dicts/names" to save pronunciations of all names.

Actually, there is another one file which will be loaded. It's global.ded.
  • global.ded
It's the defualt parameter of HDMan, option is -g if you want to load another dictionary file to be global.ded.
=============================
AS sp
RS cmu
MP sil sil sp
=============================
AS commands - AS A B ... - Append silence models A, B, etc to each pronunciation.
$ AS sp
  • AS會把sp附加在每個phone sequence後面。
RS commands - RS system - Remove stress marking. Currently the only stress marking system supported is that
used in the dictionaries produced by Carnegie Melon University (system = cmu).
$ RS cmu
  • RS會拿掉重音標記,現在只支援拿掉cmu的重音系統。
MP commands - MP X A B ... - Merge any sequence of phones A B . . . and rename as X.
$ MP sil sil sp
  • MP會把 sil sp變成sil。
To know more, please refer Section 17.5 in HTKBook.

Following is the commands of HDMan, but a little different one in HTKBook.
---------------------------------------------------------------------------------------------------
$ HDMan -m  -w lists/wlist -n lists/monophones1 -l dlog dicts/dict1 dicts/beep dicts/names
---------------------------------------------------------------------------------------------------
We will generate 3 files and load 3 files by above command (global.ded is default load).
  • -m, merge the dicts/beep and dicts/names
  • -w, check the words in lists/wlist
  • -l, ouput the process log dlog
The 3 input files have been shown.
Here are 3 output files.
  • ./lists/monophones1
This is a list of the phones used. 這是有出現在wlist裡的words,有參考到的phones。
其實就是在dlog檔裡面有顯示的phones。
==============================
k
ao
l
sp
d
ey
v
ay
ax
t
f
r
jh
uw
ia
n
y
iy
ow
w
ah
ih
sil
s
eh
th
uh
ng
z
==============================
  • ./dicts/dict1
Now, we get the dictionary for our training words.
現在我們針對遜鏈字詞產生了新的對應好的字典。
We can see the words in wlist with the phones.
可以看到有出現在./lists/wlist的words,後面都有了自己的phones。
Because of the AS command in global.ded, we can see each words with the sp to be the last phone.
因為AS指令,所以每個word後面都有sp結尾。RS和MP的效果,在這裡都看不出來。
Format is like the pp.26 in HTK book.
WORD [outsym] p1 p2 p3 ...
For more detail, please refer Section 12.7 in HTKBook.
===========================
CALL            k ao l sp
DAVE            d ey v sp
DIAL            d ay ax l sp
EIGHT           ey t sp
FIVE            f ay v sp
FOUR            f ao sp
FOUR            f ao r sp
JULIAN          jh uw l ia n sp
JULIAN          jh uw l y ax n sp
LAW             l ao sp
LEE             l iy sp
NINE            n ay n sp
OH              ow sp
ONE             w ah n sp
PHIL            f ih l sp
PHONE           f ow n sp
SENT-END        sil
SENT-START      sil
SEVEN           s eh v n sp
SIX             s ih k s sp
STEVE           s t iy v sp
SUE             s uw sp
SUE             s y uw sp
THREE           th r iy sp
TWO             t uw sp
TYLER           t ay l ax sp
WOOD            w uh d sp
YOUNG           y ah ng sp
ZERO            z ia r ow sp
===========================
  • dlog
The log file includes the statistic of phones used also includes the information of the loaded dictionary file, ./dicts/beep and ./dicst/names. 
If you wish to remove the WARNING message in dlog file, you can manualy create the empty beep.ded and empty  names.ded first.
===========================
WARNING: no script file dict/beep.ded
WARNING: no script file dict/names.ded

Dictionary Usage Statistics
---------------------------
  Dictionary    TotalWords WordsUsed  TotalProns PronsUsed
        beep    237211         23     256476         25
       names        12         12         14         14
       dict1        35         26         39         18

26 words required, 0 missing

New Phone Usage Counts
---------------------
  1. k     :     2
  2. ao    :     4
  3. l     :     8
  4. sp    :    27
  5. d     :     3
  6. ey    :     2
  7. v     :     4
  8. ay    :     4
  9. ax    :     3
 10. t     :     4
 11. f     :     5
 12. r     :     3
 13. jh    :     2
 14. uw    :     5
 15. ia    :     2
 16. n     :     7
 17. y     :     3
 18. iy    :     3
 19. ow    :     3
 20. w     :     2
 21. ah    :     2
 22. ih    :     2
 23. sil   :     2
 24. s     :     6
 25. eh    :     1
 26. th    :     1
 27. uh    :     1
 28. ng    :     1
 29. z     :     1

Dictionary dict/dict1 created
===========================

Practice to add words in wlist file, ex adding HOWARD and CHOU, save as wlist1.
Because HDMan can't find CHOU in dictionaries beep and names.
We just get the HOWARD hh aw ax d sp, and without CHOU.
You also can discover this in log file.
練習自己新增words在wlist,例如新增HOWARD和CHOU,另存為wlist1,
若字典不完備,使用HDMan產生的dict1裡,就只會產生
HOWARD          hh aw ax d sp
卻不會有
CHOU 
Log檔也會顯示
28 words required, 1 missing
若沒發現,後續的訓練語句出現CHOU,就無法辨識成功。

Practice 2, adding Howard and Chou, save as wlist2. After executing HDMan, there are two missing, that caused by HOWARD in beep is not equal to Howard in wlist2.
再練習,新增Howard和Chou,另儲存為wlist2,執行HDMan,log檔會發現出現兩個missing,
28 words required, 2 missing
這是因為Howard 不等於HOWARD,所以要注意。

Clicky

Clicky Web Analytics