diff options
| author | ziejd2 | 2021-02-24 15:19:03 -0600 |
|---|---|---|
| committer | ziejd2 | 2021-02-24 15:19:03 -0600 |
| commit | 1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0 (patch) | |
| tree | d4356879a9b0a3d44063a6b292ef0197173697af /sourcecodes/parameter_learning/modifyEdges.m | |
| parent | a2b306b10fb07f07c63235861ccfe460153e8609 (diff) | |
| download | BNW-1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0.tar.gz | |
Moving final GENENET8 version to master
Diffstat (limited to 'sourcecodes/parameter_learning/modifyEdges.m')
| -rw-r--r-- | sourcecodes/parameter_learning/modifyEdges.m | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sourcecodes/parameter_learning/modifyEdges.m b/sourcecodes/parameter_learning/modifyEdges.m index 6542d9fb..c435806a 100644 --- a/sourcecodes/parameter_learning/modifyEdges.m +++ b/sourcecodes/parameter_learning/modifyEdges.m @@ -58,7 +58,6 @@ for j=1:nedges sources{j} = str2num(next); end - buffer = fgetl(fin2); buffer = buffer(2:end-1); buffer = strrep(buffer,"\"",""); @@ -76,7 +75,6 @@ for j=1:nedges weights{j} = next; end - %label_map is the index in "labels" that corresponds to each label in "labels2" label_map = cell(1,nnodes); for i = 1:nnodes @@ -99,6 +97,8 @@ for i = 1:nedges edges_out(source_i,target_i) = "1"; end +%scores_out + tf = cellfun('isempty',edges_out); edges_out(tf) = {"0"}; @@ -113,28 +113,25 @@ for i=1:nnodes end end - if test_score == 1 outfile = strcat(pre_new,'structure_input_temp.txt'); fout = fopen(outfile,'w'); fprintf(fout,'%s\t',labels{1:end-1}); -fprintf(fout,'%s\t\n',labels{end}); +fprintf(fout,'%s\n',labels{end}); for i = 1:nnodes fprintf(fout,'%s\t',scores_out{i,1:end-1}); - fprintf(fout,'%s\t\n',scores_out{i,end}); + fprintf(fout,'%s\n',scores_out{i,end}); end fclose(fout); end - - outfile2 = strcat(pre_new,'structure_input.txt'); fout2 = fopen(outfile2,'w'); fprintf(fout2,'%s\t',labels{1:end-1}); -fprintf(fout2,'%s\t\n',labels{end}); +fprintf(fout2,'%s\n',labels{end}); for i = 1:nnodes fprintf(fout2,'%s\t',edges_out{i,1:end-1}); - fprintf(fout2,'%s\t\n',edges_out{i,end}); + fprintf(fout2,'%s\n',edges_out{i,end}); end fclose(fout2); |
