mirror of
https://github.com/lxsang/antd-lua-plugin
synced 2024-12-29 10:48:21 +01:00
14 lines
363 B
Lua
Executable File
14 lines
363 B
Lua
Executable File
#! /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");
|