-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdnae_decomposition.h
72 lines (44 loc) · 2.07 KB
/
dnae_decomposition.h
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
/* dnae_decomposition.h -*- C++ -*-
Jeremy Barnes, 24 October 2009
Copyright (c) 2009 Jeremy Barnes. All rights reserved.
Denoising Auto Encoder decomposition.
*/
#ifndef __ausdm__dnae_decomposition_h__
#define __ausdm__dnae_decomposition_h__
#include "decomposition.h"
#include "jml/neural/auto_encoder_stack.h"
#include "jml/arch/threads.h"
typedef float LFloat;
namespace ML {
} // namespace ML
/*****************************************************************************/
/* DNAE_DECOMPOSITION */
/*****************************************************************************/
/** Object that decomposes a set of model predictions into a denoised
autoencoder representation. */
struct DNAE_Decomposition : public Decomposition {
DNAE_Decomposition();
/// The auto-encoder stack that implements the decomposition
ML::Auto_Encoder_Stack stack;
/// The means of each model; used to normalize
distribution<double> means;
/// Apply the decomposition, returning the decomposed element
virtual distribution<float>
decompose(const distribution<float> & model_outputs, int order = -1) const;
virtual distribution<float>
recompose(const distribution<float> & model_outputs,
const distribution<float> & decomposition,
int order = -1) const;
/** Which order values should be passed to recompose? */
virtual std::vector<int> recomposition_orders() const;
virtual void serialize(ML::DB::Store_Writer & store) const;
virtual void reconstitute(ML::DB::Store_Reader & store);
virtual void init(const ML::Configuration & config);
virtual std::string class_id() const;
virtual void train(const Data & training_data,
const Data & testing_data,
const ML::Configuration & config);
bool operator == (const DNAE_Decomposition & other) const;
virtual size_t size() const { return stack.outputs(); }
};
#endif /* __ausdm__dnaw_decomposition_h__ */