-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathModels.hpp
81 lines (78 loc) · 2.75 KB
/
Models.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once
#include "text/TextModel.hpp"
#include "model/Audio16BitModel.hpp"
#include "model/Audio8BitModel.hpp"
#include "model/CharGroupModel.hpp"
#include "model/ChartModel.hpp"
#include "model/DmcForest.hpp"
#include "model/ExeModel.hpp"
#include "model/Image1BitModel.hpp"
#include "model/Image24BitModel.hpp"
#include "model/Image4BitModel.hpp"
#include "model/Image8BitModel.hpp"
#include "model/IndirectModel.hpp"
#include "model/JpegModel.hpp"
#include "model/LinearPredictionModel.hpp"
#include "model/MatchModel.hpp"
#include "model/NestModel.hpp"
#include "model/NormalModel.hpp"
#include "model/RecordModel.hpp"
#include "model/SparseMatchModel.hpp"
#include "model/SparseBitModel.hpp"
#include "model/SparseModel.hpp"
#include "model/WordModel.hpp"
#include "model/XMLModel.hpp"
#include "model/DecAlphaModel.hpp"
#include "lstm/LstmModel.hpp"
#include "lstm/LstmFactory.hpp"
#include "model/IContextModel.hpp"
#include "MixerFactory.hpp"
/**
* This is a factory class for lazy object creation for models.
* Objects created within this class are instantiated on first use and guaranteed to be destroyed.
*/
class Models {
private:
Shared * const shared;
const MixerFactory* const mixerFactory;
void trainText(const char* const dictionary, int iterations);
void trainExe();
public:
explicit Models(Shared* const sh, MixerFactory* mf);
void trainModelsWhenNeeded();
auto normalModel() -> NormalModel &;
auto dmcForest() -> DmcForest &;
auto charGroupModel() -> CharGroupModel &;
auto chartModel()->ChartModel&;
auto recordModel() -> RecordModel &;
auto sparseBitModel()->SparseBitModel&;
auto sparseModel() -> SparseModel &;
auto matchModel() -> MatchModel &;
auto sparseMatchModel() -> SparseMatchModel &;
auto indirectModel() -> IndirectModel &;
auto textModel() -> TextModel &;
auto wordModel() -> WordModel &;
auto nestModel() -> NestModel &;
auto xmlModel() -> XMLModel &;
auto exeModel() -> ExeModel &;
auto linearPredictionModel() -> LinearPredictionModel &;
auto jpegModel() -> JpegModel &;
auto image24BitModel() -> Image24BitModel &;
auto image8BitModel() -> Image8BitModel &;
auto image4BitModel() -> Image4BitModel &;
auto image1BitModel() -> Image1BitModel &;
auto audio8BitModel() -> Audio8BitModel &;
auto audio16BitModel() -> Audio16BitModel &;
auto decAlphaModel() -> DECAlphaModel &;
auto lstmModelText()->LstmModel<>&;
auto lstmModelGeneric()->LstmModel<>&;
auto lstmModelExe()->LstmModel<>&;
auto lstmModelDec()->LstmModel<>&;
auto lstmModelAudio8()->LstmModel<>&;
auto lstmModelAudio16()->LstmModel<>&;
auto lstmModelImage1()->LstmModel<>&;
auto lstmModelImage4()->LstmModel<>&;
auto lstmModelImage8()->LstmModel<>&;
auto lstmModelImage24()->LstmModel<>&;
auto lstmModelJpeg()->LstmModel<>&;
};