本文整理汇总了Python中neuralnet.NeuralNet.build方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNet.build方法的具体用法?Python NeuralNet.build怎么用?Python NeuralNet.build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuralnet.NeuralNet
的用法示例。
在下文中一共展示了NeuralNet.build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extract_hist_features
# 需要导入模块: from neuralnet import NeuralNet [as 别名]
# 或者: from neuralnet.NeuralNet import build [as 别名]
from neuralnet import NeuralNet
from extractfeatures import *
import cv2
if __name__ == "__main__":
red = cv2.imread('/home/hoshiro/Pictures/test-img/red-light.jpg', cv2.CV_LOAD_IMAGE_COLOR)
yellow = cv2.imread('/home/hoshiro/Pictures/test-img/yellow-light.jpg', cv2.CV_LOAD_IMAGE_COLOR)
green = cv2.imread('/home/hoshiro/Pictures/test-img/green-light.jpg', cv2.CV_LOAD_IMAGE_COLOR)
features_red = extract_hist_features(red)
features_yellow = extract_hist_features(yellow)
features_green = extract_hist_features(green)
neural_net = NeuralNet()
neural_net.build(len(features_red), len(features_red) / 2, 1)
neural_net.create_data_set()
neural_net.add_list_of_data([features_red], 1)
neural_net.add_list_of_data([features_yellow], 2)
neural_net.add_list_of_data([features_green], 3)
neural_net.train()
print neural_net.apply_over_data(features_yellow)