1
1
2
2
3
- /**
4
- * @license
5
- * Copyright 2018 Google LLC. All Rights Reserved.
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- * =============================================================================
18
- */
19
3
import * as tf from '@tensorflow/tfjs' ;
20
4
import * as tfvis from '@tensorflow/tfjs-vis' ;
21
5
import Plotly from 'plotly.js-dist' ;
22
-
23
- import * as data from './data' ;
6
+ import * as data from './data' ;
24
7
25
8
26
9
@@ -44,8 +27,19 @@ import Plotly from 'plotly.js-dist';
44
27
var xte_a = Array ( ) ;
45
28
var yte_a = Array ( ) ;
46
29
47
- document . getElementById ( 'show-nn-architecture' )
48
- . addEventListener ( 'click' , async ( ) => {
30
+
31
+ var load = document . getElementById ( "loader" ) ;
32
+ load . style . fontSize = "30px" ;
33
+ load . style . color = "black" ;
34
+ load . style . fontFamily = "monospace" ;
35
+ load . style . backgroundColor = "greenyellow" ;
36
+ var callback1 = function ( )
37
+ {
38
+ load . innerHTML = "Training......" ;
39
+ }
40
+
41
+ var callback2 = function ( )
42
+ {
49
43
xl = [ ] ; yl = [ ] ;
50
44
xtr_a = [ ] ; ytr_a = [ ] ;
51
45
xte_a = [ ] ; yte_a = [ ] ;
@@ -176,7 +170,6 @@ for(var e=0;e<iter;e++)
176
170
total_loss += value . arraySync ( ) ;
177
171
178
172
179
-
180
173
181
174
182
175
for ( var j = 0 ; j < layers ; j ++ )
@@ -576,6 +569,20 @@ tea.beginPath();
576
569
tea . font = "25px Arial" ;
577
570
tea . fillText ( "Test accuracy(30 egs) vs epoch => " , 5 , 20 ) ;
578
571
579
- } ) ;
572
+
573
+
574
+ load . innerHTML = "Model Trained" + String . fromCharCode ( 0xD83D , 0xDE04 ) ;
575
+
576
+ }
577
+
578
+
579
+ document . getElementById ( 'show-nn-architecture' )
580
+ . addEventListener ( 'click' , show ) ;
581
+
582
+ function show ( )
583
+ {
584
+ setTimeout ( callback1 , 1000 ) ;
585
+ setTimeout ( callback2 , 2000 ) ;
586
+ }
580
587
581
588
0 commit comments