How to align the label to centre?
I'm using tikz
to draw my Neural Net architecture. The below snippet is for a single convolution block:
pic[shift={ (1,0,0) }] at (pool_b2-east)
{RightBandedBox={
name=ccr_b3,
caption= ,
xlabel={{ 256, 256 }},
zlabel=I/4,
fill=ConvColor,
bandfill=ConvReluColor,
height=25,
width={ 4.5 , 4.5 },
depth=25
}
};
This builds the following:
How do I align the zlabel
to the centre of the axis? The example I am following manages to get the zlabel at centre with the exact same code.
Thanks
edit: Full code below:
documentclass[border=8pt, multi, tikz]{standalone}
%usepackage{blocks}
usepackage{import}
subimport{../../layers/}{init}
usetikzlibrary{positioning}
defConvColor{rgb:yellow,5;red,2.5;white,5}
defConvReluColor{rgb:yellow,5;red,5;white,5}
defPoolColor{rgb:red,1;black,0.3}
defUnpoolColor{rgb:blue,2;green,1;black,0.3}
defFcColor{rgb:blue,5;red,2.5;white,5}
defFcReluColor{rgb:blue,5;red,5;white,4}
defSoftmaxColor{rgb:magenta,5;black,7}
newcommand{copymidarrow}{tikz draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}
begin{document}
begin{tikzpicture}
tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=edgecolor,opacity=0.7]
tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Encoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conv1_1,conv1_2
pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
xlabel={{"64","64"}},zlabel=I,fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2,2},depth=40}};
%pool1
pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
fill=PoolColor,opacity=0.5,height=32,width=1,depth=32}};
%%%%%%%%%%
% conv2_1,conv2_2
pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%pool2
pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
fill=PoolColor,opacity=0.5,height=25,width=1,depth=25}};
%%%%%%%%%%
% conv3_1,conv3_2
pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%pool3
pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
fill=PoolColor,opacity=0.5,height=16,width=1,depth=16}};
%%%%%%%%%%
% conv4_1,conv4_2,conv4_3
pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%pool4
pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
fill=PoolColor,opacity=0.5,height=8,width=1,depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bottleneck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%
xlabel={{"1024","1024"}},zlabel=I/16,fill=ConvColor,bandfill=ConvReluColor,%
height=8,width={8,8},depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Decoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% unpool4,
pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%
fill=UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
xlabel={{"512","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%
xlabel={{"512",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%%%%%%%%%%
%% unpool3,
pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%
fill=UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
xlabel={{"256","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%
xlabel={{"256",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%%%%%%%%%%
%% unpool2,
pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%
fill=UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
xlabel={{"128","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%
xlabel={{"128",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%%%%%%%%%%
%% unpool1,
pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%
fill=UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
xlabel={{"64","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%
xlabel={{"64",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
xlabel={{"64","64"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2.5,2.5},depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
zlabel=I,fill=SoftmaxColor,height=40,width=1,depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw connections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
draw [connection] (p1-east) -- node {midarrow} (cr2-west);
draw [connection] (p2-east) -- node {midarrow} (cr3-west);
draw [connection] (p3-east) -- node {midarrow} (cr4-west);
draw [connection] (p4-east) -- node {midarrow} (cr5-west);
draw [connection] (cr5-east) -- node {midarrow} (up4-west);
draw [connection] (ucr4a-east) -- node {midarrow} (up3-west);
draw [connection] (ucr3a-east) -- node {midarrow} (up2-west);
draw [connection] (ucr2a-east) -- node {midarrow} (up1-west);
draw [connection] (ucr1a-east) -- node {midarrow} (out-west);
%draw [connection] (out-east) -- node {midarrow} ++(2,0,0);
path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;
path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;
path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;
path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;
path (cat4-south) -- (cat4-north) coordinate[pos=1.25] (cat4-top) ;
path (cat3-south) -- (cat3-north) coordinate[pos=1.25] (cat3-top) ;
path (cat2-south) -- (cat2-north) coordinate[pos=1.25] (cat2-top) ;
path (cat1-south) -- (cat1-north) coordinate[pos=1.25] (cat1-top) ;
%
draw [copyconnection] (cr4-northeast)
-- node {copymidarrow}(cr4-top)
-- node {copymidarrow}(cat4-top)
-- node {copymidarrow} (cat4-north);
%
draw [copyconnection] (cr3-northeast)
-- node {copymidarrow}(cr3-top)
-- node {copymidarrow}(cat3-top)
-- node {copymidarrow} (cat3-north);
%
draw [copyconnection] (cr2-northeast)
-- node {copymidarrow}(cr2-top)
-- node {copymidarrow}(cat2-top)
-- node {copymidarrow} (cat2-north);
%
draw [copyconnection] (cr1-northeast)
-- node {copymidarrow}(cr1-top)
-- node {copymidarrow}(cat1-top)
-- node {copymidarrow} (cat1-north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end{tikzpicture}
end{document}
tikz-pgf vertical-alignment tikz-styles
|
show 1 more comment
I'm using tikz
to draw my Neural Net architecture. The below snippet is for a single convolution block:
pic[shift={ (1,0,0) }] at (pool_b2-east)
{RightBandedBox={
name=ccr_b3,
caption= ,
xlabel={{ 256, 256 }},
zlabel=I/4,
fill=ConvColor,
bandfill=ConvReluColor,
height=25,
width={ 4.5 , 4.5 },
depth=25
}
};
This builds the following:
How do I align the zlabel
to the centre of the axis? The example I am following manages to get the zlabel at centre with the exact same code.
Thanks
edit: Full code below:
documentclass[border=8pt, multi, tikz]{standalone}
%usepackage{blocks}
usepackage{import}
subimport{../../layers/}{init}
usetikzlibrary{positioning}
defConvColor{rgb:yellow,5;red,2.5;white,5}
defConvReluColor{rgb:yellow,5;red,5;white,5}
defPoolColor{rgb:red,1;black,0.3}
defUnpoolColor{rgb:blue,2;green,1;black,0.3}
defFcColor{rgb:blue,5;red,2.5;white,5}
defFcReluColor{rgb:blue,5;red,5;white,4}
defSoftmaxColor{rgb:magenta,5;black,7}
newcommand{copymidarrow}{tikz draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}
begin{document}
begin{tikzpicture}
tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=edgecolor,opacity=0.7]
tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Encoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conv1_1,conv1_2
pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
xlabel={{"64","64"}},zlabel=I,fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2,2},depth=40}};
%pool1
pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
fill=PoolColor,opacity=0.5,height=32,width=1,depth=32}};
%%%%%%%%%%
% conv2_1,conv2_2
pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%pool2
pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
fill=PoolColor,opacity=0.5,height=25,width=1,depth=25}};
%%%%%%%%%%
% conv3_1,conv3_2
pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%pool3
pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
fill=PoolColor,opacity=0.5,height=16,width=1,depth=16}};
%%%%%%%%%%
% conv4_1,conv4_2,conv4_3
pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%pool4
pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
fill=PoolColor,opacity=0.5,height=8,width=1,depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bottleneck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%
xlabel={{"1024","1024"}},zlabel=I/16,fill=ConvColor,bandfill=ConvReluColor,%
height=8,width={8,8},depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Decoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% unpool4,
pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%
fill=UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
xlabel={{"512","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%
xlabel={{"512",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%%%%%%%%%%
%% unpool3,
pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%
fill=UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
xlabel={{"256","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%
xlabel={{"256",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%%%%%%%%%%
%% unpool2,
pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%
fill=UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
xlabel={{"128","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%
xlabel={{"128",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%%%%%%%%%%
%% unpool1,
pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%
fill=UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
xlabel={{"64","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%
xlabel={{"64",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
xlabel={{"64","64"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2.5,2.5},depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
zlabel=I,fill=SoftmaxColor,height=40,width=1,depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw connections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
draw [connection] (p1-east) -- node {midarrow} (cr2-west);
draw [connection] (p2-east) -- node {midarrow} (cr3-west);
draw [connection] (p3-east) -- node {midarrow} (cr4-west);
draw [connection] (p4-east) -- node {midarrow} (cr5-west);
draw [connection] (cr5-east) -- node {midarrow} (up4-west);
draw [connection] (ucr4a-east) -- node {midarrow} (up3-west);
draw [connection] (ucr3a-east) -- node {midarrow} (up2-west);
draw [connection] (ucr2a-east) -- node {midarrow} (up1-west);
draw [connection] (ucr1a-east) -- node {midarrow} (out-west);
%draw [connection] (out-east) -- node {midarrow} ++(2,0,0);
path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;
path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;
path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;
path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;
path (cat4-south) -- (cat4-north) coordinate[pos=1.25] (cat4-top) ;
path (cat3-south) -- (cat3-north) coordinate[pos=1.25] (cat3-top) ;
path (cat2-south) -- (cat2-north) coordinate[pos=1.25] (cat2-top) ;
path (cat1-south) -- (cat1-north) coordinate[pos=1.25] (cat1-top) ;
%
draw [copyconnection] (cr4-northeast)
-- node {copymidarrow}(cr4-top)
-- node {copymidarrow}(cat4-top)
-- node {copymidarrow} (cat4-north);
%
draw [copyconnection] (cr3-northeast)
-- node {copymidarrow}(cr3-top)
-- node {copymidarrow}(cat3-top)
-- node {copymidarrow} (cat3-north);
%
draw [copyconnection] (cr2-northeast)
-- node {copymidarrow}(cr2-top)
-- node {copymidarrow}(cat2-top)
-- node {copymidarrow} (cat2-north);
%
draw [copyconnection] (cr1-northeast)
-- node {copymidarrow}(cr1-top)
-- node {copymidarrow}(cat1-top)
-- node {copymidarrow} (cat1-north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end{tikzpicture}
end{document}
tikz-pgf vertical-alignment tikz-styles
2
Please provide us with a complete code that starts withdocumentclass
, ends withend{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?
– marmot
Feb 15 at 16:45
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
Well,subimport{../../layers/}{init}
fails if one does not have theinit
file. And I doubt that many have it. And I still do not understand which axis you are referring to.
– marmot
Feb 15 at 17:02
I'm referring tozlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link thezlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost
– StuckInPhD
Feb 15 at 17:07
I get thezlabel
correctly positioned as in the link, make sure you didn't edit the original files,init, Ball, Box, RightBandedBox
, from the repo.
– AboAmmar
Feb 15 at 17:43
|
show 1 more comment
I'm using tikz
to draw my Neural Net architecture. The below snippet is for a single convolution block:
pic[shift={ (1,0,0) }] at (pool_b2-east)
{RightBandedBox={
name=ccr_b3,
caption= ,
xlabel={{ 256, 256 }},
zlabel=I/4,
fill=ConvColor,
bandfill=ConvReluColor,
height=25,
width={ 4.5 , 4.5 },
depth=25
}
};
This builds the following:
How do I align the zlabel
to the centre of the axis? The example I am following manages to get the zlabel at centre with the exact same code.
Thanks
edit: Full code below:
documentclass[border=8pt, multi, tikz]{standalone}
%usepackage{blocks}
usepackage{import}
subimport{../../layers/}{init}
usetikzlibrary{positioning}
defConvColor{rgb:yellow,5;red,2.5;white,5}
defConvReluColor{rgb:yellow,5;red,5;white,5}
defPoolColor{rgb:red,1;black,0.3}
defUnpoolColor{rgb:blue,2;green,1;black,0.3}
defFcColor{rgb:blue,5;red,2.5;white,5}
defFcReluColor{rgb:blue,5;red,5;white,4}
defSoftmaxColor{rgb:magenta,5;black,7}
newcommand{copymidarrow}{tikz draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}
begin{document}
begin{tikzpicture}
tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=edgecolor,opacity=0.7]
tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Encoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conv1_1,conv1_2
pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
xlabel={{"64","64"}},zlabel=I,fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2,2},depth=40}};
%pool1
pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
fill=PoolColor,opacity=0.5,height=32,width=1,depth=32}};
%%%%%%%%%%
% conv2_1,conv2_2
pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%pool2
pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
fill=PoolColor,opacity=0.5,height=25,width=1,depth=25}};
%%%%%%%%%%
% conv3_1,conv3_2
pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%pool3
pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
fill=PoolColor,opacity=0.5,height=16,width=1,depth=16}};
%%%%%%%%%%
% conv4_1,conv4_2,conv4_3
pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%pool4
pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
fill=PoolColor,opacity=0.5,height=8,width=1,depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bottleneck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%
xlabel={{"1024","1024"}},zlabel=I/16,fill=ConvColor,bandfill=ConvReluColor,%
height=8,width={8,8},depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Decoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% unpool4,
pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%
fill=UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
xlabel={{"512","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%
xlabel={{"512",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%%%%%%%%%%
%% unpool3,
pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%
fill=UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
xlabel={{"256","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%
xlabel={{"256",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%%%%%%%%%%
%% unpool2,
pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%
fill=UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
xlabel={{"128","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%
xlabel={{"128",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%%%%%%%%%%
%% unpool1,
pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%
fill=UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
xlabel={{"64","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%
xlabel={{"64",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
xlabel={{"64","64"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2.5,2.5},depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
zlabel=I,fill=SoftmaxColor,height=40,width=1,depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw connections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
draw [connection] (p1-east) -- node {midarrow} (cr2-west);
draw [connection] (p2-east) -- node {midarrow} (cr3-west);
draw [connection] (p3-east) -- node {midarrow} (cr4-west);
draw [connection] (p4-east) -- node {midarrow} (cr5-west);
draw [connection] (cr5-east) -- node {midarrow} (up4-west);
draw [connection] (ucr4a-east) -- node {midarrow} (up3-west);
draw [connection] (ucr3a-east) -- node {midarrow} (up2-west);
draw [connection] (ucr2a-east) -- node {midarrow} (up1-west);
draw [connection] (ucr1a-east) -- node {midarrow} (out-west);
%draw [connection] (out-east) -- node {midarrow} ++(2,0,0);
path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;
path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;
path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;
path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;
path (cat4-south) -- (cat4-north) coordinate[pos=1.25] (cat4-top) ;
path (cat3-south) -- (cat3-north) coordinate[pos=1.25] (cat3-top) ;
path (cat2-south) -- (cat2-north) coordinate[pos=1.25] (cat2-top) ;
path (cat1-south) -- (cat1-north) coordinate[pos=1.25] (cat1-top) ;
%
draw [copyconnection] (cr4-northeast)
-- node {copymidarrow}(cr4-top)
-- node {copymidarrow}(cat4-top)
-- node {copymidarrow} (cat4-north);
%
draw [copyconnection] (cr3-northeast)
-- node {copymidarrow}(cr3-top)
-- node {copymidarrow}(cat3-top)
-- node {copymidarrow} (cat3-north);
%
draw [copyconnection] (cr2-northeast)
-- node {copymidarrow}(cr2-top)
-- node {copymidarrow}(cat2-top)
-- node {copymidarrow} (cat2-north);
%
draw [copyconnection] (cr1-northeast)
-- node {copymidarrow}(cr1-top)
-- node {copymidarrow}(cat1-top)
-- node {copymidarrow} (cat1-north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end{tikzpicture}
end{document}
tikz-pgf vertical-alignment tikz-styles
I'm using tikz
to draw my Neural Net architecture. The below snippet is for a single convolution block:
pic[shift={ (1,0,0) }] at (pool_b2-east)
{RightBandedBox={
name=ccr_b3,
caption= ,
xlabel={{ 256, 256 }},
zlabel=I/4,
fill=ConvColor,
bandfill=ConvReluColor,
height=25,
width={ 4.5 , 4.5 },
depth=25
}
};
This builds the following:
How do I align the zlabel
to the centre of the axis? The example I am following manages to get the zlabel at centre with the exact same code.
Thanks
edit: Full code below:
documentclass[border=8pt, multi, tikz]{standalone}
%usepackage{blocks}
usepackage{import}
subimport{../../layers/}{init}
usetikzlibrary{positioning}
defConvColor{rgb:yellow,5;red,2.5;white,5}
defConvReluColor{rgb:yellow,5;red,5;white,5}
defPoolColor{rgb:red,1;black,0.3}
defUnpoolColor{rgb:blue,2;green,1;black,0.3}
defFcColor{rgb:blue,5;red,2.5;white,5}
defFcReluColor{rgb:blue,5;red,5;white,4}
defSoftmaxColor{rgb:magenta,5;black,7}
newcommand{copymidarrow}{tikz draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}
begin{document}
begin{tikzpicture}
tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=edgecolor,opacity=0.7]
tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Encoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conv1_1,conv1_2
pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%
xlabel={{"64","64"}},zlabel=I,fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2,2},depth=40}};
%pool1
pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%
fill=PoolColor,opacity=0.5,height=32,width=1,depth=32}};
%%%%%%%%%%
% conv2_1,conv2_2
pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%pool2
pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%
fill=PoolColor,opacity=0.5,height=25,width=1,depth=25}};
%%%%%%%%%%
% conv3_1,conv3_2
pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%pool3
pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%
fill=PoolColor,opacity=0.5,height=16,width=1,depth=16}};
%%%%%%%%%%
% conv4_1,conv4_2,conv4_3
pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%pool4
pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%
fill=PoolColor,opacity=0.5,height=8,width=1,depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bottleneck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3
pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%
xlabel={{"1024","1024"}},zlabel=I/16,fill=ConvColor,bandfill=ConvReluColor,%
height=8,width={8,8},depth=8}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw Decoder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% unpool4,
pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%
fill=UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};
pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%
xlabel={{"512","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%
xlabel={{"512",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};
pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%
xlabel={{"512","512"}},zlabel=I/8,fill=ConvColor,bandfill=ConvReluColor,%
height=16,width={6,6},depth=16}};
%%%%%%%%%%
%% unpool3,
pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%
fill=UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};
pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%
xlabel={{"256","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%
xlabel={{"256",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};
pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%
xlabel={{"256","256"}},zlabel=I/4,fill=ConvColor,bandfill=ConvReluColor,%
height=25,width={4.5,4.5},depth=25}};
%%%%%%%%%%
%% unpool2,
pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%
fill=UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};
pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%
xlabel={{"128","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%
xlabel={{"128",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};
pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%
xlabel={{"128","128"}},zlabel=I/2,fill=ConvColor,bandfill=ConvReluColor,%
height=32,width={3.5,3.5},depth=32}};
%%%%%%%%%%
%% unpool1,
pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%
fill=UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};
pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%
xlabel={{"64","dummy"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%
xlabel={{"64",""}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};
pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%
xlabel={{"64","64"}},fill=ConvColor,bandfill=ConvReluColor,%
height=40,width={2.5,2.5},depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%
zlabel=I,fill=SoftmaxColor,height=40,width=1,depth=40}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw connections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
draw [connection] (p1-east) -- node {midarrow} (cr2-west);
draw [connection] (p2-east) -- node {midarrow} (cr3-west);
draw [connection] (p3-east) -- node {midarrow} (cr4-west);
draw [connection] (p4-east) -- node {midarrow} (cr5-west);
draw [connection] (cr5-east) -- node {midarrow} (up4-west);
draw [connection] (ucr4a-east) -- node {midarrow} (up3-west);
draw [connection] (ucr3a-east) -- node {midarrow} (up2-west);
draw [connection] (ucr2a-east) -- node {midarrow} (up1-west);
draw [connection] (ucr1a-east) -- node {midarrow} (out-west);
%draw [connection] (out-east) -- node {midarrow} ++(2,0,0);
path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;
path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;
path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;
path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;
path (cat4-south) -- (cat4-north) coordinate[pos=1.25] (cat4-top) ;
path (cat3-south) -- (cat3-north) coordinate[pos=1.25] (cat3-top) ;
path (cat2-south) -- (cat2-north) coordinate[pos=1.25] (cat2-top) ;
path (cat1-south) -- (cat1-north) coordinate[pos=1.25] (cat1-top) ;
%
draw [copyconnection] (cr4-northeast)
-- node {copymidarrow}(cr4-top)
-- node {copymidarrow}(cat4-top)
-- node {copymidarrow} (cat4-north);
%
draw [copyconnection] (cr3-northeast)
-- node {copymidarrow}(cr3-top)
-- node {copymidarrow}(cat3-top)
-- node {copymidarrow} (cat3-north);
%
draw [copyconnection] (cr2-northeast)
-- node {copymidarrow}(cr2-top)
-- node {copymidarrow}(cat2-top)
-- node {copymidarrow} (cat2-north);
%
draw [copyconnection] (cr1-northeast)
-- node {copymidarrow}(cr1-top)
-- node {copymidarrow}(cat1-top)
-- node {copymidarrow} (cat1-north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end{tikzpicture}
end{document}
tikz-pgf vertical-alignment tikz-styles
tikz-pgf vertical-alignment tikz-styles
edited Feb 15 at 22:42
barbara beeton
69.8k9157374
69.8k9157374
asked Feb 15 at 16:42
StuckInPhDStuckInPhD
1257
1257
2
Please provide us with a complete code that starts withdocumentclass
, ends withend{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?
– marmot
Feb 15 at 16:45
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
Well,subimport{../../layers/}{init}
fails if one does not have theinit
file. And I doubt that many have it. And I still do not understand which axis you are referring to.
– marmot
Feb 15 at 17:02
I'm referring tozlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link thezlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost
– StuckInPhD
Feb 15 at 17:07
I get thezlabel
correctly positioned as in the link, make sure you didn't edit the original files,init, Ball, Box, RightBandedBox
, from the repo.
– AboAmmar
Feb 15 at 17:43
|
show 1 more comment
2
Please provide us with a complete code that starts withdocumentclass
, ends withend{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?
– marmot
Feb 15 at 16:45
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
Well,subimport{../../layers/}{init}
fails if one does not have theinit
file. And I doubt that many have it. And I still do not understand which axis you are referring to.
– marmot
Feb 15 at 17:02
I'm referring tozlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link thezlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost
– StuckInPhD
Feb 15 at 17:07
I get thezlabel
correctly positioned as in the link, make sure you didn't edit the original files,init, Ball, Box, RightBandedBox
, from the repo.
– AboAmmar
Feb 15 at 17:43
2
2
Please provide us with a complete code that starts with
documentclass
, ends with end{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?– marmot
Feb 15 at 16:45
Please provide us with a complete code that starts with
documentclass
, ends with end{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?– marmot
Feb 15 at 16:45
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
Well,
subimport{../../layers/}{init}
fails if one does not have the init
file. And I doubt that many have it. And I still do not understand which axis you are referring to.– marmot
Feb 15 at 17:02
Well,
subimport{../../layers/}{init}
fails if one does not have the init
file. And I doubt that many have it. And I still do not understand which axis you are referring to.– marmot
Feb 15 at 17:02
I'm referring to
zlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link the zlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost– StuckInPhD
Feb 15 at 17:07
I'm referring to
zlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link the zlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost– StuckInPhD
Feb 15 at 17:07
I get the
zlabel
correctly positioned as in the link, make sure you didn't edit the original files, init, Ball, Box, RightBandedBox
, from the repo.– AboAmmar
Feb 15 at 17:43
I get the
zlabel
correctly positioned as in the link, make sure you didn't edit the original files, init, Ball, Box, RightBandedBox
, from the repo.– AboAmmar
Feb 15 at 17:43
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475055%2fhow-to-align-the-label-to-centre%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475055%2fhow-to-align-the-label-to-centre%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Please provide us with a complete code that starts with
documentclass
, ends withend{document}
and can be compiled. And please consider also making your question clearer. Which axis are you referring to?– marmot
Feb 15 at 16:45
@marmot Full code added
– StuckInPhD
Feb 15 at 16:49
Well,
subimport{../../layers/}{init}
fails if one does not have theinit
file. And I doubt that many have it. And I still do not understand which axis you are referring to.– marmot
Feb 15 at 17:02
I'm referring to
zlabel
as I mentioned in the question. The code is from here: github.com/HarisIqbal88/PlotNeuralNet/tree/master/examples/Unet which I edited to my parameters. As can be seen from the pdf generated in the link thezlabel
are aligned to centre. But when I edit the file and rebuild the centre alignment is lost– StuckInPhD
Feb 15 at 17:07
I get the
zlabel
correctly positioned as in the link, make sure you didn't edit the original files,init, Ball, Box, RightBandedBox
, from the repo.– AboAmmar
Feb 15 at 17:43