第1关:神经网络基本概念
1、C
第2关:激活函数
def relu(x):
'''
x:负无穷到正无穷的实数
'''
if x <= 0:
return 0
else:
return x
第3关:反向传播算法
import os
import pandas as pd
from sklearn.neural_network import MLPClassifier
if os.path.exists('./step2/result.csv'):
os.remove('./step2/result.csv')
train_data = pd.read_csv('./step2/train_data.csv')
train_label = pd.read_csv('./step2/train_label.csv')
train_label = train_label['target']
test_data = pd.read_csv('./step2/test_data.csv')
mlp = MLPClassifier(solver='lbfgs',max_iter =500,
alpha=1e-3,