Categories
不学无术

Hidden Markov Model 隐马尔科夫模型 【自己的垃圾翻译】

看语音情感识别看到的论文,论文是:
Survey on speech emotion recognition: Features, classification schemes,
and databases
其中有一段写到了HMM用作分类器的,原文中部分如下(版权问题我就不放原文全文了):
The HMM classifier has been extensively used in speech
applications such as isolated word recognition and speech
segmentation because it is physically related to the production
mechanism of speech signal[102]. The HMM is a doubly stochastic
process which consists of a first-order Markov chain whose states
are hiddenfrom the observer. Associated with each state is a
random process which generates the observation sequence. Thus,
the hidden states of the model capture the temporal structure of
the data. Mathematically, for modeling a sequence of observable
data vectors,x1,…,xT, by an HMM, we assume the existence of a
hidden Markov chain responsible for generating this observable
data sequence. LetKbe the number of states,pi
, i¼1,y,Kbe the
initial state probabilities for the hidden Markov chain, and aij
,
i¼1,y,K,j¼1,y,Kbe the transition probability from stateito state
j. Usually, the HMM parameters are estimated based on the ML
principle. Assuming the true state sequence is s1,…,sT, the
likelihood of the observable data is given by
where
bi
ðxtÞPðxjst ¼iÞ
is the observation density of theith state. This density can be either
discrete for discrete HMM or a mixture of Gaussian densities for
continuous HMM. Since the true state sequence is not typically
known, we have to sum over all possible state sequences to find the
likelihood of a given data sequence, i.e.
====================================================
下面是我自己翻译的
 HMM 隐马尔科夫模型
====================================================

Categories
不学无术

机器学习&数据挖掘笔记_14(GMM-HMM语音识别简单理解)

http://www.cnblogs.com/tornadomeet/p/3276753.html 全部内容及代码见左侧链接
为了对GMM-HMM在语音识别上的应用有个宏观认识,花了些时间读了下HTK(用htk完成简单的孤立词识别)的部分源码,对该算法总算有了点大概认识,达到了预期我想要的。不得不说,网络上关于语音识别的通俗易懂教程太少,都是各种公式满天飞,很少有说具体细节的,当然了,那需要有实战经验才行。下面总结以下几点,对其有个宏观印象即可(以孤立词识别为例)。
一、每个单词的读音都对应一个HMM模型,大家都知道HMM模型中有个状态集S,那么每个状态用什么来表示呢,数字?向量?矩阵?其实这个状态集中的状态没有具体的数学要求,只是一个名称而已,你可以用’1’, ’2’, ‘3’…表示,也可以用’a’, ‘b’, ’c ’表示。另外每个HMM模型中到底该用多少个状态,是通过先验知识人为设定的。
二、HMM的每一个状态都对应有一个观察值,这个观察值可以是一个实数,也可以是个向量,且每个状态对应的观察值的维度应该相同。假设现在有一个单词的音频文件,首先需要将其进行采样得到数字信息(A/D转换),然后分帧进行MFCC特征提取,假设每一帧音频对应的MFCC特征长度为39,则每个音频文件就转换成了N个MFCC向量(不同音频文件对应的N可能不同),这就成了一个序列,而在训练HMM模型的参数时(比如用Baum-Welch算法),每次输入到HMM中的数据要求就是一个观测值序列。这时,每个状态对应的观测值为39维的向量,因为向量中元素的取值是连续的,需要用多维密度函数来模拟,通常情况下用的是多维高斯函数。在GMM-HMM体系中,这个拟合函数是用K个多维高斯混合得到的。假设知道了每个状态对应的K个多维高斯的所有参数,则该GMM生成该状态上某一个观察向量(一帧音频的MFCC系数)的概率就可以求出来了。
三、对每个单词建立一个HMM模型,需要用到该单词的训练样本,这些训练样本是提前标注好的,即每个样本对应一段音频,该音频只包含这个单词的读音。当有了该单词的多个训练样本后,就用这些样本结合Baum-Welch算法和EM算法来训练出GMM-HMM的所有参数,这些参数包括初始状态的概率向量,状态之间的转移矩阵,每个状态对应的观察矩阵(这里对应的是GMM,即每个状态对应的K个高斯的权值,每个高斯的均值向量和方差矩阵)。
四、在识别阶段,输入一段音频,如果该音频含有多个单词,则可以手动先将其分割开(考虑的是最简单的方法),然后提取每个单词的音频MFCC特征序列,将该序列输入到每个HMM模型(已提前训练好的)中,采用前向算法求出每个HMM模型生成该序列的概率,最后取最大概率对应的那个模型,而那个模型所表示的单词就是我们识别的结果。
五、在建立声学模型时,可以用Deep Learning的方法来代替GMM-HMM中的GMM,因为GMM模拟任意函数的功能取决于混合高斯函数的个数,所以具有一定的局限性,属于浅层模型。而Deep Network可以模拟任意的函数,因而表达能力更强。注意,这里用来代替GMM的Deep Nets模型要求是产生式模型,比如DBN,DBM等,因为在训练HMM-DL网络时,需要用到HMM的某个状态产生一个样本的概率。
六、GMM-HMM在具体实现起来还是相当复杂的。
七、一般涉及到时间序列时才会使用HMM,比如这里音频中的语音识别,视频中的行为识别等。如果我们用GMM-HMM对静态的图片分类,因为这里没涉及到时间信息,所以HMM的状态数可设为1,那么此时的GMM-HMM算法就退化成GMM算法了。
 
 

