public toolbox(dataSet X, bool train = true) { if (train)//to train { _X = X; _fGene = new featureGenerator(X); _model = new model(X, _fGene); _inf = new inference(this); _grad = new gradient(this); initOptimizer(); } else//to test { _X = X; _model = new model(Global.fModel); _fGene = new featureGenerator(X); _inf = new inference(this); _grad = new gradient(this); } }
public gradient(toolbox tb) { _optim = tb.Optim; _inf = tb.Inf; _fGene = tb.FGene; }