-
MLP에서 적절한 hidden unit 개수 산정하기프로그래밍/기계학습 2021. 1. 25. 20:23728x90반응형
sklearn MLP 알고리즘에서 적절한 hidden unit 개수 산정하기
skearn에서 MLP classifier나 regressor를 사용할때
hiddenunit 개수를 몇 개로 시작해야 해야하는지에 대해서 좋은 대답이 있어서 기록해둔다.
model_mlp = MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes=(hiddenunit, 5), random_state=1)
If the NN is a regressor, then the output layer has a single node.
If the NN is a classifier, then it also has a single node unless softmax is used in which case the output layer has one node per class label in your model.
--
The number of hidden neurons should be between the size of the input layer and the size of the output layer.
The number of hidden neurons should be 2/3 the size of the input layer, plus the size of the output layer.
The number of hidden neurons should be less than twice the size of the input layer.
참고 :
https://stats.stackexchange.com/questions/181/how-to-choose-the-number-of-hidden-layers-and-nodes-in-a-feedforward-neural-netw
https://frhyme.github.io/python-lib/is_mlp_regressor_good/
728x90반응형'프로그래밍 > 기계학습' 카테고리의 다른 글
chatgpt prompt 사용법 (0) 2023.03.14 RuntimeError: CUDA error: no kernel image is available for execution on the device (0) 2022.09.11 pandas : TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index' (0) 2020.10.14 기계학습 추천 알고리즘 참고 리스트 (0) 2020.05.14 ml tool 사용기 (0) 2019.10.06