1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-09-03 17:52:10 +02:00

mimgrating from another repo

This commit is contained in:
Xuan Sang LE
2018-09-19 15:08:49 +02:00
parent 91320521e8
commit 38bd13b46b
600 changed files with 362490 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
#! /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

View File

@@ -0,0 +1,9 @@
4 2 1
1 1
0
1 0
1
0 1
1
0 0
0

View File

@@ -0,0 +1,13 @@
#! /usr/bin/env lua
require("lfann")
-- Create a shortcut neural network to serve as base to the cascade training
local net = fann.Net.create_shortcut{2, 1}
-- Train the net from a file
net:set_train_stop_function(fann.STOPFUNC_MSE)
net:cascade_train_on_file("train.data", 10, 1, 0.0001)
-- Save the net to a file for a latter execution
net:save("xor.net");