Categories
爪机爪机

Sprint Galaxy S4 L720 NAE 固件(Modem)下载(无bootloader)

http://forum.xda-developers.com/showthread.php?t=2338919
百度网盘下载NAE Modem固件:
 
==================================================
Latest NAE Firmware – Download
NAE Mirror 1 – Download
MK2 Firmware – Download
MK2 Mirror 1 – Download
MJA Firmware – Download
MJA Mirror 1 – Download
MF9 Firmware – Download
MF9 Mirror 1 – Download
MDL Firmware – Download
MDL Mirror 1 – Download
MDC Firmware – Download
MDC Mirror 1 – Download

Categories
不学无术

日语假名的由来(对应汉语文字)

下面罗列出的是日语假名的由来,希望对大家的记忆有一定的帮助。
<平假名ひらがな> <片假名カタカナ>
 
安 → あ 阿 → ア(阿の左側部分)
以 → い 伊 → イ(伊の左側部分)
宇 → う 宇 → ウ(宇の上の部分)
衣 → え 江 → エ(江の右側部分)
於 → お 於 → オ(於の左側部分)
 
加 → か 加 → カ(加の左側部分)
幾 → き 幾 → キ
久 → く 久 → ク(久の左側部分)
計 → け 介 → ケ
己 → こ 己 → コ(己の上の部分)
 
左 → さ 散 → サ(散の左上部分)
之 → し 之 → シ
寸 → す 須 → ス(須の右側部分)
世 → せ 世 → セ
曽 → そ 曽 → ソ(曽の上の部分)
 
太 → た 多 → タ(多の上の部分)
知 → ち 千 → チ
川 → つ 川 → ツ
天 → て 天 → テ
止 → と 止 → ト(止の右上部分)
 
奈 → な 奈 → ナ(奈の左上部分)
仁 → に 二 → ニ
奴 → ぬ 奴 → ヌ(奴の右側部分)
祢 → ね 祢 → ネ(祢の左側部分)
乃 → の 乃 → ノ(乃の左側部分)
 
波 → は 八 → ハ
比 → ひ 比 → ヒ(比の右側部分)
不 → ふ 不 → フ(不の左上部分)
部 → へ 部 → ヘ(部の右側部分)
保 → ほ 保 → ホ(保の右下部分)
 
末 → ま 末 → マ
美 → み 三 → ミ
武 → む 牟 → ム(牟の上の部分)
女 → め 女 → メ(女の下の部分)
毛 → も 毛 → モ
 
也 → や 也 → ヤ
由 → ゆ 由 → ユ(由の右側部分)
与 → よ 与 → ヨ
 
良 → ら 良 → ラ(良の右上部分)
利 → り 利 → リ(利の右側部分)
留 → る 流 → ル(流の右下部分)
礼 → れ 礼 → レ(礼の右側部分)
呂 → ろ 呂 → ロ(呂の上の部分)
 
和 → わ 和 → ワ(和の右上部分)
遠 → を 乎 → ヲ
无 → ん 尓 → ン
 

Categories
不学无术

沪江网上的免费日语视频教程 | 日语基础视频讲座 | 日语初级视频讲座 |新版标准日本语视频初级讲座

发现这个地址挺难找到的,与大家分享:
http://jp.hjenglish.com/new/zt/riyushipin/
有以下三个内容的视频(虽然有些比较模糊但是是完全免费的!)
=====================

日语基础视频讲座

