-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (26 loc) · 1.81 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from libemg.datasets import *
from Models.MLP import MLP
from Models.MLPR import MLPR
from Models.AEMLP import AE_MLP
# Evaluate all classification datasets (LDA and MLP)
c_ds = list(get_dataset_list().keys())
evaluate('LDA', 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/lda.pkl')
evaluate(MLP(), 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/mlp.pkl', normalize_features=True)
# Evaluate all regression datasets (LR and MLPR)
c_ds = list(get_dataset_list(cross_user=True).keys())
evaluate_crossuser('LDA', 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/lda.pkl')
evaluate_crossuser(MLP(), 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/mlp.pkl', normalize_features=True)
# Evaluate all regression datasets (LR and MLPR)
c_ds = list(get_dataset_list().keys())
evaluate('LDA', 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/lr.pkl', regression=True)
evaluate(MLPR(), 200, 50, ['MAV','ZC','SSC','WL'], included_datasets=c_ds, output_file='Results/mlpr.pkl', normalize_features=True, regression=True)
# Evaluate cross-user EMG2POSE
ds = EMG2POSECU()
for m in ds.mapping.keys():
print(m)
if m == 'Unconstrained':
continue
evaluate_crossuser(MLPR(), 200, 50, feature_list=['MAV', 'ZC', 'SSC', 'WL'], metrics=['MSE', 'MAE'], output_file='Results/MetaResults/' + m + '_mlp.pkl', memory_efficient=True, included_datasets=[EMG2POSECU(stage=m)], regression=True, normalize_features=True)
# Evaluate weakly supervised dataset
mdl = AE_MLP(input_shape=32, latent_dims=16, num_classes=5, num_decoder_layers=3, num_encoder_layers=3)
evaluate_weaklysupervised(mdl, 300, 100, feature_list=['MAV','SSC','ZC','WL'], included_datasets=['CIIL_WeaklySupervised'], normalize_features=True)