# Linear Integer Output from a Neural Network

조회 수: 13 (최근 30일)
James Mathieson 2015년 2월 27일
댓글: Mithun Goutham 2020년 6월 9일
I am trying to construct a custom neural network for regression that gives its response in whole integers rather than in continuous real numbers. This is done because the target data is also in whole integers and fractional amounts are meaningless to the application.
At first blush, I thought the solution here would be to create a copy of the purelin transfer function and sub-functions with the a=n term replaced with a=round(n). However, this seems to create only 3 discrete steps. On further inspection when the custom function runs, the inputs to the function are all bounded to [-1 1], resulting in round(n) converting them to -1, 0, or 1. Given that the purelin template is unbound, I can only surmise that there is a separate function which scales the input back up to the value range after the transfer function.
So, the question is, what function for the layer actually determines the final output? How can I achieve my aim of getting a network to output whole integers? As a note, just rounding the result after the fact is not an acceptable solution as the integer nature of the output needs to be considered when calculating the performance of the network during training.
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Greg Heath 2015년 3월 1일
It is hard to believe that the integer nature of the output has to be considered during training.
Please explain why
Mithun Goutham 2020년 6월 9일
James Mathieson, I am in a similar fix, and was wondering if you were able to implement this within the neural network training. From what I understand, rounding within the neural network allows the RMSE to consider that when setting weights and biases, which would be different from rounding off the final value. While this may cause convergence to bounce up and down, I believe it should trend towards a lower RMSE.

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Greg Heath 2020년 5월 27일
The integer nature of the output DOES NOT HAVE TO BE CONSIDERED during training.
It is sufficient to round the real valued output.
Hope is helps.
Greg

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Define Shallow Neural Network Architectures에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by