(onStartup=false)
| 938 | } |
| 939 | |
| 940 | function reset(onStartup=false) { |
| 941 | lineChart.reset(); |
| 942 | state.serialize(); |
| 943 | if (!onStartup) { |
| 944 | userHasInteracted(); |
| 945 | } |
| 946 | player.pause(); |
| 947 | |
| 948 | let suffix = state.numHiddenLayers !== 1 ? "s" : ""; |
| 949 | d3.select("#layers-label").text("Hidden layer" + suffix); |
| 950 | d3.select("#num-layers").text(state.numHiddenLayers); |
| 951 | |
| 952 | // Make a simple network. |
| 953 | iter = 0; |
| 954 | let numInputs = constructInput(0 , 0).length; |
| 955 | let shape = [numInputs].concat(state.networkShape).concat([1]); |
| 956 | let outputActivation = (state.problem === Problem.REGRESSION) ? |
| 957 | nn.Activations.LINEAR : nn.Activations.TANH; |
| 958 | network = nn.buildNetwork(shape, state.activation, outputActivation, |
| 959 | state.regularization, constructInputIds(), state.initZero); |
| 960 | lossTrain = getLoss(network, trainData); |
| 961 | lossTest = getLoss(network, testData); |
| 962 | drawNetwork(network); |
| 963 | updateUI(true); |
| 964 | }; |
| 965 | |
| 966 | function initTutorial() { |
| 967 | if (state.tutorial == null || state.tutorial === '' || state.hideText) { |
no test coverage detected
searching dependent graphs…