mirror of
https://github.com/lxsang/antd-lua-plugin
synced 2025-01-01 12:08:21 +01:00
15 lines
314 B
Lua
15 lines
314 B
Lua
|
#! /usr/bin/env lua
|
||
|
|
||
|
require("lfann")
|
||
|
|
||
|
-- Load the network from a file
|
||
|
local net = fann.Net.create_from_file("xor.net")
|
||
|
|
||
|
-- Test using command line args
|
||
|
local input = {arg[1] and tonumber(arg[1]) or 1, arg[1] and tonumber(arg[2]) or 0}
|
||
|
local output = net:run(input)
|
||
|
|
||
|
for i, j in ipairs(output) do
|
||
|
print(j)
|
||
|
end
|