Not defining backward loss leads to an 'Abstract classes cannot be instantiated' error. Why is that?
조회 수: 13 (최근 30일)
이전 댓글 표시
Using the examples given in a Mathworks document I implemented my own neural network layer without defining the backward loss, which results in the following error message:
"Abstract classes cannot be instantiated. Class 'weightAdditionLayer' inherits abstract methods or properties but does not implement them. See the list of methods and properties that 'weightAdditionLayer' must implement if you do not intend the class to be abstract."
The meaning of the error message is clear to me. What is unclear is the fact that the mathworks implementation does not define the backward loss function and explicitly says that this is optional, as the class is able to find the derivative itself. Although I haven't tested the Mathworks code I assume it works. I want to know why I am getting this error message after all despite that I am following mathworks' example.
댓글 수: 0
답변 (2개)
Ajay Pattassery
2019년 10월 29일
I think your MATLAB version is R2019a or earlier and you are referring to the documentation of R2019b.
In MATLAB R2019a and earlier versions, while creating the custom neural network layer, we need to create a backward function. It is not optional. Refer the same document in R2019a
If you want to refer to the documentation of previous releases, you could refer
댓글 수: 0
Ba Mo
2019년 10월 30일
Same problem occurs with the deep learning toolbox
Abstract classes cannot be instantiated. Class 'maeRegressionLayer' inherits ...
abstract methods or properties but does not implement them. Use ...
meta.abstractDetails to see the list of methods and properties that ...
'maeRegressionLayer' must implement if you do not intend the class to be ...
abstract.
Abstract classes cannot be instantiated. Class 'preluLayer' inherits ...
abstract methods or properties but does not implement them. Use ...
meta.abstractDetails to see the list of methods and properties that ...
'preluLayer' must implement if you do not intend the class to be ...
abstract.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!