mirror of
https://github.com/lxsang/antd-lua-plugin
synced 2024-12-28 18:38:20 +01:00
18 lines
279 B
Lua
Executable File
18 lines
279 B
Lua
Executable File
#! /usr/bin/env lua
|
|
|
|
require("lfann")
|
|
|
|
local m = 400000
|
|
local net = fann.Net.create_from_file("xor.test")
|
|
|
|
for i = 1, m do
|
|
local out = net:run{i % 1000, i > (m / 2) and 1 or 0}
|
|
assert(out[1] >= -1 and out[1] <= 1)
|
|
end
|
|
|
|
print("End.")
|
|
|
|
if arg[1] == "mem" then
|
|
io.read("*n")
|
|
end
|