无需数学就能写AI,MIT提出AI专用编程语言Gen( 七 )
(trace, _) = generate(my_model, (xs,), constraints)
# Iteratively update the slope then the intercept,
# using Gen's metropolis_hastings operator.
for iter=1:num_iters
(trace, _) = metropolis_hastings(trace, select(:slope))
(trace, _) = metropolis_hastings(trace, select(:intercept))
end
# From the final trace, read out the slope and
# the intercept.
choices = get_choices(trace)
return (choices[:slope], choices[:intercept])
end
最后,研究人员在一些数据上运行推理,得到下面的结果:
xs = [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]
推荐阅读
- 魔兽世界|魔兽TBC:为什么玩家期待跨区组队?降低组队难度,无需频繁换区
- 左慈|三国杀:技能缝接,超强发挥,用左慈就能实现
- 赛博朋克2077|王者荣耀:6种不花钱就能领皮肤碎片的方法!快速兑换心仪皮肤!
- 海盗战|《炉石传说》:新版海盗战来袭!一张核心蓝卡就能上传说!
- edg战队|EDG夺冠,LOL手游迎来新爆发!新手入坑并不难,千元机就能畅玩?
- 梦幻西游手游|梦幻西游手游:开局就能秀对手一脸!快速开罗汉,你真的会吗?
- 云顶之弈|云顶之弈:狙神的真正核心!烬只要装备合适,就能横扫全场!
- 王者荣耀|王者进入亚运版本,QQ区玩家3块钱就能购买传说皮肤,太不公平
- 扁鹊|小乔退位,安琪拉报废,新晋“最强法师”诞生,一级就能轻松拿一血
- xyg|XYG“生死局”来了!击败WE就能会师AG,踏入S组的最关键一战!