《日语基础》结构严谨内容充实,是合中日两国专家之力编成的一套具有权威性的、质量上乘的日语教材。前面的学习为基础阶段,对学生进行日语语音、文字、词汇、语法、句型以及功能意念等的教学。一共40讲。
=====================

日语初级视频讲座

「日本語で暮らそう」是日本NHK于2010年推出的一套日语教学视频讲座。为日语初级学者量身打造,适合日语初级学者提高实用日语口语和语法水平。一共25讲。
=====================

新版标准日本语视频初级讲座

《新版中日交流标准日本语(初级上、下)》电视辅导讲座2006年暑期于上海教育电视台首播,共50集,每集20分钟。节目播出后取得非常好的社会反响。希望更多日语学习者能观看到标日的辅导讲座,更好地学习这套教材。这里收录除2课入门单元的48课课文内容。
Categories
木有技术

解决:Chrome地址栏输入任何东西搜索出来的结果都是{searchterms}

因为Chrome下载另存为的时候经常假死,所以我就把它卸载重装了下。然后另外个问题来了,直接在地址栏搜索的话默认使用Google但是关键词全部都变成了{searchterms},如果在设置中使用Yahoo等其他搜索引擎却是正常的。
搜了一下发现有人跟我状况一样的:http://bbs.kafan.cn/thread-1364513-1-1.html
解决方法:
浏览器中输入chrome://settings/
然后找到“搜索”
QQ截图20140209134407
 
 
 
 
点击“管理搜索引擎”
QQ截图20140209134523
 
然后注意上图红色框的地方
修改为

http://www.google.com.hk/search?client=aff-6655&forid=1&ie=utf-8&oe=utf-8&hl=zh-cn&q=%s

然后点击“完成”就搞定啦!

Categories
木有技术

Xcode无法下载 已购重试问题的解决

自己的x230上面装VmWare然后装黑苹果,装好后升级到10.9.1出现了软件无法下载的问题。然后去各种搜索,今天终于搜到了,原因出在dns上面。把dns改称公用dns把,我用的114.114.114.114
然后一切问题就解决啦!

Categories
爪机爪机

修改3minit Settings的默认设置

SystemUI.apk
/smali/com/android/systemui/statusbar/MinitSettingsUI.smali
里面有个方法叫

.method public static LoadSettings(Landroid/content/Context;)V

 

Categories
爪机爪机

[HOWTO] / [GUIDE] SPH-L720 Domestic SIM Unlock T-Mobile:AT&T:metroPCS:Straighttalk

