Skip to content

Commit 54fc790

Browse files
fix: Unit tests with retries
1 parent 4c0fcf0 commit 54fc790

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/recurrent/lstm-time-step.end-to-end.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LSTMTimeStep } from './lstm-time-step';
2-
2+
jest.retryTimes(3);
33
describe('LSTMTimeStep', () => {
44
it('can learn xor', () => {
55
const net = new LSTMTimeStep({

src/recurrent/lstm.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,14 @@ describe('LSTM', () => {
108108
it('can output same as run method', () => {
109109
const dataFormatter = new DataFormatter(['h', 'i', ' ', 'm', 'o', '!']);
110110
const net = new LSTM({
111-
inputSize: 7,
111+
inputSize: 1,
112112
inputRange: dataFormatter.characters.length,
113-
outputSize: 7,
113+
outputSize: 1,
114114
dataFormatter,
115115
});
116116
net.initialize();
117117
for (let i = 0; i < 100; i++) {
118118
net.trainPattern(dataFormatter.toIndexes('hi mom!'));
119-
// if (i % 10) {
120-
// console.log(dataFormatter.toCharacters(net.run()).join(''));
121-
// }
122119
}
123120

124121
const lastOutput = net.run();
@@ -187,7 +184,7 @@ describe('LSTM', () => {
187184
output: 'other',
188185
},
189186
];
190-
net.train(trainingData, { iterations: 200 });
187+
net.train(trainingData, { iterations: 100 });
191188
expect(net.run([transactionTypes.credit])).toBe('credit');
192189
expect(net.run([transactionTypes.debit])).toBe('debit');
193190
expect(net.run([transactionTypes.personalCard])).toBe('personal card');

0 commit comments

Comments
 (0)