Changeset 9387


Ignore:
Timestamp:
04/22/13 07:10:13 (7 years ago)
Author:
gkronber
Message:

#1967: added CovNN symbol and tree node

Location:
branches/HeuristicLab.Problems.GaussianProcessTuning
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GaussianProcessTuning/GaussianProcessDemo/Form1.cs

    r9338 r9387  
    2828
    2929      var sum = new CovarianceSum();
    30       var t = new CovarianceSquaredExponentialIso();
    31       t.InverseLengthParameter.Value = new DoubleValue(1.0 / Math.Exp(-2));
     30      var t = new CovarianceNeuralNetwork();
    3231      sum.Terms.Add(t);
    3332      sum.Terms.Add(new CovarianceNoise());
     
    6564    private void UpdateChart() {
    6665      var hyp = GetSliderValues();
    67       var cov = covFunction.GetParameterizedCovarianceFunction(hyp, null);
     66      var cov = covFunction.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, data.Count));
    6867      var y = Util.SampleGaussianProcess(random, cov, data, alpha);
    6968
  • branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Grammar.cs

    r9212 r9387  
    5858      var covRQard = new CovRQArd(Dimension);
    5959      var covRQiso = new CovRQIso();
     60      var covNN = new CovNn();
    6061      var covMatern1 = new CovMatern(1);
    6162      covMatern1.Name = "CovMatern1";
     
    100101                            covMatern3,
    101102                            covMatern5,
     103                            covNN,
    102104                            covPeriodic,
    103105                            covPeriodic1,
     
    160162                            covMatern3,
    161163                            covMatern5,
     164                            covNN,
    162165                            covPeriodic,
    163166                            covPeriodic1,
     
    168171        }
    169172      }
    170 
    171173    }
    172174
  • branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Interpreter.cs

    r9212 r9387  
    109109      } else if (node.Symbol is CovRQArd) {
    110110        return new CovarianceRationalQuadraticArd();
     111      } else if (node.Symbol is CovNn) {
     112        return new CovarianceNeuralNetwork();
    111113      } else if (node.Symbol is CovPeriodic) {
    112114        return new CovariancePeriodic();
  • branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Symbols.cs

    r9212 r9387  
    502502    }
    503503  }
     504  [StorableClass]
     505  public sealed class CovNn : Symbol {
     506    public override int MinimumArity {
     507      get { return 0; }
     508    }
     509    public override int MaximumArity {
     510      get { return 0; }
     511    }
     512
     513    [StorableConstructor]
     514    private CovNn(bool deserializing) : base(deserializing) { }
     515    private CovNn(CovNn original, Cloner cloner)
     516      : base(original, cloner) {
     517    }
     518
     519    public CovNn()
     520      : base("CovNn", "neural network covariance function") {
     521    }
     522    [StorableHook(HookType.AfterDeserialization)]
     523    private void AfterDeserialization() {
     524    }
     525
     526    public override ISymbolicExpressionTreeNode CreateTreeNode() {
     527      return new CovNnTreeNode(this);
     528    }
     529    public override IDeepCloneable Clone(Cloner cloner) {
     530      return new CovNn(this, cloner);
     531    }
     532  }
    504533
    505534  [StorableClass]
  • branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/TreeNodes.cs

    r9212 r9387  
    228228  }
    229229  [StorableClass]
     230  public sealed class CovNnTreeNode : SymbolicExpressionTreeTerminalNode {
     231    public new CovNn Symbol { get { return (CovNn)base.Symbol; } }
     232
     233    [StorableConstructor]
     234    private CovNnTreeNode(bool deserializing) : base(deserializing) { }
     235    private CovNnTreeNode(CovNnTreeNode original, Cloner cloner)
     236      : base(original, cloner) {
     237    }
     238
     239    public CovNnTreeNode(CovNn symbol)
     240      : base(symbol) {
     241    }
     242
     243    [StorableHook(HookType.AfterDeserialization)]
     244    private void AfterDeserialization() {
     245    }
     246    public override IDeepCloneable Clone(Cloner cloner) {
     247      return new CovNnTreeNode(this, cloner);
     248    }
     249  }
     250  [StorableClass]
    230251  public sealed class CovMaternTreeNode : SymbolicExpressionTreeTerminalNode {
    231252    public new CovMatern Symbol { get { return (CovMatern)base.Symbol; } }
Note: See TracChangeset for help on using the changeset viewer.