How do you change the output dimension of a NN layer?

2 次查看(过去 30 天)
I am attempting to implement the NeRF2 architecture from this paper. So far, I have the layout of the network working properly, as well as the attenuation network and the radiance network separately. At the moment, my network looks like this:
However, the outputs from relu_8 have shape CB, while the other two inputs to radianceConcat have shape SCB. The AttnReshape layer was supposed to fix this, but I can't figure out how to actually reshape the labels on the data. I've attached the code I'm using below. I am completely at a loss here, any help would be greatly appriciated.
  8 个评论
Alex B
Alex B 2025-3-5
In reply to your response - so what would be the proper way to implement this architecture then? Should I flatten the inputs and then concatenate them similar to this example?
Or would the proper way to do this be to define a custom loss function with multiple inputs and multiple outputs?
Alex B
Alex B 2025-3-5
I wish this forum had a reply button.
To answer your question about inputs:
  • The attenuation network takes an encoded 3d position (of shape [3, 20, 1] (SCB)) and produces a scalar output, representing either the real or complex part of that cells signal attenuation
  • The radiance network produces a singal scalar output representing the real or complex part of a signal transmitted in direction omega, given three inputs:
  • An encoded receiver position (of shape [3, 20, 1] (SCB))
  • An encoded transmission direction (of shape [2, 8, 1] (SCB))
  • The scalar output from the attenuation network (of shape [1,1] with no dimensional labels)

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2025-3-5
Should I flatten the inputs and then concatenate them similar to this example?
Probably. See if the attached network does what you want.

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by