FROM http://forum.xda-developers.com/showthread.php?t=2530610
==============================================================
Streamlined Guide for Domestic T-Mobile GSM Unlock for SPH-L720
Credit for all of this goes to @autoprime and @nicotheandroidguy
A few notes: I used Windows 7 for the odin flashes , my phone is a SPH-L720 and it is not active on the Sprint network, also the sim card from t-mobile was inactive (brand new from t-mobile store.) and it has a bad esn. I am located in the Phoenix az market so I’m able to take advantage of the 1900mhz band that tmobile has here.
I’m unsure of how this will work with mnvos or other primary carriers and frankly I don’t care at the moment, this is my primary phone. Update: confirmed hspa+ for tmobile, metroPCS, straight talk and AT&T.
I HAD MY NEW UNACTIVATED TMOBILE SIM CARD IN THIS ENTIRE TIME
1) First I reverted my rom to a stock MF9 rooted touchwiz rom, instructions and one click odin here:http://forum.xda-developers.com/show….php?t=2486134 I’m trying not to straight copy and paste someone else’s work so take a look at that post if you need a clean start. If you are coming from non stock you will need to boot into stock recovery and wipe data/cache before you get started. (I also later used SAC’s rom after a failed attempt at an AOKP fix and it worked as well ) you can switch to any ROM later and the unlock will stick.
2)I rebooted the phone and followed the instructions listed here in post #1 http://forum.xda-developers.com/show….php?t=2415587
3) I went to the dialer and typed *#0011# which brought me to the “service mode” Menu.
IF YOU HAVE TROUBLE GETTING THE HIDDEN MENU TO OPEN DO NOT FEAR! I had a ton of trouble at first. In some builds you need to activate an option by adding a line to your build.prop or changing the no flag in efs/hiddenmenu to ON. Google it, there is a ton of help out there.
4) Press the left menu softbutton (the menu button that lights up and vibrates when you touch it) then press the either the button “select” or “Key Input” and type the number 1 or 2 into the box, if nothing happens press menu and select the “back “ button then repeat. This app is sort of like a tin can radio, you can kind of tell that it’s working, but it doesn’t work well.
Depending on if you pressed 1 or 2 in the dialogue box it will take you into either an UMTS or CDMA menu. If you are in the umts menu, press the menu button and select back, this should then proceed to the next step.
5) Select CDMA, then 1.COMMON, press next page twice until you reach page three of COMMON and select 8.PREF MODE SET and select GSM_WCDMA_ONLY
6) Press menu and back until you are at the main menu and select [1]UMTS, then select [1]DEBUG SCREEN, then select [6]PHONE CONTROL, select [2]FAKE SECURITY CONTROL and make sure it is set to ON
7)Press menu and back and select [3] NAS CONTROL. We are going to check a few different settings in this menu so remember how to get here cause I don’t want to repeat myself.
[1] CIPHERING CONTROL = OFF
[2] INTEGRITY CONTROL =ON
[3] SIM CLASS CONTROL = UMTS
[4] REVISION CONTROL = DO NOT TOUCH
[5] RRC(HSPA) CONTROL = DO NOT TOUCH
[6] DUALMODE IMPROVEMENT CONTROL= DO NOT TOUCH
[7] NAS AVOID SECURITY CONTROL= OFF, 0
[8] BIP BLOCK = 1
8) Press menu and back twice, you should be on the PHONE CONTROL menu. Select [7] NETWORK CONTROL, select [1] GFC and make sure that it is set to [1]GSM/(E)GPRS/WCDMA REL8 .
9) Press menu and back and select [2] BAND SELECTION and select WCDMA/GSM ALL for both WCDMA and GSM band preferences. I selected the ALL choice for LTE as well even though I know it isn’t supported for TMOBILE.
10) Under the NETWORK CONTROL menu we just came from select [4] AQUISITION ORDER and change it to [3]UMTS_GSM
11) Press menu and back until you are in the PHONE CONTROL menu and select [5] SIMULATION , press the [2] SW WATCHDOG button 6(six) times and then the [3] HW WATCHDOG 6(six) times. Nothing will happen at all to let you know if you have done this correcctly but as soon as you finish the sixth press on HW WATCHDOG reboot the phone manually:manually:manually IMMEDIATELY . I’m not sure what this does or why this works but @nicotheandroidguy seems to have divined that this is the vital part of the process.
YOUR PHONE STILL WILL NOT HAVE DATA OR VOICE WHEN YOU REBOOT FROM THE WATCHDOG TAPS DO NOT PANIC!!!!!!!!!!! (hopefullly you have your towel with you)
12) WIFI that sonofa up and search for apn settings shortcut and build.prop editor in the Play Store.
Go into the build.prop editor and add the following two lines:
ril.sales_code=LOL
ro.csc.sales_code=LOL
REBOOT PHONE MANUALLY now.
Now Install and create a shortcut on the home screen and select to open. Press the menu soft key and select add apn.
Use:
Name: T-Mobile
APN: epc.tmobile.com or fast.t-mobile.com (for LTE devices)
Proxy:
Port:
Username:
Password:
Server:
MMSC: http://mms.msg.eng.t-mobile.com/mms/wapenc
MMS proxy:
MMS port:
MMS protocol: WAP 2.0
MCC: 310
MNC: 260
Authentication type:
APN type: default,supl,admin,dun,mms
13) Go into your android settings, select wireless networks, you should see the network mode set as wcdma only do not change this, we set this in the Service Mode Menu , Check that your roaming settings are set to for roaming data/ international data etc.also make sure that there are no roaming guards left on. (roaming guards will only allow you to uncheck GSM and GSM data under international roaming.)
14) reboot
15) profit
At this point I had full access to the TMOBILE UMTS/HSPA+ network and voice/text/mms were working.
At this point you may change roms, be careful not to update past mf9 as you may be unable to downgrade to mdc. YOU MUST DOWNGRADE TO MDC MODEM FOR THIS TO WORK.
If you use a non touchwiz rom you can still access the tellinfo menu by pressing *#*#4636#*#* and selecting WCDMA only and manually adding the apn.
GOOD LUCK! let me know what needs changed in the guide as well.
If you have questions it’s useful to know your Baseband /kernel/ rom.

Categories
爪机爪机

[MOD][HOW-TO] 在快捷按钮中增加“手电筒” [4.3]

英文原文来自:http://forum.xda-developers.com/showthread.php?t=2617552
本人对翻译成果保留版权。
翻译待办
=====================================================
需要的东西:

  1. SystemUI.apk
  2. SecSettings.apk
  3. Notepad++ 或其他文本编辑器 (请勿使用系统自带的“记事本”软件)
  4. apktool 或 baksmali+smali 或 VTS等等能够反编译的工具

———————————————————–
第1步: 修改 SystemUI.apk

  1. Decompile SystemUI.apk and navigate to com/android/systemui/statusbar/policy/quicksetting in your file browser
  2. Copy and paste FlashlightQuickSettingButton.smali (flashlight_files.zip/SystemUI/FlashlightQuickSettingButton.smali) into this folder
  3. Navigate to SystemUI/res/drawable-xhdpi (or SystemUI/res/drawable-xxhdpi depending on your device)
  4. Copy and paste the two pngs (tw_quick_panel_icon_flashlight_off.png and tw_quick_panel_icon_flashlight_on.png) from the SystemUI folder of the attachment into the decompiled drawable folder you opened above
  5. Now navigate to SystemUI/res/values and open the strings.xml with your text editor
  6. Search for “quickpanel_flashlight_text”. If it does not exist anywhere in the file, add this to the bottom of your strings.xml file (before the of course)
    <string name="quickpanel_flashlight_text">Flashlight</string>

     

  7. Now we need to generate public.xml values for the files you added so compile the SystemUI.apk at this point and then decompile it again
  8. Navigate to SystemUI/res/values and open the public.xml with your text editor
  9. Now find the lines for the three resources you added (search in the file) and write down the ids for each. The ids will be in the form 0x12345678
    Look for these names and write down the ids for each (make sure you write down the name WITH the id)
    tw_quick_panel_icon_flashlight_off
    tw_quick_panel_icon_flashlight_on
    quickpanel_flashlight_text

     

  10. Now navigate to com/android/systemui/statusbar/policy/quicksetting and open FlashlightQuickSettingButton.smali with your text editor
  11. Now go to to the constructor (search for .method public constructor ) and you will see the following three lines of code
    # text id
    const v3, 0x0
    # on image id
    const v4, 0x0
    # off off id
    const v5, 0x0

    These lines reference the resource ids for the flashlight toggle text, on image, and off image respectively. Use the comments indicating which is which and replace the ids that are currently there with the ids that you wrote down above.

  12. Now recompile SystemUI.apk and move on to step 2. At this point, the toggle will show up in the full toggles view (when you add “;Flashlight” to the CscFeature… or to the notification_panel_active_app_list in /data/data/com.android.providers.settings/settings.db) in the status bar, but Settings will FC if you try to go into edit mode/rearrange toggles mode

附件1:flashlight_files

——————————————————————-
Step 2: 修改 SecSettings.apk

  1. Decompile SecSettings and navigate to com/android/settings
  2. Open NotificationPanelMenu.smali and search for the method “.method private makeConvertPanelName”
  3. Make sure that the following lines are present somewhere in the makeConvertPanelName method. Notice that they are NOT the same, but indeed very similar.
    iget-object v0, p0, Lcom/android/settings/NotificationPanelMenu;->mConvertPanelItemstring:Ljava/util/HashMap;
    const-string v1, "Flashlight"
    const-string v2, "notification_panel_flashlight"
    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    AND
    iget-object v0, p0, Lcom/android/settings/NotificationPanelMenu;->mConvertPanelItemstring:Ljava/util/HashMap;
    const-string v1, "notification_panel_flashlight"
    const-string v2, "Flashlight"
    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    If the 8 lines above are not anywhere in the

    makeConvertPanelName

    method, then add them to the end of the method before the

    return-void

     

  4. Now save the file and close it and navigate to SecSettings/res/values/strings.xml
  5. Add the following line to your strings.xml if it does not already exist (yes, it has the same name as the image. That’s supposed to happen so don’t worry)
    <string name="notification_panel_flashlight">Flashlight</string>

     

  6. Save and close strings.xml and navigate to SecSettings/res/drawable-xhdpi or drawable-xxhdpi depending on your device
  7. Extract the notification_panel_flashlight.png from attachment.zip/SecSettings and copy it into the drawable folder from above
  8. Finally, recompile SecSettings with your modifications

下面是最后一步,将修改好的 SecSettings.apk, SystemUI.apk 和 来自附件中的Torch.apk 一并加入 /system/app 文件夹下!
恭喜大功告成 

感谢:
Samsung for the AT&T base code this was pulled from!
Rompnit for finding the at&t code and the first part of the mod!
Google for the wonderful logcat tool built into Android that allowed me to figure out the second part of the mod!!