Skip to content

Commit

Permalink
DagNN: print: uses display in Linux to visualize the generated PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
vedaldi committed Oct 12, 2015
1 parent 4d40a19 commit b02f6a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions matlab/+dagnn/@DagNN/print.m
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@
str = {} ;
str{end+1} = sprintf('digraph DagNN {\n\tfontsize=12\n') ;

for v = 1:numel(net.vars)
label=sprintf('{{%s} | {%s | %s }}', net.vars(v).name, pdims(varSizes{v}), pmem(4*prod(varSizes{v}))) ;
for v = 1:numel(net.vars)
label=sprintf('{{%s} | {%s | %s }}', net.vars(v).name, pdims(varSizes{v}), pmem(4*prod(varSizes{v}))) ;
str{end+1} = sprintf('\tvar_%s [label="%s" shape=Mrecord style=filled color=beige fontsize=12]\n', ...
net.vars(v).name, label) ;
end

for p = 1:numel(net.params)
label=sprintf('{{%s} | {%s | %s }}', net.params(p).name, pdims(paramSizes{p}), pmem(4*prod(paramSizes{p}))) ;
label=sprintf('{{%s} | {%s | %s }}', net.params(p).name, pdims(paramSizes{p}), pmem(4*prod(paramSizes{p}))) ;
str{end+1} = sprintf('\tpar_%s [label="%s" shape=Mrecord style=filled color=lightsteelblue fontsize=12]\n', ...
net.params(p).name, label) ;
end
Expand Down Expand Up @@ -353,7 +353,9 @@ function displayDot(str)
switch computer
case 'MACI64'
system(sprintf('open "%s"', out)) ;
case 'GLNXA64'
system(sprintf('display "%s"', out)) ;
otherwise
printf('PDF figure saved at "%s"\n', out) ;
fprintf('PDF figure saved at "%s"\n', out) ;
end
end

0 comments on commit b02f6a0

Please sign in to comment.