我需要将 Softmax 激活函数应用于 scikit 中的多层 Perceptron。关于神经网络模型(监督)主题的 scikit文档说“ MLPClassifier通过应用 Softmax 作为输出函数来支持多类分类。” 问题是如何应用该功能?
在下面的代码片段中,当我在它不接受的激活参数下添加 Softmax 时。
MLPClassifier(activation='Softmax', alpha=1e-05, batch_size='auto',
beta_1=0.9, beta_2=0.999, early_stopping=False,
epsilon=1e-08, hidden_layer_sizes=(15,), learning_rate='constant',
learning_rate_init=0.001, max_iter=200, momentum=0.9,
nesterovs_momentum=True, power_t=0.5, random_state=1, shuffle=True,
solver='lbfgs', tol=0.0001, validation_fraction=0.1, verbose=False,
warm_start=False)
错误代码是:
ValueError:不支持激活“Softmax”。支持的激活是('identity'、'logistic'、'tanh'、'relu')。
有没有办法在 scikit-learn 中应用 Softmax 激活函数进行多类分类?