Skip to content

Commit 6df2beb

Browse files
committed
test: Fix wrong normalization
Always used default meanstd normalization, not what was in settings
1 parent 2a92235 commit 6df2beb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

microesc/features.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def predict_voted(settings, model, samples, loader, method='mean', overlap=0.5):
194194
windows = load_windows(sample, settings, loader, overlap=overlap)
195195
inputs = numpy.stack(windows)
196196

197+
#print(f'predict_voted {numpy.mean(inputs):.2f} {numpy.std(inputs):.2f}')
198+
197199
predictions = model.predict(inputs)
198200
if method == 'mean':
199201
p = numpy.mean(predictions, axis=0)

microesc/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ def main():
203203

204204
def load_sample(sample):
205205
return features.load_sample(sample, settings, start_time=sample.start,
206-
window_frames=frames, feature_dir=args.features_dir)
206+
window_frames=frames, feature_dir=args.features_dir,
207+
normalize=exsettings['normalize'])
207208

208209
def predict(model, data):
209210
return features.predict_voted(exsettings, model, data, loader=load_sample,

0 commit comments

Comments
 (0)