File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ const DEFAULTS = {
18
18
temperature : 0.5 ,
19
19
} ;
20
20
21
- class LSTMGenerator {
22
- constructor ( modelPath = './' , callback = ( ) => { } ) {
21
+ class LSTM {
22
+ constructor ( modelPath , callback ) {
23
23
this . modelPath = modelPath ;
24
24
this . ready = false ;
25
25
this . indices_char = { } ;
@@ -58,7 +58,7 @@ class LSTMGenerator {
58
58
const indexTensor = tf . tidy ( ( ) => {
59
59
const input = this . convert ( seed ) ;
60
60
const prediction = this . model . predict ( input ) . squeeze ( ) ;
61
- return LSTMGenerator . sample ( prediction , this . temperature ) ;
61
+ return LSTM . sample ( prediction , this . temperature ) ;
62
62
} ) ;
63
63
const index = await indexTensor . data ( ) ;
64
64
indexTensor . dispose ( ) ;
@@ -99,4 +99,6 @@ class LSTMGenerator {
99
99
}
100
100
}
101
101
102
+ const LSTMGenerator = ( modelPath = './' , callback = ( ) => { } ) => new LSTM ( modelPath , callback ) ;
103
+
102
104
export default LSTMGenerator ;
You can’t perform that action at this time.
0 commit comments