-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathGaussianMixture.java
More file actions
164 lines (143 loc) · 4.04 KB
/
Copy pathGaussianMixture.java
File metadata and controls
164 lines (143 loc) · 4.04 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package edu.jhuapl.trinity.data.messages.xai;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import edu.jhuapl.trinity.data.messages.MessageData;
import java.util.ArrayList;
import java.util.List;
/**
* @author Sean Phillips
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class GaussianMixture extends MessageData {
public static enum COVARIANCE_MODE {
DIAGONAL, FULL
}
public static final String TYPESTRING = "gaussian_mixture";
//<editor-fold defaultstate="collapsed" desc="JSON Payload">
/*
{
"version": "0.1",
"component": "message_tester",
"componentType": "simulated_data",
"componentName": "gaussian_mixture_simulation",
"messageType": "gaussian_mixture",
"topic": "gaussian_mixture",
"messageId": 0,
"numFeatures": 255,
"numComponents": 4,
"covarianceMode": "diag",
"data": [
{
"mean": [list of floats of length numFeatures],
"covariance": [list of floats of length numFeatures]
},
{
"mean": [list of floats of length numFeatures],
"covariance": [list of floats of length numFeatures]
},
{
"mean": [list of floats of length numFeatures],
"covariance": [list of floats of length numFeatures]
},
{
"mean": [list of floats of length numFeatures],
"covariance": [list of floats of length numFeatures]
}
],
"label": "horse"
}
*/
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Payload Fields">
private String entityId;
private List<GaussianMixtureData> data;
private String label; // "horse"
private int numFeatures; //255,
private int numComponents; //4,
private String covarianceMode; //"diag", "full"
//</editor-fold>
public GaussianMixture() {
this.messageType = TYPESTRING;
this.data = new ArrayList<>();
}
public static boolean isGaussianMixture(String messageBody) {
return messageBody.contains("messageType")
&& messageBody.contains(TYPESTRING)
&& messageBody.contains("covarianceMode");
}
//<editor-fold defaultstate="collapsed" desc="Properties">
/**
* @return the entityId
*/
public String getEntityId() {
return entityId;
}
/**
* @param entityId the entityId to set
*/
public void setEntityId(String entityId) {
this.entityId = entityId;
}
/**
* @return the data
*/
public List<GaussianMixtureData> getData() {
return data;
}
/**
* @param data the data to set
*/
public void setData(List<GaussianMixtureData> data) {
this.data = data;
}
/**
* @return the label
*/
public String getLabel() {
return label;
}
/**
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
/**
* @return the numFeatures
*/
public int getNumFeatures() {
return numFeatures;
}
/**
* @param numFeatures the numFeatures to set
*/
public void setNumFeatures(int numFeatures) {
this.numFeatures = numFeatures;
}
/**
* @return the numComponents
*/
public int getNumComponents() {
return numComponents;
}
/**
* @param numComponents the numComponents to set
*/
public void setNumComponents(int numComponents) {
this.numComponents = numComponents;
}
/**
* @return the covarianceMode
*/
public String getCovarianceMode() {
return covarianceMode;
}
/**
* @param covarianceMode the covarianceMode to set
*/
public void setCovarianceMode(String covarianceMode) {
this.covarianceMode = covarianceMode;
}
//</editor-fold>
}