1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2024-12-29 02:38:22 +01:00
antd-lua-plugin/lib/ann/examples/cascade/train.lua
2018-09-19 15:08:49 +02:00

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");