MCPcopy Create free account
hub / github.com/davisking/dlib / unigram_extractor

Method unigram_extractor

dlib/test/sequence_segmenter.cpp:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 std::map<unsigned long, matrix<double,0,1> > feats;
35
36 unigram_extractor()
37 {
38 matrix<double,0,1> v1, v2, v3;
39 v1 = randm(num_features(), 1, rnd);
40 v2 = randm(num_features(), 1, rnd);
41 v3 = randm(num_features(), 1, rnd);
42 v1(0) = 1;
43 v2(1) = 1;
44 v3(2) = 1;
45 v1(3) = -1;
46 v2(4) = -1;
47 v3(5) = -1;
48 for (unsigned long i = 0; i < num_features(); ++i)
49 {
50 if ( i < 3)
51 feats[i] = v1;
52 else if (i < 6)
53 feats[i] = v2;
54 else
55 feats[i] = v3;
56 }
57 }
58
59 unsigned long num_features() const { return 10; }
60 unsigned long window_size() const { return 3; }

Callers

nothing calls this directly

Calls 1

randmFunction · 0.70

Tested by

no test coverage detected