ctbn_gradient_structure_learning_dims_greedy.m 872 Bytes
Newer Older
dlinzner-bcs's avatar
dlinzner-bcs committed
1
2
3
4
5
6
function [] = ctbn_gradient_structure_learning_dims_greedy(name,mworkers,K)
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
load('params.mat');
load('data.mat');

dlinzner-bcs's avatar
dlinzner-bcs committed
7
prior.graph=prior_graph;
dlinzner-bcs's avatar
dlinzner-bcs committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
prior.pi=1;
prior.alpha=alph;
prior.beta=bet;

node=createMotherCTBN_DIMS_K(L,prior,states,K);
[node]=genGammaPriorRatesD_single(node);

delete(gcp('nocreate'))
parpool(mworkers);

for m=1:MAX_SWEEPS
    for k=1:MAX_ITER
        [MU,RHO,node] = ctbn_expectation_sparse_reg_par_DIMS_greedy(node,dt,M,t0,DATAC,time0,thresh);
        f(k)=marg_llh_sparse_reg_DIMS_greedy(node,dt,MU,RHO,DATAC,time0)
    end
    F(m) = marg_llh_sparse_reg_DIMS_greedy(node,dt,MU,RHO,DATAC,time0)
dlinzner-bcs's avatar
dlinzner-bcs committed
24
    [node,~] = estimate_pi_sparse_reg_par_DIMS_grad(node,lam,MAX_RESTARTS);
dlinzner-bcs's avatar
dlinzner-bcs committed
25
26
27
    
    C=extract_net_prob(node)
    Nodem{m}=node;
dlinzner-bcs's avatar
dlinzner-bcs committed
28
    save(name,'node','Nodem','C','F')
dlinzner-bcs's avatar
dlinzner-bcs committed
29
30
31
32
end


end