//1. 产生一些测试数据, 如果提前有x,y数据,可以不使用下面代码 x1 = Rand(1.2, 100, 1); x2 = Rand(1.2, 100, 1); y1 = Abs(Sin(Sin(x1) * Cos(x2) * x1 * 1.6 + (x2 - x1)^2 * 1.5)); y2 = (Cos(Sin(x1) * Cos(x2) * x2 * 2.6 + (x2 - x1)^2 * 0.5)); x = [x1, x2]; y = [y1, y2]; //2. 下面是神经网络代码 inputlayer = NetCreateLayer("", 2); outputlayer = NetCreateConnectLayer(inputlayer, "GElU", 6, "SQNL", 4, "Mish", 2); net = NetCreateWork(); NetWorkInit(net, inputlayer, outputlayer); solver = NetCreateSolver("RAdma", 0.1); opt = NetCreateOptimier(); NetOptSetBatchNum(opt, 32); NetOptSetIterCount(opt, 1024000); NetOptSetEvalBySquaredError(opt, 1e-12); NetOptSetEvalCount(opt, 16); NetOptSetPreprocess(opt, 255); NetOptSetSolver(opt, solver); NetOptSetWork(opt, net); NetOptSetTrainData(opt, x, y); NetOptSetEvalData(opt, x, y); NetOptSolve(opt, 1000);