タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

C++とalgorithmに関するKinjouJのブックマーク (4)

  • ウェーブレット木を試す - Negative/Positive Thinking

    はじめに 巨大な文字列でも高速にクエリ処理できる噂の木を、挙動を確認するため作ってみた。 コード アルファベット(a〜z)の文字列を扱う場合 完備辞書の操作が愚直、ビット列がvector を参考にしたけど、2か所間違ってる? #include <iostream> #include <vector> #include <queue> #include <cmath> //top_kのためのタプル struct ST { int t; size_t st, en; ST(int t, size_t st, size_t en):t(t),st(st),en(en){} }; bool operator<(const ST& a, const ST& b){ return (a.en-a.st) < (b.en-b.st); } //アルファベット([a-z]+)用のウェーブレット木 cla

    ウェーブレット木を試す - Negative/Positive Thinking
  • p-Stable LSHをC++11でさっくり実装 - nyanp::blog

    高次元の特徴量を持ったベクトルの集合に対して,与えられたクエリベクトルに似ているものを探し出すという問題を,近傍探索とかいう.旧来のkd-treeあたりを使った探索ではなく,近似的に近いベクトルを探す近似近傍探索が流行っている(らしい).近似近傍探索のひとつ,LSHの説明を読んでたら「これ案外簡単に実装できるんじゃね?」と思い至ったので,C++11で書いてみた. LSHについては以下の説明がとても分かりやすい. 060108 Locality-Sensitive Hashingの実装が一段落 - 飛行船通信 - Seesaa Wiki(ウィキ) 他には以下を実装の参考にした. lsh p-stable 最近のバイナリハッシングをいくつかJavaで実装してみた - るびゅ備忘録 Locality Sensitive Hashing - (setf yaruki nil) - nlpyutor

    p-Stable LSHをC++11でさっくり実装 - nyanp::blog
  • Open Data Structures

    Open Data Structures covers the implementation and analysis of data structures for sequences (lists), queues, priority queues, unordered dictionaries, ordered dictionaries, and graphs. Data structures presented in the book include stacks, queues, deques, and lists implemented as arrays and linked-lists; space-efficient implementations of lists; skip lists; hash tables and hash codes; binary search

  • CRFを試す - Negative/Positive Thinking

    はじめに 条件付き確率場(Conditional Random Fields)を実装してみた。 の式導出がわからなくて、夜な夜なmac book airを涙で濡らしながら書いたので、あやしい。 説明 基的に「言語処理のための機械学習入門」のの通りに書いた(つもり、、、) すごく自信ない、勉強用 ダミーラベルのB、EはそれぞれBOS、EOS φ(x,yt,yt-1)ってなってるけど、とりあえずφ_i(xt,yt,yt-1)を素性として利用(「単語」と「その品詞」と「その一つ前の単語の品詞」) 最急勾配法 L2正則化 forward-backwardの部分は何もやってない ちなみに式導出は、上記ののP.155の真ん中あたり 補足説明 : http://www.lr.pi.titech.ac.jp/~takamura/pukiwiki/index.php?%CA%E4%C2%AD%C0%

    CRFを試す - Negative/Positive Thinking
  • 1