How is this cyclegan generator layers ordered?

조회 수: 5 (최근 30일)
John
John 2021년 10월 7일
답변: John 2021년 11월 1일
A cyclegan example (https://www.mathworks.com/matlabcentral/fileexchange/76986-image-domain-conversion-using-cyclegan?s_tid=srchtitle) is very interesting. But I have trouble to understand the integration of the generator layers:
% integrate
lgraph = lgraph2; % Residual Blocks
lgraph = addLayers(lgraph,layers1); % Encoder
lgraph = addLayers(lgraph,layers3); % Decoder
The order of the code doesn't seem to match the design (as above picture) and the plot(lgraph) doesn't work here to see the layer structure. Placing the layers1 at the begining doesn't work. Yes, layers1 = [imageInputLayer(...)] indicated the imageinputlayer but does the lgraph2 = layerGraph() indicate the start of the layerGraph?
Hope you can help to clarify it in order to fully understand those matlab functions involved and design correctly layers. Thank you!

채택된 답변

Sahil Jain
Sahil Jain 2021년 10월 19일
The two calls to "addLayer" only add the encoder and decoder parts to the graph without connecting them with the residual blocks. In the original code, there are three calls to the "connectLayers" function after the "integrate" snippet which you have shared. These calls join the encoder, residual blocks and decoders in the appropriate order. I am attaching a file ("generator.m") which you can run to visualize how the graph changes with the "addLayers" and "connectLayers" function calls.

추가 답변 (1개)

John
John 2021년 11월 1일
Thank you Sahil Jain!
Also, the filter size in the script is fixed to [4,4], changing it will cause error and it made me completely lost. Hope you can point out the trick and guid me to change the filter size.
Best,
John

카테고리

Help CenterFile Exchange에서 Python Package Integration에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by