本文整理汇总了Python中neuralnet.NeuralNet.check_gradient方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNet.check_gradient方法的具体用法?Python NeuralNet.check_gradient怎么用?Python NeuralNet.check_gradient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuralnet.NeuralNet
的用法示例。
在下文中一共展示了NeuralNet.check_gradient方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NeuralNet
# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import check_gradient [as 别名]
settings = {
# Required settings
"n_inputs" : 2, # Number of network input signals
"layers" : [ (5, tanh_function), (1, sigmoid_function) ],
# [ (number_of_neurons, activation_function) ]
# The last pair in the list dictate the number of output signals
# Optional settings
"weights_low" : -0.1, # Lower bound on the initial weight value
"weights_high" : 0.1, # Upper bound on the initial weight value
}
# initialize the neural network
network = NeuralNet( settings )
network.check_gradient( training_data, cost_function )
## load a stored network configuration
# network = NeuralNet.load_network_from_file( "network0.pkl" )
## Train the network using backpropagation
#backpropagation(
# network, # the network to train
# training_data, # specify the training set
# test_data, # specify the test set
# cost_function, # specify the cost function to calculate error
# ERROR_LIMIT = 1e-3, # define an acceptable error limit
# #max_iterations = 100, # continues until the error limit is reach if this argument is skipped