def LoadData(): dr = DataReader(train_file, test_file) dr.ReadData() dr.NormalizeX() dr.NormalizeY(YNormalizationMethod.Regression) dr.Shuffle() dr.GenerateValidationSet() return dr
def LoadData(): dr = DataReader(train_file, test_file) dr.ReadData() dr.NormalizeX() dr.NormalizeY(YNormalizationMethod.MultipleClassifier, base=1) dr.Shuffle() dr.GenerateValidationSet() return dr
def LoadData(): dr = DataReader(train_file, test_file) dr.ReadData() dr.NormalizeX() #dr.NormalizeY(YNormalizationMethod.BinaryClassifier) dr.Shuffle() dr.GenerateValidationSet() return dr
def LoadData(): dataReader = DataReader(x_data_name, y_data_name) dataReader.ReadData() dataReader.Normalize(False, False, False) return dataReader
return X, Y def ShowResult2D(net, dr): ShowDataHelper(dr.XTrain[:,0], dr.XTrain[:,1], dr.YTrain[:,0], "Classifier Result", "x1", "x2", False, False) count = 50 X,Y = Prepare3DData(net, count) Z = net.output.reshape(count,count) plt.contourf(X, Y, Z, cmap=plt.cm.Spectral, zorder=1) plt.show() #end def if __name__ == '__main__': dataReader = DataReader(train_data_name, test_data_name) dataReader.ReadData() dataReader.NormalizeX() dataReader.Shuffle() dataReader.GenerateValidationSet() num_input = 2 num_hidden = 2 num_output = 1 max_epoch = 10000 batch_size = 5 learning_rate = 0.1 eps = 1e-3 params = HyperParameters( learning_rate, max_epoch, batch_size, eps,
def LoadData(): dataReader = DataReader(x_data_name, y_data_name) dataReader.ReadData() dataReader.Normalize(normalize_x=True, normalize_y=True, to_one_hot=True) return dataReader