open source pkg v1
This commit is contained in:
28
pkg/OpenFace/model_training/CCNF/CCRF/lib/getScaling.m
Normal file
28
pkg/OpenFace/model_training/CCNF/CCRF/lib/getScaling.m
Normal file
@@ -0,0 +1,28 @@
|
||||
function [ scaling ] = getScaling( alphas, betas, x, y, masks, PrecalcQ2s, useIndicator)
|
||||
%getScaling Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
|
||||
% for visualisation use only the first sequence
|
||||
nExamples = numel(x);
|
||||
|
||||
scalings = zeros(1,nExamples);
|
||||
|
||||
for q=1:nExamples
|
||||
|
||||
mask = masks{q};
|
||||
|
||||
PrecalcQ2 = PrecalcQ2s{q};
|
||||
SigmaInv = CalcSigmaCCRF(alphas, betas, PrecalcQ2, mask, useIndicator);
|
||||
|
||||
|
||||
b = CalcbCCRF(alphas, x{q}, mask, useIndicator);
|
||||
y_est = SigmaInv \ b;
|
||||
|
||||
sc = std(y{q}) / std(y_est);
|
||||
scalings(q) = sc;
|
||||
end
|
||||
|
||||
scaling = mean(scalings);
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user