2017-05-22 1 views
2

教師付き分類のためのpaper on fasttextでは、著者はいくつかのパラメータを変更することでさまざまな隠れ単位を指定しました(hは3,4ページのものです - 表1では " 10個の隠れたユニットがあり、それをバイグラムの有無にかかわらず評価する」)。しかし、the documentationを読んだ後は、変更する「隠れユニット」パラメータがないように見える。隠れユニットの数を指定する方法はありますか?あるいは、これは-dimオプションを指定するのと同じですか?Facebookファストテキストの隠し単位の数を指定

+0

Facebookのグループページから:私は分類のためFasttextを使用する際に、お願いしたいと思い、ニューラルネットソフトマックスに使用されるノードの数は何ですか? - softmaxレイヤーのノード数はクラス数と同じです(または階層ソフトマックスの場合はそれ以上です)。それから、サイズがあなたによって設定される隠れたレイヤーがあります(ウィット - ディム)。これは以下の答えと一致しています。 –

答えて

0

kは、 https://arxiv.org/pdf/1607.01759v3.pdf

のセクション2.1からクラス

をより正確には、計算の複雑さはO(KH)、kはクラスおよびHテキスト表現の次元の数です。


docsから、テキスト分類のクラスを予測する場合:

引数kはオプションであり、デフォルトでは1に等しいです。 Kテキストの一部のための最も可能性の高いラベルを得るためには 、使用:

$を予測./fasttext model.bin test.txtのK


モデルを訓練 、 __label__*タグを使用して監督訓練を行う場合、これはトレーニングデータに暗黙的に指定されています。 example tutorialから

$ wget https://s3-us-west-1.amazonaws.com/fasttext-vectors/cooking.stackexchange.tar.gz && tar xvzf cooking.stackexchange.tar.gz 
--2017-05-23 09:03:26-- https://s3-us-west-1.amazonaws.com/fasttext-vectors/cooking.stackexchange.tar.gz 
Resolving s3-us-west-1.amazonaws.com... 54.231.236.45 
Connecting to s3-us-west-1.amazonaws.com|54.231.236.45|:443... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 457609 (447K) [application/x-gzip] 
Saving to: ‘cooking.stackexchange.tar.gz.1’ 

cooking.stackexchange.tar.gz.1  100%[================================================================>] 446.88K 385KB/s in 1.2s  

2017-05-23 09:03:28 (385 KB/s) - ‘cooking.stackexchange.tar.gz.1’ saved [457609/457609] 

x cooking.stackexchange.id 
x cooking.stackexchange.txt 
x readme.txt 


$ cat readme.txt 
The data in this archive is derived from the user-contributed content on the 
Cooking Stack Exchange website (https://cooking.stackexchange.com/), used under 
CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/). 

The original data dump can be downloaded from: 
https://archive.org/download/stackexchange/cooking.stackexchange.com.7z 
and details about the dump obtained from: 
https://archive.org/details/stackexchange 

We distribute two files, under CC-BY-SA 3.0: 

- cooking.stackexchange.txt, which contains all question titles and 
    their associated tags (one question per line, tags are prefixed by 
    the string "__label__") ; 

- cooking.stackexchange.id, which contains the corresponding row IDs, 
    from the original data dump. 
関連する問題