Struct fann::TrainData [−][src]
pub struct TrainData { /* fields omitted */ }
Methods
impl TrainData
[src]
impl TrainData
pub fn from_file<P: AsRef<Path>>(path: P) -> FannResult<TrainData>
[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> FannResult<TrainData>
Read a file that stores training data.
The file must be formatted like:
num_train_data num_input num_output
inputdata separated by space
outputdata separated by space
.
.
.
inputdata separated by space
outputdata separated by space
pub fn from_callback(
num_data: c_uint,
num_input: c_uint,
num_output: c_uint,
cb: Box<Fn(c_uint) -> (Vec<fann_type>, Vec<fann_type>)>
) -> FannResult<TrainData>
[src]
pub fn from_callback(
num_data: c_uint,
num_input: c_uint,
num_output: c_uint,
cb: Box<Fn(c_uint) -> (Vec<fann_type>, Vec<fann_type>)>
) -> FannResult<TrainData>
Create training data using the given callback which for each number between 0
(included)
and num_data
(excluded) returns a pair of input and output vectors with num_input
and
num_output
entries respectively.
pub fn save<P: AsRef<Path>>(&self, path: P) -> FannResult<()>
[src]
pub fn save<P: AsRef<Path>>(&self, path: P) -> FannResult<()>
Save the training data to a file.
pub fn merge(data1: &TrainData, data2: &TrainData) -> FannResult<TrainData>
[src]
pub fn merge(data1: &TrainData, data2: &TrainData) -> FannResult<TrainData>
Merge the given data sets into a new one.
pub fn subset(&self, pos: c_uint, length: c_uint) -> FannResult<TrainData>
[src]
pub fn subset(&self, pos: c_uint, length: c_uint) -> FannResult<TrainData>
Create a subset of the training data, starting at the given positon and consisting of
length
samples.
pub fn length(&self) -> c_uint
[src]
pub fn length(&self) -> c_uint
Return the number of training patterns in the data.
pub fn num_input(&self) -> c_uint
[src]
pub fn num_input(&self) -> c_uint
Return the number of input values in each training pattern.
pub fn num_output(&self) -> c_uint
[src]
pub fn num_output(&self) -> c_uint
Return the number of output values in each training pattern.
pub fn scale_for(&mut self, fann: &Fann) -> FannResult<()>
[src]
pub fn scale_for(&mut self, fann: &Fann) -> FannResult<()>
Scale input and output in the training data using the parameters previously calculated for the given network.
pub fn descale_for(&mut self, fann: &Fann) -> FannResult<()>
[src]
pub fn descale_for(&mut self, fann: &Fann) -> FannResult<()>
Descale input and output in the training data using the parameters previously calculated for the given network.
pub fn scale_input(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
[src]
pub fn scale_input(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
Scales the inputs in the training data to the specified range.
pub fn scale_output(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
[src]
pub fn scale_output(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
Scales the outputs in the training data to the specified range.
pub fn scale(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
[src]
pub fn scale(
&mut self,
new_min: fann_type,
new_max: fann_type
) -> FannResult<()>
Scales the inputs and outputs in the training data to the specified range.
pub fn shuffle(&mut self)
[src]
pub fn shuffle(&mut self)
Shuffle training data, randomizing the order. This is recommended for incremental training while it does not affect batch training.
pub unsafe fn get_raw(&self) -> *mut fann_train_data
[src]
pub unsafe fn get_raw(&self) -> *mut fann_train_data
Get a pointer to the underlying raw fann_train_data
structure.
Trait Implementations
impl Clone for TrainData
[src]
impl Clone for TrainData
fn clone(&self) -> TrainData
[src]
fn clone(&self) -> TrainData
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Drop for TrainData
[src]
impl Drop for TrainData