1 | using System;
|
---|
2 | using HeuristicLab.Common;
|
---|
3 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
4 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.Problems.GaussianProcessTuning {
|
---|
7 |
|
---|
8 | #region interfaces
|
---|
9 | public interface IDimensionSymbol : ISymbol {
|
---|
10 | int Dimension { get; set; }
|
---|
11 | }
|
---|
12 | #endregion
|
---|
13 |
|
---|
14 | [StorableClass]
|
---|
15 | public sealed class ConfigurationStartSymbol : Symbol {
|
---|
16 | public override int MinimumArity {
|
---|
17 | get { return 3; }
|
---|
18 | }
|
---|
19 | public override int MaximumArity {
|
---|
20 | get { return 3; }
|
---|
21 | }
|
---|
22 | [StorableConstructor]
|
---|
23 | private ConfigurationStartSymbol(bool deserializing) : base(deserializing) { }
|
---|
24 | private ConfigurationStartSymbol(ConfigurationStartSymbol original, Cloner cloner)
|
---|
25 | : base(original, cloner) {
|
---|
26 | }
|
---|
27 |
|
---|
28 | public ConfigurationStartSymbol()
|
---|
29 | : base("GP Configuration", "The start symbol for a GP configuration") {
|
---|
30 | }
|
---|
31 | [StorableHook(HookType.AfterDeserialization)]
|
---|
32 | private void AfterDeserialization() {
|
---|
33 | }
|
---|
34 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
35 | return new ConfigurationStartSymbol(this, cloner);
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | #region mean function terminals
|
---|
40 | [StorableClass]
|
---|
41 | public sealed class MeanZero : Symbol {
|
---|
42 | public override int MinimumArity {
|
---|
43 | get { return 0; }
|
---|
44 | }
|
---|
45 | public override int MaximumArity {
|
---|
46 | get { return 0; }
|
---|
47 | }
|
---|
48 | [StorableConstructor]
|
---|
49 | private MeanZero(bool deserializing) : base(deserializing) { }
|
---|
50 | private MeanZero(MeanZero original, Cloner cloner)
|
---|
51 | : base(original, cloner) {
|
---|
52 | }
|
---|
53 |
|
---|
54 | public MeanZero()
|
---|
55 | : base("MeanZero", "Zero mean function") {
|
---|
56 | }
|
---|
57 | [StorableHook(HookType.AfterDeserialization)]
|
---|
58 | private void AfterDeserialization() {
|
---|
59 | }
|
---|
60 |
|
---|
61 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
62 | return new EmptyTerminalTreeNode(new MeanZero());
|
---|
63 | }
|
---|
64 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
65 | return new MeanZero(this, cloner);
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | [StorableClass]
|
---|
70 | public sealed class MeanOne : Symbol {
|
---|
71 | public override int MinimumArity {
|
---|
72 | get { return 0; }
|
---|
73 | }
|
---|
74 | public override int MaximumArity {
|
---|
75 | get { return 0; }
|
---|
76 | }
|
---|
77 | [StorableConstructor]
|
---|
78 | private MeanOne(bool deserializing) : base(deserializing) { }
|
---|
79 | private MeanOne(MeanOne original, Cloner cloner)
|
---|
80 | : base(original, cloner) {
|
---|
81 | }
|
---|
82 |
|
---|
83 | public MeanOne()
|
---|
84 | : base("MeanOne", "One mean function") {
|
---|
85 | }
|
---|
86 | [StorableHook(HookType.AfterDeserialization)]
|
---|
87 | private void AfterDeserialization() {
|
---|
88 | }
|
---|
89 |
|
---|
90 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
91 | return new EmptyTerminalTreeNode(this);
|
---|
92 | }
|
---|
93 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
94 | return new MeanOne(this, cloner);
|
---|
95 | }
|
---|
96 | }
|
---|
97 |
|
---|
98 | [StorableClass]
|
---|
99 | public sealed class MeanConst : Symbol {
|
---|
100 | [Storable]
|
---|
101 | public double MinValue { get; set; }
|
---|
102 | [Storable]
|
---|
103 | public double MaxValue { get; set; }
|
---|
104 | [Storable]
|
---|
105 | public double ValueShakingMu { get; set; }
|
---|
106 | [Storable]
|
---|
107 | public double ValueShakingSigma { get; set; }
|
---|
108 |
|
---|
109 | public override int MinimumArity {
|
---|
110 | get { return 0; }
|
---|
111 | }
|
---|
112 | public override int MaximumArity {
|
---|
113 | get { return 0; }
|
---|
114 | }
|
---|
115 | [StorableConstructor]
|
---|
116 | private MeanConst(bool deserializing) : base(deserializing) { }
|
---|
117 | private MeanConst(MeanConst original, Cloner cloner)
|
---|
118 | : base(original, cloner) {
|
---|
119 | MinValue = original.MinValue;
|
---|
120 | MaxValue = original.MaxValue;
|
---|
121 | ValueShakingMu = original.ValueShakingMu;
|
---|
122 | ValueShakingSigma = original.ValueShakingSigma;
|
---|
123 | }
|
---|
124 |
|
---|
125 | public MeanConst()
|
---|
126 | : base("MeanConst", "Constant mean function") {
|
---|
127 | MinValue = -100.0;
|
---|
128 | MaxValue = 100.0;
|
---|
129 | ValueShakingMu = 1.0;
|
---|
130 | ValueShakingSigma = 1.0;
|
---|
131 | }
|
---|
132 | [StorableHook(HookType.AfterDeserialization)]
|
---|
133 | private void AfterDeserialization() {
|
---|
134 | }
|
---|
135 |
|
---|
136 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
137 | return new MeanConstTreeNode();
|
---|
138 | }
|
---|
139 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
140 | return new MeanConst(this, cloner);
|
---|
141 | }
|
---|
142 | }
|
---|
143 |
|
---|
144 | [StorableClass]
|
---|
145 | public sealed class MeanLinear : Symbol, IDimensionSymbol {
|
---|
146 | [Storable]
|
---|
147 | public double AlphaMu { get; set; }
|
---|
148 | [Storable]
|
---|
149 | public double AlphaSigma { get; set; }
|
---|
150 | [Storable]
|
---|
151 | public double AlphaShakingMu { get; set; }
|
---|
152 | [Storable]
|
---|
153 | public double AlphaShakingSigma { get; set; }
|
---|
154 |
|
---|
155 | public override int MinimumArity {
|
---|
156 | get { return 0; }
|
---|
157 | }
|
---|
158 | public override int MaximumArity {
|
---|
159 | get { return 0; }
|
---|
160 | }
|
---|
161 | [Storable]
|
---|
162 | public int Dimension { get; set; }
|
---|
163 |
|
---|
164 | [StorableConstructor]
|
---|
165 | private MeanLinear(bool deserializing) : base(deserializing) { }
|
---|
166 | private MeanLinear(MeanLinear original, Cloner cloner)
|
---|
167 | : base(original, cloner) {
|
---|
168 | Dimension = original.Dimension;
|
---|
169 | AlphaMu = original.AlphaMu;
|
---|
170 | AlphaSigma = original.AlphaSigma;
|
---|
171 | AlphaShakingMu = original.AlphaShakingMu;
|
---|
172 | AlphaShakingSigma = original.AlphaShakingSigma;
|
---|
173 | }
|
---|
174 |
|
---|
175 | public MeanLinear(int dimension)
|
---|
176 | : base("MeanLinear", "Linear mean function") {
|
---|
177 | this.Dimension = dimension;
|
---|
178 | AlphaMu = 0.0;
|
---|
179 | AlphaSigma = 1.0;
|
---|
180 | AlphaShakingMu = 1.0;
|
---|
181 | AlphaShakingSigma = 0.1;
|
---|
182 | }
|
---|
183 | [StorableHook(HookType.AfterDeserialization)]
|
---|
184 | private void AfterDeserialization() {
|
---|
185 | }
|
---|
186 |
|
---|
187 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
188 | return new MeanLinearTreeNode(this);
|
---|
189 | }
|
---|
190 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
191 | return new MeanLinear(this, cloner);
|
---|
192 | }
|
---|
193 | }
|
---|
194 | #endregion
|
---|
195 |
|
---|
196 | #region mean function functions
|
---|
197 | [StorableClass]
|
---|
198 | public sealed class MeanScale : Symbol {
|
---|
199 | [Storable]
|
---|
200 | public double AlphaMu { get; set; }
|
---|
201 | [Storable]
|
---|
202 | public double AlphaSigma { get; set; }
|
---|
203 | [Storable]
|
---|
204 | public double AlphaShakingMu { get; set; }
|
---|
205 | [Storable]
|
---|
206 | public double AlphaShakingSigma { get; set; }
|
---|
207 |
|
---|
208 | public override int MinimumArity {
|
---|
209 | get { return 1; }
|
---|
210 | }
|
---|
211 | public override int MaximumArity {
|
---|
212 | get { return 1; }
|
---|
213 | }
|
---|
214 |
|
---|
215 | [StorableConstructor]
|
---|
216 | private MeanScale(bool deserializing) : base(deserializing) { }
|
---|
217 | private MeanScale(MeanScale original, Cloner cloner)
|
---|
218 | : base(original, cloner) {
|
---|
219 | AlphaMu = original.AlphaMu;
|
---|
220 | AlphaSigma = original.AlphaSigma;
|
---|
221 | AlphaShakingMu = original.AlphaShakingMu;
|
---|
222 | AlphaShakingSigma = original.AlphaShakingSigma;
|
---|
223 | }
|
---|
224 |
|
---|
225 | public MeanScale()
|
---|
226 | : base("MeanScale", "Scaled version of a mean function") {
|
---|
227 | AlphaMu = 0.0;
|
---|
228 | AlphaSigma = 1.0;
|
---|
229 | AlphaShakingMu = 1.0;
|
---|
230 | AlphaShakingSigma = 1.0;
|
---|
231 | }
|
---|
232 | [StorableHook(HookType.AfterDeserialization)]
|
---|
233 | private void AfterDeserialization() {
|
---|
234 | }
|
---|
235 |
|
---|
236 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
237 | return new MeanScaleTreeNode();
|
---|
238 | }
|
---|
239 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
240 | return new MeanScale(this, cloner);
|
---|
241 | }
|
---|
242 | }
|
---|
243 |
|
---|
244 |
|
---|
245 | [StorableClass]
|
---|
246 | public sealed class MeanPow : Symbol {
|
---|
247 | [Storable]
|
---|
248 | public int Exponent { get; set; }
|
---|
249 | public override int MinimumArity {
|
---|
250 | get { return 1; }
|
---|
251 | }
|
---|
252 | public override int MaximumArity {
|
---|
253 | get { return 1; }
|
---|
254 | }
|
---|
255 |
|
---|
256 | [StorableConstructor]
|
---|
257 | private MeanPow(bool deserializing) : base(deserializing) { }
|
---|
258 | private MeanPow(MeanPow original, Cloner cloner)
|
---|
259 | : base(original, cloner) {
|
---|
260 | Exponent = original.Exponent;
|
---|
261 | }
|
---|
262 |
|
---|
263 | public MeanPow(int exponent = 2)
|
---|
264 | : base("MeanPow", "Power of a mean function") {
|
---|
265 | Exponent = exponent;
|
---|
266 | }
|
---|
267 | [StorableHook(HookType.AfterDeserialization)]
|
---|
268 | private void AfterDeserialization() {
|
---|
269 | }
|
---|
270 |
|
---|
271 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
272 | return new MeanPow(this, cloner);
|
---|
273 | }
|
---|
274 | }
|
---|
275 |
|
---|
276 | [StorableClass]
|
---|
277 | public sealed class MeanProd : Symbol {
|
---|
278 | public override int MinimumArity {
|
---|
279 | get { return 2; }
|
---|
280 | }
|
---|
281 | public override int MaximumArity {
|
---|
282 | get { return 2; }
|
---|
283 | }
|
---|
284 |
|
---|
285 | [StorableConstructor]
|
---|
286 | private MeanProd(bool deserializing) : base(deserializing) { }
|
---|
287 | private MeanProd(MeanProd original, Cloner cloner)
|
---|
288 | : base(original, cloner) {
|
---|
289 | }
|
---|
290 |
|
---|
291 | public MeanProd()
|
---|
292 | : base("MeanProd", "Product of two functions") {
|
---|
293 | }
|
---|
294 | [StorableHook(HookType.AfterDeserialization)]
|
---|
295 | private void AfterDeserialization() {
|
---|
296 | }
|
---|
297 |
|
---|
298 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
299 | return new MeanProd(this, cloner);
|
---|
300 | }
|
---|
301 | }
|
---|
302 |
|
---|
303 | [StorableClass]
|
---|
304 | public sealed class MeanSum : Symbol {
|
---|
305 | public override int MinimumArity {
|
---|
306 | get { return 2; }
|
---|
307 | }
|
---|
308 | public override int MaximumArity {
|
---|
309 | get { return 2; }
|
---|
310 | }
|
---|
311 |
|
---|
312 | [StorableConstructor]
|
---|
313 | private MeanSum(bool deserializing) : base(deserializing) { }
|
---|
314 | private MeanSum(MeanSum original, Cloner cloner)
|
---|
315 | : base(original, cloner) {
|
---|
316 | }
|
---|
317 |
|
---|
318 | public MeanSum()
|
---|
319 | : base("MeanSum", "Sum of two functions") {
|
---|
320 | }
|
---|
321 | [StorableHook(HookType.AfterDeserialization)]
|
---|
322 | private void AfterDeserialization() {
|
---|
323 | }
|
---|
324 |
|
---|
325 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
326 | return new MeanSum(this, cloner);
|
---|
327 | }
|
---|
328 | }
|
---|
329 |
|
---|
330 | [StorableClass]
|
---|
331 | public sealed class MeanMask : Symbol, IDimensionSymbol {
|
---|
332 | [Storable]
|
---|
333 | public double MaskingProbability { get; set; }
|
---|
334 |
|
---|
335 | public override int MinimumArity {
|
---|
336 | get { return 1; }
|
---|
337 | }
|
---|
338 | public override int MaximumArity {
|
---|
339 | get { return 1; }
|
---|
340 | }
|
---|
341 | [Storable]
|
---|
342 | public int Dimension { get; set; }
|
---|
343 |
|
---|
344 | [StorableConstructor]
|
---|
345 | private MeanMask(bool deserializing) : base(deserializing) { }
|
---|
346 | private MeanMask(MeanMask original, Cloner cloner)
|
---|
347 | : base(original, cloner) {
|
---|
348 | MaskingProbability = original.MaskingProbability;
|
---|
349 | Dimension = original.Dimension;
|
---|
350 | }
|
---|
351 |
|
---|
352 | public MeanMask(int dimension)
|
---|
353 | : base("MeanMask", "Mask some dimensions of the data") {
|
---|
354 | this.Dimension = dimension;
|
---|
355 | MaskingProbability = 0.2;
|
---|
356 | }
|
---|
357 | [StorableHook(HookType.AfterDeserialization)]
|
---|
358 | private void AfterDeserialization() {
|
---|
359 | }
|
---|
360 |
|
---|
361 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
362 | return new MeanMaskTreeNode(this);
|
---|
363 | }
|
---|
364 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
365 | return new MeanMask(this, cloner);
|
---|
366 | }
|
---|
367 | }
|
---|
368 |
|
---|
369 | #endregion
|
---|
370 |
|
---|
371 | #region covariance function terminals
|
---|
372 | [StorableClass]
|
---|
373 | public sealed class CovConst : Symbol {
|
---|
374 | [Storable]
|
---|
375 | public double MinSigma { get; set; }
|
---|
376 | [Storable]
|
---|
377 | public double MaxSigma { get; set; }
|
---|
378 | [Storable]
|
---|
379 | public double SigmaShakingMu { get; set; }
|
---|
380 | [Storable]
|
---|
381 | public double SigmaShakingSigma { get; set; }
|
---|
382 |
|
---|
383 | public override int MinimumArity {
|
---|
384 | get { return 0; }
|
---|
385 | }
|
---|
386 | public override int MaximumArity {
|
---|
387 | get { return 0; }
|
---|
388 | }
|
---|
389 | [StorableConstructor]
|
---|
390 | private CovConst(bool deserializing) : base(deserializing) { }
|
---|
391 | private CovConst(CovConst original, Cloner cloner)
|
---|
392 | : base(original, cloner) {
|
---|
393 | this.MaxSigma = original.MaxSigma;
|
---|
394 | this.MinSigma = original.MinSigma;
|
---|
395 | this.SigmaShakingMu = original.SigmaShakingMu;
|
---|
396 | this.SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
397 | }
|
---|
398 |
|
---|
399 | public CovConst()
|
---|
400 | : base("CovConst", "Covariance for constant functions") {
|
---|
401 | MinSigma = 0.0;
|
---|
402 | MaxSigma = 100;
|
---|
403 | SigmaShakingMu = 1;
|
---|
404 | SigmaShakingSigma = 1;
|
---|
405 | }
|
---|
406 | [StorableHook(HookType.AfterDeserialization)]
|
---|
407 | private void AfterDeserialization() {
|
---|
408 | }
|
---|
409 |
|
---|
410 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
411 | return new CovConstTreeNode();
|
---|
412 | }
|
---|
413 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
414 | return new CovConst(this, cloner);
|
---|
415 | }
|
---|
416 | }
|
---|
417 |
|
---|
418 | [StorableClass]
|
---|
419 | public sealed class CovNoise : Symbol {
|
---|
420 | [Storable]
|
---|
421 | public double MinSigma { get; set; }
|
---|
422 | [Storable]
|
---|
423 | public double MaxSigma { get; set; }
|
---|
424 | [Storable]
|
---|
425 | public double SigmaShakingMu { get; set; }
|
---|
426 | [Storable]
|
---|
427 | public double SigmaShakingSigma { get; set; }
|
---|
428 |
|
---|
429 | public override int MinimumArity {
|
---|
430 | get { return 0; }
|
---|
431 | }
|
---|
432 | public override int MaximumArity {
|
---|
433 | get { return 0; }
|
---|
434 | }
|
---|
435 | [StorableConstructor]
|
---|
436 | private CovNoise(bool deserializing) : base(deserializing) { }
|
---|
437 | private CovNoise(CovNoise original, Cloner cloner)
|
---|
438 | : base(original, cloner) {
|
---|
439 | this.MaxSigma = original.MaxSigma;
|
---|
440 | this.MinSigma = original.MinSigma;
|
---|
441 | this.SigmaShakingMu = original.SigmaShakingMu;
|
---|
442 | this.SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
443 | }
|
---|
444 |
|
---|
445 | public CovNoise()
|
---|
446 | : base("CovNoise", "Noise covariance function") {
|
---|
447 | MinSigma = 0.0;
|
---|
448 | MaxSigma = 100;
|
---|
449 | SigmaShakingMu = 1;
|
---|
450 | SigmaShakingSigma = 1;
|
---|
451 | }
|
---|
452 | [StorableHook(HookType.AfterDeserialization)]
|
---|
453 | private void AfterDeserialization() {
|
---|
454 | }
|
---|
455 |
|
---|
456 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
457 | return new CovNoiseTreeNode();
|
---|
458 | }
|
---|
459 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
460 | return new CovNoise(this, cloner);
|
---|
461 | }
|
---|
462 | }
|
---|
463 |
|
---|
464 | [StorableClass]
|
---|
465 | public sealed class CovLin : Symbol {
|
---|
466 | public override int MinimumArity {
|
---|
467 | get { return 0; }
|
---|
468 | }
|
---|
469 | public override int MaximumArity {
|
---|
470 | get { return 0; }
|
---|
471 | }
|
---|
472 | [StorableConstructor]
|
---|
473 | private CovLin(bool deserializing) : base(deserializing) { }
|
---|
474 | private CovLin(CovLin original, Cloner cloner)
|
---|
475 | : base(original, cloner) {
|
---|
476 | }
|
---|
477 |
|
---|
478 | public CovLin()
|
---|
479 | : base("CovLin", "linear covariance function") {
|
---|
480 | }
|
---|
481 | [StorableHook(HookType.AfterDeserialization)]
|
---|
482 | private void AfterDeserialization() {
|
---|
483 | }
|
---|
484 |
|
---|
485 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
486 | return new EmptyTerminalTreeNode(this);
|
---|
487 | }
|
---|
488 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
489 | return new CovLin(this, cloner);
|
---|
490 | }
|
---|
491 | }
|
---|
492 | [StorableClass]
|
---|
493 | public sealed class CovLinArd : Symbol, IDimensionSymbol {
|
---|
494 | [Storable]
|
---|
495 | public double LambdaMu { get; set; }
|
---|
496 | [Storable]
|
---|
497 | public double LambdaSigma { get; set; }
|
---|
498 | [Storable]
|
---|
499 | public double LambdaShakingMu { get; set; }
|
---|
500 | [Storable]
|
---|
501 | public double LambdaShakingSigma { get; set; }
|
---|
502 | public override int MinimumArity {
|
---|
503 | get { return 0; }
|
---|
504 | }
|
---|
505 | public override int MaximumArity {
|
---|
506 | get { return 0; }
|
---|
507 | }
|
---|
508 |
|
---|
509 | [Storable]
|
---|
510 | public int Dimension { get; set; }
|
---|
511 |
|
---|
512 | [StorableConstructor]
|
---|
513 | private CovLinArd(bool deserializing) : base(deserializing) { }
|
---|
514 | private CovLinArd(CovLinArd original, Cloner cloner)
|
---|
515 | : base(original, cloner) {
|
---|
516 | Dimension = original.Dimension;
|
---|
517 | LambdaMu = original.LambdaMu;
|
---|
518 | LambdaSigma = original.LambdaSigma;
|
---|
519 | LambdaShakingMu = original.LambdaShakingMu;
|
---|
520 | LambdaShakingSigma = original.LambdaShakingSigma;
|
---|
521 | }
|
---|
522 |
|
---|
523 | public CovLinArd(int dimension)
|
---|
524 | : base("CovLinArd", "linear covariance function with ARD") {
|
---|
525 | this.Dimension = dimension;
|
---|
526 | LambdaMu = 0.0;
|
---|
527 | LambdaSigma = 1.0;
|
---|
528 | LambdaShakingMu = 1.0;
|
---|
529 | LambdaShakingSigma = 0.1;
|
---|
530 | }
|
---|
531 | [StorableHook(HookType.AfterDeserialization)]
|
---|
532 | private void AfterDeserialization() {
|
---|
533 | }
|
---|
534 |
|
---|
535 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
536 | return new CovLinArdTreeNode(this);
|
---|
537 | }
|
---|
538 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
539 | return new CovLinArd(this, cloner);
|
---|
540 | }
|
---|
541 | }
|
---|
542 | [StorableClass]
|
---|
543 | public sealed class CovSeArd : Symbol, IDimensionSymbol {
|
---|
544 | [Storable]
|
---|
545 | public double LambdaMu { get; set; }
|
---|
546 | [Storable]
|
---|
547 | public double LambdaSigma { get; set; }
|
---|
548 | [Storable]
|
---|
549 | public double LambdaShakingMu { get; set; }
|
---|
550 | [Storable]
|
---|
551 | public double LambdaShakingSigma { get; set; }
|
---|
552 | [Storable]
|
---|
553 | public double MinSigma { get; set; }
|
---|
554 | [Storable]
|
---|
555 | public double MaxSigma { get; set; }
|
---|
556 | [Storable]
|
---|
557 | public double SigmaShakingMu { get; set; }
|
---|
558 | [Storable]
|
---|
559 | public double SigmaShakingSigma { get; set; }
|
---|
560 |
|
---|
561 | public override int MinimumArity {
|
---|
562 | get { return 0; }
|
---|
563 | }
|
---|
564 | public override int MaximumArity {
|
---|
565 | get { return 0; }
|
---|
566 | }
|
---|
567 |
|
---|
568 | [Storable]
|
---|
569 | public int Dimension { get; set; }
|
---|
570 |
|
---|
571 | [StorableConstructor]
|
---|
572 | private CovSeArd(bool deserializing) : base(deserializing) { }
|
---|
573 | private CovSeArd(CovSeArd original, Cloner cloner)
|
---|
574 | : base(original, cloner) {
|
---|
575 | Dimension = original.Dimension;
|
---|
576 | LambdaMu = original.LambdaMu;
|
---|
577 | LambdaSigma = original.LambdaSigma;
|
---|
578 | LambdaShakingMu = original.LambdaShakingMu;
|
---|
579 | LambdaShakingSigma = original.LambdaShakingSigma;
|
---|
580 | MinSigma = original.MinSigma;
|
---|
581 | MaxSigma = original.MaxSigma;
|
---|
582 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
583 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
584 | }
|
---|
585 |
|
---|
586 | public CovSeArd(int dimension)
|
---|
587 | : base("CovSeArd", "full squared exponential covariance function with ARD") {
|
---|
588 | this.Dimension = dimension;
|
---|
589 | LambdaMu = 0.0;
|
---|
590 | LambdaSigma = 1.0;
|
---|
591 | LambdaShakingMu = 1.0;
|
---|
592 | LambdaShakingSigma = 0.1;
|
---|
593 | MinSigma = 0.0;
|
---|
594 | MaxSigma = 100.0;
|
---|
595 | SigmaShakingMu = 1.0;
|
---|
596 | SigmaShakingSigma = 1.0;
|
---|
597 | }
|
---|
598 | [StorableHook(HookType.AfterDeserialization)]
|
---|
599 | private void AfterDeserialization() {
|
---|
600 | }
|
---|
601 |
|
---|
602 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
603 | return new CovSeArdTreeNode(this);
|
---|
604 | }
|
---|
605 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
606 | return new CovSeArd(this, cloner);
|
---|
607 | }
|
---|
608 | }
|
---|
609 | [StorableClass]
|
---|
610 | public sealed class CovSeIso : Symbol {
|
---|
611 | [Storable]
|
---|
612 | public double MinSigma { get; set; }
|
---|
613 | [Storable]
|
---|
614 | public double MaxSigma { get; set; }
|
---|
615 | [Storable]
|
---|
616 | public double SigmaShakingMu { get; set; }
|
---|
617 | [Storable]
|
---|
618 | public double SigmaShakingSigma { get; set; }
|
---|
619 | [Storable]
|
---|
620 | public double MinL { get; set; }
|
---|
621 | [Storable]
|
---|
622 | public double MaxL { get; set; }
|
---|
623 | [Storable]
|
---|
624 | public double LShakingMu { get; set; }
|
---|
625 | [Storable]
|
---|
626 | public double LShakingSigma { get; set; }
|
---|
627 |
|
---|
628 | public override int MinimumArity {
|
---|
629 | get { return 0; }
|
---|
630 | }
|
---|
631 | public override int MaximumArity {
|
---|
632 | get { return 0; }
|
---|
633 | }
|
---|
634 |
|
---|
635 | [StorableConstructor]
|
---|
636 | private CovSeIso(bool deserializing) : base(deserializing) { }
|
---|
637 | private CovSeIso(CovSeIso original, Cloner cloner)
|
---|
638 | : base(original, cloner) {
|
---|
639 | MinSigma = original.MinSigma;
|
---|
640 | MaxSigma = original.MaxSigma;
|
---|
641 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
642 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
643 | MinL = original.MinL;
|
---|
644 | MaxL = original.MaxL;
|
---|
645 | LShakingMu = original.LShakingMu;
|
---|
646 | LShakingSigma = original.LShakingSigma;
|
---|
647 | }
|
---|
648 |
|
---|
649 | public CovSeIso()
|
---|
650 | : base("CovSeIso", "diagonal squared exponential covariance function") {
|
---|
651 | MinSigma = 1.0;
|
---|
652 | MaxSigma = 100.0;
|
---|
653 | SigmaShakingMu = 1.0;
|
---|
654 | SigmaShakingSigma = 1.0;
|
---|
655 | MinL = 1.0;
|
---|
656 | MaxL = 100.0;
|
---|
657 | LShakingMu = 1.0;
|
---|
658 | LShakingSigma = 1.0;
|
---|
659 | }
|
---|
660 | [StorableHook(HookType.AfterDeserialization)]
|
---|
661 | private void AfterDeserialization() {
|
---|
662 | }
|
---|
663 |
|
---|
664 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
665 | return new CovSeIsoTreeNode(this);
|
---|
666 | }
|
---|
667 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
668 | return new CovSeIso(this, cloner);
|
---|
669 | }
|
---|
670 | }
|
---|
671 |
|
---|
672 | [StorableClass]
|
---|
673 | public sealed class CovMatern : Symbol {
|
---|
674 | [Storable]
|
---|
675 | public double MinSigma { get; set; }
|
---|
676 | [Storable]
|
---|
677 | public double MaxSigma { get; set; }
|
---|
678 | [Storable]
|
---|
679 | public double SigmaShakingMu { get; set; }
|
---|
680 | [Storable]
|
---|
681 | public double SigmaShakingSigma { get; set; }
|
---|
682 | [Storable]
|
---|
683 | public double MinL { get; set; }
|
---|
684 | [Storable]
|
---|
685 | public double MaxL { get; set; }
|
---|
686 | [Storable]
|
---|
687 | public double LShakingMu { get; set; }
|
---|
688 | [Storable]
|
---|
689 | public double LShakingSigma { get; set; }
|
---|
690 |
|
---|
691 | [Storable]
|
---|
692 | public int D { get; set; }
|
---|
693 |
|
---|
694 | public override int MinimumArity {
|
---|
695 | get { return 0; }
|
---|
696 | }
|
---|
697 | public override int MaximumArity {
|
---|
698 | get { return 0; }
|
---|
699 | }
|
---|
700 |
|
---|
701 | [StorableConstructor]
|
---|
702 | private CovMatern(bool deserializing) : base(deserializing) { }
|
---|
703 | private CovMatern(CovMatern original, Cloner cloner)
|
---|
704 | : base(original, cloner) {
|
---|
705 | MinSigma = original.MinSigma;
|
---|
706 | MaxSigma = original.MaxSigma;
|
---|
707 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
708 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
709 | MinL = original.MinL;
|
---|
710 | MaxL = original.MaxL;
|
---|
711 | LShakingMu = original.LShakingMu;
|
---|
712 | LShakingSigma = original.LShakingSigma;
|
---|
713 | D = original.D;
|
---|
714 | }
|
---|
715 |
|
---|
716 | public CovMatern(int d)
|
---|
717 | : base("CovMatern", "Matern covariance function") {
|
---|
718 | MinSigma = 1.0;
|
---|
719 | MaxSigma = 100.0;
|
---|
720 | SigmaShakingMu = 1.0;
|
---|
721 | SigmaShakingSigma = 1.0;
|
---|
722 | MinL = 1.0;
|
---|
723 | MaxL = 100.0;
|
---|
724 | LShakingMu = 1.0;
|
---|
725 | LShakingSigma = 1.0;
|
---|
726 | this.D = d;
|
---|
727 | }
|
---|
728 | [StorableHook(HookType.AfterDeserialization)]
|
---|
729 | private void AfterDeserialization() {
|
---|
730 | }
|
---|
731 |
|
---|
732 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
733 | return new CovMaternTreeNode(this);
|
---|
734 | }
|
---|
735 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
736 | return new CovMatern(this, cloner);
|
---|
737 | }
|
---|
738 | }
|
---|
739 |
|
---|
740 | [StorableClass]
|
---|
741 | public sealed class CovPeriodic : Symbol {
|
---|
742 | [Storable]
|
---|
743 | public double MinSigma { get; set; }
|
---|
744 | [Storable]
|
---|
745 | public double MaxSigma { get; set; }
|
---|
746 | [Storable]
|
---|
747 | public double SigmaShakingMu { get; set; }
|
---|
748 | [Storable]
|
---|
749 | public double SigmaShakingSigma { get; set; }
|
---|
750 | [Storable]
|
---|
751 | public double MinL { get; set; }
|
---|
752 | [Storable]
|
---|
753 | public double MaxL { get; set; }
|
---|
754 | [Storable]
|
---|
755 | public double LShakingMu { get; set; }
|
---|
756 | [Storable]
|
---|
757 | public double LShakingSigma { get; set; }
|
---|
758 | [Storable]
|
---|
759 | public double MinPeriod { get; set; }
|
---|
760 | [Storable]
|
---|
761 | public double MaxPeriod { get; set; }
|
---|
762 | [Storable]
|
---|
763 | public double PeriodShakingMu { get; set; }
|
---|
764 | [Storable]
|
---|
765 | public double PeriodShakingSigma { get; set; }
|
---|
766 |
|
---|
767 | public override int MinimumArity {
|
---|
768 | get { return 0; }
|
---|
769 | }
|
---|
770 | public override int MaximumArity {
|
---|
771 | get { return 0; }
|
---|
772 | }
|
---|
773 |
|
---|
774 | [StorableConstructor]
|
---|
775 | private CovPeriodic(bool deserializing) : base(deserializing) { }
|
---|
776 | private CovPeriodic(CovPeriodic original, Cloner cloner)
|
---|
777 | : base(original, cloner) {
|
---|
778 | MinSigma = original.MinSigma;
|
---|
779 | MaxSigma = original.MaxSigma;
|
---|
780 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
781 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
782 | MinL = original.MinL;
|
---|
783 | MaxL = original.MaxL;
|
---|
784 | LShakingMu = original.LShakingMu;
|
---|
785 | LShakingSigma = original.LShakingSigma;
|
---|
786 | MinPeriod = original.MinL;
|
---|
787 | MaxPeriod = original.MaxL;
|
---|
788 | PeriodShakingMu = original.PeriodShakingMu;
|
---|
789 | PeriodShakingSigma = original.PeriodShakingSigma;
|
---|
790 | }
|
---|
791 |
|
---|
792 | public CovPeriodic()
|
---|
793 | : base("CovPeriodic", "Periodic covariance function") {
|
---|
794 | MinSigma = 1.0;
|
---|
795 | MaxSigma = 100.0;
|
---|
796 | SigmaShakingMu = 1.0;
|
---|
797 | SigmaShakingSigma = 1.0;
|
---|
798 | MinL = 1.0;
|
---|
799 | MaxL = 100.0;
|
---|
800 | LShakingMu = 1.0;
|
---|
801 | LShakingSigma = 1.0;
|
---|
802 | MinPeriod = 1.0;
|
---|
803 | MaxPeriod = 100.0;
|
---|
804 | PeriodShakingMu = 1.0;
|
---|
805 | PeriodShakingSigma = 1.0;
|
---|
806 | }
|
---|
807 | [StorableHook(HookType.AfterDeserialization)]
|
---|
808 | private void AfterDeserialization() {
|
---|
809 | }
|
---|
810 |
|
---|
811 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
812 | return new CovPeriodicTreeNode(this);
|
---|
813 | }
|
---|
814 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
815 | return new CovPeriodic(this, cloner);
|
---|
816 | }
|
---|
817 | }
|
---|
818 | [StorableClass]
|
---|
819 | public sealed class CovRQArd : Symbol, IDimensionSymbol {
|
---|
820 | [Storable]
|
---|
821 | public double LambdaMu { get; set; }
|
---|
822 | [Storable]
|
---|
823 | public double LambdaSigma { get; set; }
|
---|
824 | [Storable]
|
---|
825 | public double LambdaShakingMu { get; set; }
|
---|
826 | [Storable]
|
---|
827 | public double LambdaShakingSigma { get; set; }
|
---|
828 | [Storable]
|
---|
829 | public double MinSigma { get; set; }
|
---|
830 | [Storable]
|
---|
831 | public double MaxSigma { get; set; }
|
---|
832 | [Storable]
|
---|
833 | public double SigmaShakingMu { get; set; }
|
---|
834 | [Storable]
|
---|
835 | public double SigmaShakingSigma { get; set; }
|
---|
836 | [Storable]
|
---|
837 | public double MinShape { get; set; }
|
---|
838 | [Storable]
|
---|
839 | public double MaxShape { get; set; }
|
---|
840 | [Storable]
|
---|
841 | public double ShapeShakingMu { get; set; }
|
---|
842 | [Storable]
|
---|
843 | public double ShapeShakingSigma { get; set; }
|
---|
844 |
|
---|
845 | public override int MinimumArity {
|
---|
846 | get { return 0; }
|
---|
847 | }
|
---|
848 | public override int MaximumArity {
|
---|
849 | get { return 0; }
|
---|
850 | }
|
---|
851 |
|
---|
852 | [Storable]
|
---|
853 | public int Dimension { get; set; }
|
---|
854 |
|
---|
855 | [StorableConstructor]
|
---|
856 | private CovRQArd(bool deserializing) : base(deserializing) { }
|
---|
857 | private CovRQArd(CovRQArd original, Cloner cloner)
|
---|
858 | : base(original, cloner) {
|
---|
859 | Dimension = original.Dimension;
|
---|
860 | LambdaMu = original.LambdaMu;
|
---|
861 | LambdaSigma = original.LambdaSigma;
|
---|
862 | LambdaShakingMu = original.LambdaShakingMu;
|
---|
863 | LambdaShakingSigma = original.LambdaShakingSigma;
|
---|
864 | MinSigma = original.MinSigma;
|
---|
865 | MaxSigma = original.MaxSigma;
|
---|
866 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
867 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
868 | MinShape = original.MinShape;
|
---|
869 | MaxShape = original.MaxShape;
|
---|
870 | ShapeShakingMu = original.ShapeShakingMu;
|
---|
871 | ShapeShakingSigma = original.ShapeShakingSigma;
|
---|
872 | }
|
---|
873 |
|
---|
874 | public CovRQArd(int dimension)
|
---|
875 | : base("CovRQArd", "full rational quadratic covariance function with ARD") {
|
---|
876 | this.Dimension = dimension;
|
---|
877 | LambdaMu = 0.0;
|
---|
878 | LambdaSigma = 1.0;
|
---|
879 | LambdaShakingMu = 1.0;
|
---|
880 | LambdaShakingSigma = 0.1;
|
---|
881 | MinSigma = 0.0;
|
---|
882 | MaxSigma = 100.0;
|
---|
883 | SigmaShakingMu = 1.0;
|
---|
884 | SigmaShakingSigma = 1.0;
|
---|
885 | MinShape = 1.0;
|
---|
886 | MaxShape = 100.0;
|
---|
887 | ShapeShakingMu = 1.0;
|
---|
888 | ShapeShakingSigma = 1.0;
|
---|
889 | }
|
---|
890 | [StorableHook(HookType.AfterDeserialization)]
|
---|
891 | private void AfterDeserialization() {
|
---|
892 | }
|
---|
893 |
|
---|
894 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
895 | return new CovRQArdTreeNode(this);
|
---|
896 | }
|
---|
897 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
898 | return new CovRQArd(this, cloner);
|
---|
899 | }
|
---|
900 | }
|
---|
901 | [StorableClass]
|
---|
902 | public sealed class CovRQIso : Symbol {
|
---|
903 | [Storable]
|
---|
904 | public double MinSigma { get; set; }
|
---|
905 | [Storable]
|
---|
906 | public double MaxSigma { get; set; }
|
---|
907 | [Storable]
|
---|
908 | public double SigmaShakingMu { get; set; }
|
---|
909 | [Storable]
|
---|
910 | public double SigmaShakingSigma { get; set; }
|
---|
911 | [Storable]
|
---|
912 | public double MinL { get; set; }
|
---|
913 | [Storable]
|
---|
914 | public double MaxL { get; set; }
|
---|
915 | [Storable]
|
---|
916 | public double LShakingMu { get; set; }
|
---|
917 | [Storable]
|
---|
918 | public double LShakingSigma { get; set; }
|
---|
919 | [Storable]
|
---|
920 | public double MinShape { get; set; }
|
---|
921 | [Storable]
|
---|
922 | public double MaxShape { get; set; }
|
---|
923 | [Storable]
|
---|
924 | public double ShapeShakingMu { get; set; }
|
---|
925 | [Storable]
|
---|
926 | public double ShapeShakingSigma { get; set; }
|
---|
927 |
|
---|
928 | public override int MinimumArity {
|
---|
929 | get { return 0; }
|
---|
930 | }
|
---|
931 | public override int MaximumArity {
|
---|
932 | get { return 0; }
|
---|
933 | }
|
---|
934 |
|
---|
935 | [StorableConstructor]
|
---|
936 | private CovRQIso(bool deserializing) : base(deserializing) { }
|
---|
937 | private CovRQIso(CovRQIso original, Cloner cloner)
|
---|
938 | : base(original, cloner) {
|
---|
939 | MinSigma = original.MinSigma;
|
---|
940 | MaxSigma = original.MaxSigma;
|
---|
941 | SigmaShakingMu = original.SigmaShakingMu;
|
---|
942 | SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
943 | MinL = original.MinL;
|
---|
944 | MaxL = original.MaxL;
|
---|
945 | LShakingMu = original.LShakingMu;
|
---|
946 | LShakingSigma = original.LShakingSigma;
|
---|
947 | MinShape = original.MinShape;
|
---|
948 | MaxShape = original.MaxShape;
|
---|
949 | ShapeShakingMu = original.ShapeShakingMu;
|
---|
950 | ShapeShakingSigma = original.ShapeShakingSigma;
|
---|
951 | }
|
---|
952 |
|
---|
953 | public CovRQIso()
|
---|
954 | : base("CovRQIso", "Rational quadratic covariance function") {
|
---|
955 | MinSigma = 1.0;
|
---|
956 | MaxSigma = 100.0;
|
---|
957 | SigmaShakingMu = 1.0;
|
---|
958 | SigmaShakingSigma = 1.0;
|
---|
959 | MinL = 1.0;
|
---|
960 | MaxL = 100.0;
|
---|
961 | LShakingMu = 1.0;
|
---|
962 | LShakingSigma = 1.0;
|
---|
963 | MinShape = 1.0;
|
---|
964 | MaxShape = 100.0;
|
---|
965 | ShapeShakingMu = 1.0;
|
---|
966 | ShapeShakingSigma = 1.0;
|
---|
967 | }
|
---|
968 | [StorableHook(HookType.AfterDeserialization)]
|
---|
969 | private void AfterDeserialization() {
|
---|
970 | }
|
---|
971 |
|
---|
972 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
973 | return new CovRQisoTreeNode(this);
|
---|
974 | }
|
---|
975 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
976 | return new CovRQIso(this, cloner);
|
---|
977 | }
|
---|
978 | }
|
---|
979 | #endregion
|
---|
980 |
|
---|
981 | #region covariance function functions
|
---|
982 | [StorableClass]
|
---|
983 | public sealed class CovSum : Symbol {
|
---|
984 | public override int MinimumArity {
|
---|
985 | get { return 3; }
|
---|
986 | }
|
---|
987 | public override int MaximumArity {
|
---|
988 | get { return 3; }
|
---|
989 | }
|
---|
990 |
|
---|
991 | [StorableConstructor]
|
---|
992 | private CovSum(bool deserializing) : base(deserializing) { }
|
---|
993 | private CovSum(CovSum original, Cloner cloner)
|
---|
994 | : base(original, cloner) {
|
---|
995 | }
|
---|
996 |
|
---|
997 | public CovSum()
|
---|
998 | : base("CovSum", "Sum of two covariance functions") {
|
---|
999 | }
|
---|
1000 | [StorableHook(HookType.AfterDeserialization)]
|
---|
1001 | private void AfterDeserialization() {
|
---|
1002 | }
|
---|
1003 |
|
---|
1004 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
1005 | return new CovSum(this, cloner);
|
---|
1006 | }
|
---|
1007 | }
|
---|
1008 | [StorableClass]
|
---|
1009 | public sealed class CovProd : Symbol {
|
---|
1010 | public override int MinimumArity {
|
---|
1011 | get { return 3; }
|
---|
1012 | }
|
---|
1013 | public override int MaximumArity {
|
---|
1014 | get { return 3; }
|
---|
1015 | }
|
---|
1016 |
|
---|
1017 | [StorableConstructor]
|
---|
1018 | private CovProd(bool deserializing) : base(deserializing) { }
|
---|
1019 | private CovProd(CovProd original, Cloner cloner)
|
---|
1020 | : base(original, cloner) {
|
---|
1021 | }
|
---|
1022 |
|
---|
1023 | public CovProd()
|
---|
1024 | : base("CovProd", "Product of two covariance functions") {
|
---|
1025 | }
|
---|
1026 | [StorableHook(HookType.AfterDeserialization)]
|
---|
1027 | private void AfterDeserialization() {
|
---|
1028 | }
|
---|
1029 |
|
---|
1030 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
1031 | return new CovProd(this, cloner);
|
---|
1032 | }
|
---|
1033 | }
|
---|
1034 | [StorableClass]
|
---|
1035 | public sealed class CovScale : Symbol {
|
---|
1036 | [Storable]
|
---|
1037 | public double AlphaMu { get; set; }
|
---|
1038 | [Storable]
|
---|
1039 | public double AlphaSigma { get; set; }
|
---|
1040 | [Storable]
|
---|
1041 | public double AlphaShakingMu { get; set; }
|
---|
1042 | [Storable]
|
---|
1043 | public double AlphaShakingSigma { get; set; }
|
---|
1044 |
|
---|
1045 | public override int MinimumArity {
|
---|
1046 | get { return 1; }
|
---|
1047 | }
|
---|
1048 | public override int MaximumArity {
|
---|
1049 | get { return 1; }
|
---|
1050 | }
|
---|
1051 |
|
---|
1052 | [StorableConstructor]
|
---|
1053 | private CovScale(bool deserializing) : base(deserializing) { }
|
---|
1054 | private CovScale(CovScale original, Cloner cloner)
|
---|
1055 | : base(original, cloner) {
|
---|
1056 | AlphaMu = original.AlphaMu;
|
---|
1057 | AlphaSigma = original.AlphaSigma;
|
---|
1058 | AlphaShakingMu = original.AlphaShakingMu;
|
---|
1059 | AlphaShakingSigma = original.AlphaShakingSigma;
|
---|
1060 | }
|
---|
1061 |
|
---|
1062 | public CovScale()
|
---|
1063 | : base("CovScale", "Scale a covariance function") {
|
---|
1064 | AlphaMu = 0.0;
|
---|
1065 | AlphaSigma = 1.0;
|
---|
1066 | AlphaShakingMu = 1.0;
|
---|
1067 | AlphaShakingSigma = 0.1;
|
---|
1068 | }
|
---|
1069 | [StorableHook(HookType.AfterDeserialization)]
|
---|
1070 | private void AfterDeserialization() {
|
---|
1071 | }
|
---|
1072 |
|
---|
1073 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
1074 | return new CovScaleTreeNode(this);
|
---|
1075 | }
|
---|
1076 |
|
---|
1077 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
1078 | return new CovScale(this, cloner);
|
---|
1079 | }
|
---|
1080 | }
|
---|
1081 | [StorableClass]
|
---|
1082 | public sealed class CovMask : Symbol, IDimensionSymbol {
|
---|
1083 | [Storable]
|
---|
1084 | public double MaskingProbability { get; set; }
|
---|
1085 |
|
---|
1086 | public override int MinimumArity {
|
---|
1087 | get { return 1; }
|
---|
1088 | }
|
---|
1089 | public override int MaximumArity {
|
---|
1090 | get { return 1; }
|
---|
1091 | }
|
---|
1092 | [Storable]
|
---|
1093 | public int Dimension { get; set; }
|
---|
1094 |
|
---|
1095 | [StorableConstructor]
|
---|
1096 | private CovMask(bool deserializing) : base(deserializing) { }
|
---|
1097 | private CovMask(CovMask original, Cloner cloner)
|
---|
1098 | : base(original, cloner) {
|
---|
1099 | this.Dimension = original.Dimension;
|
---|
1100 | this.MaskingProbability = original.MaskingProbability;
|
---|
1101 | }
|
---|
1102 |
|
---|
1103 | public CovMask(int dimension)
|
---|
1104 | : base("CovMask", "Mask some dimensions of the data") {
|
---|
1105 | this.Dimension = dimension;
|
---|
1106 | MaskingProbability = 0.2;
|
---|
1107 | }
|
---|
1108 | [StorableHook(HookType.AfterDeserialization)]
|
---|
1109 | private void AfterDeserialization() {
|
---|
1110 | }
|
---|
1111 |
|
---|
1112 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
1113 | return new CovMaskTreeNode(this);
|
---|
1114 | }
|
---|
1115 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
1116 | return new CovMask(this, cloner);
|
---|
1117 | }
|
---|
1118 | }
|
---|
1119 | #endregion
|
---|
1120 |
|
---|
1121 | #region likelihood functions
|
---|
1122 | [StorableClass]
|
---|
1123 | public sealed class LikGauss : Symbol {
|
---|
1124 | [Storable]
|
---|
1125 | public double MinSigma { get; set; }
|
---|
1126 | [Storable]
|
---|
1127 | public double MaxSigma { get; set; }
|
---|
1128 | [Storable]
|
---|
1129 | public double SigmaShakingMu { get; set; }
|
---|
1130 | [Storable]
|
---|
1131 | public double SigmaShakingSigma { get; set; }
|
---|
1132 |
|
---|
1133 | public override int MinimumArity {
|
---|
1134 | get { return 0; }
|
---|
1135 | }
|
---|
1136 | public override int MaximumArity {
|
---|
1137 | get { return 0; }
|
---|
1138 | }
|
---|
1139 |
|
---|
1140 | [StorableConstructor]
|
---|
1141 | private LikGauss(bool deserializing) : base(deserializing) { }
|
---|
1142 | private LikGauss(LikGauss original, Cloner cloner)
|
---|
1143 | : base(original, cloner) {
|
---|
1144 | this.MinSigma = original.MinSigma;
|
---|
1145 | this.MaxSigma = original.MaxSigma;
|
---|
1146 | this.SigmaShakingMu = original.SigmaShakingMu;
|
---|
1147 | this.SigmaShakingSigma = original.SigmaShakingSigma;
|
---|
1148 | }
|
---|
1149 |
|
---|
1150 | public LikGauss()
|
---|
1151 | : base("LikGauss", "Gaussian likelihood function") {
|
---|
1152 | MinSigma = Math.Log(0.00001);
|
---|
1153 | MaxSigma = Math.Log(100);
|
---|
1154 | SigmaShakingMu = 1.0;
|
---|
1155 | SigmaShakingSigma = 0.1;
|
---|
1156 | }
|
---|
1157 | [StorableHook(HookType.AfterDeserialization)]
|
---|
1158 | private void AfterDeserialization() {
|
---|
1159 | }
|
---|
1160 |
|
---|
1161 | public override ISymbolicExpressionTreeNode CreateTreeNode() {
|
---|
1162 | return new LikGaussTreeNode(this);
|
---|
1163 | }
|
---|
1164 |
|
---|
1165 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
1166 | return new LikGauss(this, cloner);
|
---|
1167 | }
|
---|
1168 | }
|
---|
1169 | #endregion
|
---|
1170 | }
|
---|