multiplicationLayer - multiply by a constant

조회 수: 6 (최근 30일)
Jeffrey Zurita
Jeffrey Zurita 2021년 3월 30일
답변: Harsh 2025년 1월 30일 15:37
I'm trying to implement a neural net in which a layer multiplies every input by a constant. There is a multiplicationLayer net in the Deep Learning Toolbox which can have any number of inputs, but I cannot connect one of those inputs to a constant of any type.
TIA!

답변 (1개)

Harsh
Harsh 2025년 1월 30일 15:37
Hi Jeffrey,
A multiplicationLayer multiplies inputs from multiple neural network layers elementwise. You can create a custom layer usingnnet.layer.Layer and in the “predict” function for that layer you can multiply the input by a constant. For more information regarding how to create a custom layer please check the following documentation - https://www.mathworks.com/help/deeplearning/ug/define-custom-deep-learning-layers.html
Hope this resolves your query!

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by