-
Notifications
You must be signed in to change notification settings - Fork 11
/
salustowicz1d_config.m
61 lines (54 loc) · 1.85 KB
/
salustowicz1d_config.m
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
function gp=salustowicz1d_config(gp)
%SALUSTOWICZ1D_CONFIG Multigene regression config for one dimensional Salustowicz function.
%
% GP = SALUSTOWICZ1D_CONFIG(GP) generates a parameter structure GP that
% specifies the GPTIPS run settings for the one dimensional Salustowicz
% function . This is a function f of a single input variable as follows:
%
% f(x) = exp(-x) x^3 cos(x) sin(x) (sin(x)^2 cos(x) - 1)
%
% Example:
%
% GP = RUNGP(@SALUSTOWICZ1D_CONFIG) uses this configuration file to
% perform symbolic regression on the data with multigene individuals.
%
% Note:
%
% The settings in this file are not intended to be 'optimal'. Feel free
% to experiment with them.
%
% Copyright (c) 2009-2015 Dominic Searson
%
% GPTIPS 2
%
% See also RIPPLE_CONFIG, UBALL_CONFIG, CUBIC_CONFIG,
% REGRESSMULTI_FITFUN, RUNGP
%run control
gp.runcontrol.pop_size = 200;
gp.runcontrol.timeout = 30;
gp.runcontrol.num_gen = 500;
gp.runcontrol.runs = 3;
gp.runcontrol.parallel.auto = true;
%selection
gp.selection.tournament.size = 20;
gp.selection.tournament.p_pareto = 0.3;
gp.selection.elite_fraction = 0.3;
%meta data
gp.userdata.name = 'Salustowicz - 1D';
%genes
gp.genes.max_genes = 6;
%generate training data
x = [0.05:0.2:10]'; %generate training points in range [0.05 10]
gp.userdata.xtrain = x;
sx = sin(x);
cx = cos(x);
gp.userdata.ytrain = exp(-x) .* (x.^3) .*sx .* cx .* ((sx.^2) .*cx -1);
%generate random test data in same range
x = rand(500,1) * 9.95 + 0.05;
sx = sin(x);
cx = cos(x);
gp.userdata.ytest = exp(-x) .* (x.^3) .*sx .* cx .* ((sx.^2) .*cx -1);
gp.userdata.xtest = x;
%function nodes
gp.nodes.functions.name = {'times','minus','plus','rdivide','square','sin',...
'cos','exp','power','cube','sqrt','add3','mult3','negexp','neg','abs'};