2 Star 0 Fork 1

mirrors_mikaelbr/AnnWebots

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
example_xor.py 990 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mikael Brevik 提交于 2012-03-18 14:16 . Examples
import random
from functools import partial
from controllers.webann.ann.layer import *
from controllers.webann.ann.link import *
from controllers.webann.ann.ann import Ann
from controllers.webann.ann.parser import AnnParser
from controllers.webann.ann.ann_modules import Inhibitory
parser = AnnParser("example_scripts/xor.ini")
ann = parser.create_ann()
# # Layers
# i_l = Layer("Input", 2, io_type='input')
# hidden = Layer("Hidden", 2, partial(Activation.step, T=2))
# out = Layer("Out", 1, partial(Activation.step, T=2), io_type='output')
# layers = [i_l, hidden, out]
# l1 = Link(i_l, hidden,
# weights=[2, -1, -1, 2],
# arcs=[(0,0), (0,1), (1,0), (1,1)]
# )
# l2 = Link(hidden, out,
# weights=[2, 2],
# topology="full"
# )
# # Execution order
# ann = Ann(layers, [l1, l2])
# ann.execution_order = layers
# AnnParser.export(ann, "scripts/xor.ini")
print ann.recall([0, 0])
print ann.recall([1, 0])
print ann.recall([1, 1])
print ann.recall([0, 1])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_mikaelbr/AnnWebots.git
[email protected]:mirrors_mikaelbr/AnnWebots.git
mirrors_mikaelbr
AnnWebots
AnnWebots
master

搜索帮助