Adding DISFA trained models.
This commit is contained in:
parent
84320b93a9
commit
5960fb91d7
101 changed files with 159 additions and 2 deletions
exe/releases
matlab_version/AU_training/experiments/DISFA
Script_HOG_SVM_train_dyn.mScript_HOG_SVM_train_stat.mScript_HOG_SVR_train_dyn.mScript_HOG_SVR_train_stat.m
classifiers
AU_12_dyn.datAU_12_dyn.matAU_12_stat.datAU_12_stat.matAU_15_dyn.datAU_15_dyn.matAU_15_stat.datAU_15_stat.matAU_17_dyn.datAU_17_dyn.matAU_17_stat.datAU_17_stat.matAU_1_dyn.datAU_1_dyn.matAU_1_stat.datAU_1_stat.matAU_20_dyn.datAU_20_dyn.matAU_20_stat.datAU_20_stat.matAU_25_dyn.datAU_25_dyn.matAU_25_stat.datAU_25_stat.matAU_26_dyn.datAU_26_dyn.matAU_26_stat.datAU_26_stat.matAU_2_dyn.datAU_2_dyn.matAU_2_stat.datAU_2_stat.matAU_4_dyn.datAU_4_dyn.matAU_4_stat.datAU_4_stat.matAU_5_dyn.datAU_5_dyn.matAU_5_stat.datAU_5_stat.matAU_6_dyn.datAU_6_dyn.matAU_6_stat.datAU_6_stat.matAU_9_dyn.datAU_9_dyn.matAU_9_stat.datAU_9_stat.mat
regressors
AU_12_dyn_intensity.matAU_12_dynamic_intensity.datAU_12_static_intensity.datAU_12_static_intensity.matAU_15_dyn_intensity.matAU_15_dynamic_intensity.datAU_15_static_intensity.datAU_15_static_intensity.matAU_17_dyn_intensity.matAU_17_dynamic_intensity.datAU_17_static_intensity.datAU_17_static_intensity.matAU_1_dyn_intensity.matAU_1_dynamic_intensity.datAU_1_static_intensity.datAU_1_static_intensity.matAU_20_dyn_intensity.matAU_20_dynamic_intensity.datAU_20_static_intensity.datAU_20_static_intensity.matAU_25_dyn_intensity.matAU_25_dynamic_intensity.datAU_25_static_intensity.datAU_25_static_intensity.matAU_26_dyn_intensity.matAU_26_dynamic_intensity.datAU_26_static_intensity.datAU_26_static_intensity.matAU_2_dyn_intensity.matAU_2_dynamic_intensity.datAU_2_static_intensity.datAU_2_static_intensity.matAU_4_dyn_intensity.matAU_4_dynamic_intensity.datAU_4_static_intensity.datAU_4_static_intensity.matAU_5_dyn_intensity.matAU_5_dynamic_intensity.datAU_5_static_intensity.datAU_5_static_intensity.matAU_6_dyn_intensity.matAU_6_dynamic_intensity.datAU_6_static_intensity.datAU_6_static_intensity.matAU_9_dyn_intensity.matAU_9_dynamic_intensity.datAU_9_static_intensity.dat
|
@ -1,5 +1,5 @@
|
|||
clear;
|
||||
version = '0.4.1';
|
||||
version = '1.0.0';
|
||||
|
||||
out_x86 = sprintf('OpenFace_%s_win_x86', version);
|
||||
out_x64 = sprintf('OpenFace_%s_win_x64', version);
|
||||
|
|
|
@ -53,4 +53,14 @@ for a=1:numel(aus)
|
|||
|
||||
save(name, 'model', 'accuracies', 'F1s', 'corrs', 'rms', 'ccc', 'prediction', 'valid_labels');
|
||||
|
||||
name = sprintf('classifiers/AU_%d_dyn.dat', au);
|
||||
|
||||
pos_lbl = model.Label(1);
|
||||
neg_lbl = model.Label(2);
|
||||
|
||||
w = model.w(1:end-1)';
|
||||
b = model.w(end);
|
||||
|
||||
svs = bsxfun(@times, PC, 1./scaling') * w;
|
||||
write_lin_svm(name, means, svs, b, pos_lbl, neg_lbl);
|
||||
end
|
|
@ -51,6 +51,17 @@ for a=1:numel(aus)
|
|||
|
||||
[ accuracies, F1s, corrs, ccc, rms, classes ] = evaluate_regression_results( prediction, valid_labels );
|
||||
|
||||
save(name, 'model', 'accuracies', 'F1s', 'corrs', 'rms', 'ccc', 'prediction', 'valid_labels');
|
||||
save(name, 'model', 'accuracies', 'F1s', 'corrs', 'rms', 'ccc', 'prediction', 'valid_labels');
|
||||
|
||||
name = sprintf('classifiers/AU_%d_stat.dat', au);
|
||||
|
||||
pos_lbl = model.Label(1);
|
||||
neg_lbl = model.Label(2);
|
||||
|
||||
w = model.w(1:end-1)';
|
||||
b = model.w(end);
|
||||
|
||||
svs = bsxfun(@times, PC, 1./scaling') * w;
|
||||
write_lin_svm(name, means, svs, b, pos_lbl, neg_lbl);
|
||||
|
||||
end
|
|
@ -0,0 +1,68 @@
|
|||
% Change to your downloaded location
|
||||
clear
|
||||
addpath('C:\liblinear\matlab')
|
||||
addpath('../training_code')
|
||||
addpath('../utilities')
|
||||
|
||||
%% load shared definitions and AU data
|
||||
shared_defs;
|
||||
|
||||
% Set up the hyperparameters to be validated
|
||||
hyperparams.c = 10.^(-7:1:3);
|
||||
hyperparams.p = 10.^(-2);
|
||||
|
||||
hyperparams.validate_params = {'c', 'p'};
|
||||
|
||||
% Set the training function
|
||||
svr_train = @svr_train_linear_shift;
|
||||
|
||||
% Set the test function (the first output will be used for validation)
|
||||
svr_test = @svr_test_linear_shift;
|
||||
|
||||
%%
|
||||
for a=1:numel(aus)
|
||||
|
||||
au = aus(a);
|
||||
|
||||
rest_aus = setdiff(all_aus, au);
|
||||
|
||||
% make sure validation data's labels are balanced
|
||||
[users_train, users_valid] = get_balanced_fold(DISFA_dir, users, au, 1/4, 1);
|
||||
|
||||
% need to split the rest
|
||||
[train_samples, train_labels, valid_samples, valid_labels, ~, PC, means, scaling, valid_ids, valid_success] = Prepare_HOG_AU_data_generic_dynamic(users_train, users_valid, au, rest_aus, DISFA_dir, hog_data_dir);
|
||||
|
||||
train_samples = sparse(train_samples);
|
||||
valid_samples = sparse(valid_samples);
|
||||
|
||||
%% Validate here
|
||||
hyperparams.success = valid_success;
|
||||
hyperparams.valid_samples = valid_samples;
|
||||
hyperparams.valid_labels = valid_labels;
|
||||
hyperparams.vid_ids = valid_ids;
|
||||
|
||||
[ best_params, ~ ] = validate_grid_search_no_par(svr_train, svr_test, false, train_samples, train_labels, valid_samples, valid_labels, hyperparams);
|
||||
|
||||
model = svr_train(train_labels, train_samples, best_params);
|
||||
model.success = valid_success;
|
||||
model.vid_ids = valid_ids;
|
||||
|
||||
[~, prediction] = svr_test(valid_labels, valid_samples, model);
|
||||
|
||||
name = sprintf('regressors/AU_%d_dyn_intensity.mat', au);
|
||||
|
||||
[ accuracies, F1s, corrs, ccc, rms, classes ] = evaluate_regression_results( prediction, valid_labels );
|
||||
|
||||
save(name, 'model', 'accuracies', 'F1s', 'corrs', 'rms', 'ccc', 'prediction', 'valid_labels');
|
||||
|
||||
% Write out the model
|
||||
name = sprintf('regressors/AU_%d_dynamic_intensity.dat', au);
|
||||
|
||||
w = model.w(1:end-1)';
|
||||
b = model.w(end);
|
||||
|
||||
svs = bsxfun(@times, PC, 1./scaling') * w;
|
||||
|
||||
write_lin_dyn_svr(name, means, svs, b, model.cutoff);
|
||||
|
||||
end
|
|
@ -0,0 +1,68 @@
|
|||
% Change to your downloaded location
|
||||
clear
|
||||
addpath('C:\liblinear\matlab')
|
||||
addpath('../training_code')
|
||||
addpath('../utilities')
|
||||
|
||||
%% load shared definitions and AU data
|
||||
shared_defs;
|
||||
|
||||
% Set up the hyperparameters to be validated
|
||||
hyperparams.c = 10.^(-7:1:3);
|
||||
hyperparams.p = 10.^(-2);
|
||||
|
||||
hyperparams.validate_params = {'c', 'p'};
|
||||
|
||||
% Set the training function
|
||||
svr_train = @svr_train_linear;
|
||||
|
||||
% Set the test function (the first output will be used for validation)
|
||||
svr_test = @svr_test_linear;
|
||||
|
||||
%%
|
||||
for a=1:numel(aus)
|
||||
|
||||
au = aus(a);
|
||||
|
||||
rest_aus = setdiff(all_aus, au);
|
||||
|
||||
% make sure validation data's labels are balanced
|
||||
[users_train, users_valid] = get_balanced_fold(DISFA_dir, users, au, 1/4, 1);
|
||||
|
||||
% need to split the rest
|
||||
[train_samples, train_labels, valid_samples, valid_labels, ~, PC, means, scaling, valid_ids, valid_success] = Prepare_HOG_AU_data_generic(users_train, users_valid, au, rest_aus, DISFA_dir, hog_data_dir);
|
||||
|
||||
train_samples = sparse(train_samples);
|
||||
valid_samples = sparse(valid_samples);
|
||||
|
||||
%% Validate here
|
||||
hyperparams.success = valid_success;
|
||||
hyperparams.valid_samples = valid_samples;
|
||||
hyperparams.valid_labels = valid_labels;
|
||||
hyperparams.vid_ids = valid_ids;
|
||||
|
||||
[ best_params, ~ ] = validate_grid_search_no_par(svr_train, svr_test, false, train_samples, train_labels, valid_samples, valid_labels, hyperparams);
|
||||
|
||||
model = svr_train(train_labels, train_samples, best_params);
|
||||
model.success = valid_success;
|
||||
model.vid_ids = valid_ids;
|
||||
|
||||
[~, prediction] = svr_test(valid_labels, valid_samples, model);
|
||||
|
||||
name = sprintf('regressors/AU_%d_static_intensity.mat', au);
|
||||
|
||||
[ accuracies, F1s, corrs, ccc, rms, classes ] = evaluate_regression_results( prediction, valid_labels );
|
||||
|
||||
save(name, 'model', 'accuracies', 'F1s', 'corrs', 'rms', 'ccc', 'prediction', 'valid_labels');
|
||||
|
||||
% Write out the model
|
||||
name = sprintf('regressors/AU_%d_static_intensity.dat', au);
|
||||
|
||||
w = model.w(1:end-1)';
|
||||
b = model.w(end);
|
||||
|
||||
svs = bsxfun(@times, PC, 1./scaling') * w;
|
||||
|
||||
write_lin_svr(name, means, svs, b);
|
||||
|
||||
end
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue