MCPcopy
hub / github.com/tensorflow/playground / reset

Function reset

src/playground.ts:940–964  ·  view source on GitHub ↗
(onStartup=false)

Source from the content-addressed store, hash-verified

938}
939
940function 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
966function initTutorial() {
967 if (state.tutorial == null || state.tutorial === '' || state.hideText) {

Callers 4

makeGUIFunction · 0.85
drawNodeFunction · 0.85
addPlusMinusControlFunction · 0.85
playground.tsFile · 0.85

Calls 9

userHasInteractedFunction · 0.85
constructInputFunction · 0.85
constructInputIdsFunction · 0.85
getLossFunction · 0.85
drawNetworkFunction · 0.85
updateUIFunction · 0.85
resetMethod · 0.80
serializeMethod · 0.80
pauseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…