1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-01-01 03:58:22 +01:00
antd-lua-plugin/lib/ann/examples/cascade/train.lua

14 lines
363 B
Lua
Raw Normal View History

2018-09-19 15:08:49 +02:00
#! /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");