libeblearn
ebl::fstate_idx< T > Class Template Reference

#include <ebl_states.h>

Inheritance diagram for ebl::fstate_idx< T >:
ebl::state ebl::bstate_idx< T > ebl::parameter< T, fstate_idx< T > > ebl::state_idxlooper< fstate_idx< T > > ebl::bbstate_idx< T > ebl::parameter< T, bstate_idx< T > > ebl::state_idxlooper< bstate_idx< T > > ebl::parameter< T, bstate_idx< T > > ebl::parameter< T, bbstate_idx< T > > ebl::state_idxlooper< bbstate_idx< T > >

List of all members.

Public Member Functions

 fstate_idx ()
 Constructs a fstate_idx of order 0.
 fstate_idx (intg s0)
 Constructs a fstate_idx of order 1.
 fstate_idx (intg s0, intg s1)
 Constructs a fstate_idx of order 2.
 fstate_idx (intg s0, intg s1, intg s2)
 Constructs a fstate_idx of order 3.
 fstate_idx (intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 Constructor. A fstate_idx can have up to 8 dimensions.
 fstate_idx (const idxdim &d)
 Constructor. Use the order and dimensions contained in passed idxdim d.
 fstate_idx (intg n, fstate_idx< T > &fs)
 fstate_idx (parameter< T, fstate_idx< T > > *st)
 fstate_idx (parameter< T, fstate_idx< T > > *st, intg s0)
 fstate_idx (parameter< T, fstate_idx< T > > *st, intg s0, intg s1)
 fstate_idx (parameter< T, fstate_idx< T > > *st, intg s0, intg s1, intg s2)
 fstate_idx (parameter< T, fstate_idx< T > > *st, intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 fstate_idx (parameter< T, fstate_idx< T > > *st, const idxdim &d)
 fstate_idx (const idx< T > &x)
virtual void clear ()
 clear all buffers (x, dx and ddx).
virtual void clear_x ()
 clear x
virtual intg nelements ()
 return number of elements
virtual intg footprint ()
 return footprint in storages
virtual intg size ()
 same as footprint
virtual void resize (intg s0=-1, intg s1=-1, intg s2=-1, intg s3=-1, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 resize. The order cannot be changed with this.
virtual void resize (const idxdim &d)
 resize with dimensions contained in an idxdim. order cannot be changed.
virtual void resize1 (intg dimn, intg size)
virtual void resize_as (fstate_idx &s)
virtual void resize_as_but1 (fstate_idx< T > &s, intg fixed_dim)
fstate_idx< T > select (int dimension, intg slice_index)
fstate_idx< T > narrow (int dimension, intg size, intg offset)
fstate_idx< T > make_copy ()
 make a new copy of self
virtual fstate_idx< T > & operator= (const fstate_idx< T > &other)
virtual void copy (fstate_idx< T > &cpy)
 Copy state 'cpy' into internal buffers.
virtual void pretty ()
 Prints idx metadata.
virtual void print ()
 Prints all elements.

Public Attributes

idx< T > x
 state itself
idx< T > dx
 gradient of loss with respect to state
idx< T > ddx
 diag hessian of loss with respect to state

Detailed Description

template<typename T>
class ebl::fstate_idx< T >

A class that stores a vector/tensor state.


Constructor & Destructor Documentation

template<typename T >
ebl::fstate_idx< T >::fstate_idx ( )

Constructs a fstate_idx of order 0.

constructors from specific dimensions

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( intg  n,
fstate_idx< T > &  fs 
)

This constructor initializes each buffer to the same order as 'ms.x' but sets all dimensions to 'n'.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st)

constructors from specific dimensions using a fparameter Constructs a fstate_idx of order 0, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st,
intg  s0 
)

Constructs a fstate_idx of order 1, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st,
intg  s0,
intg  s1 
)

Constructs a fstate_idx of order 2, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st,
intg  s0,
intg  s1,
intg  s2 
)

Constructs a fstate_idx of order 3, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st,
intg  s0,
intg  s1,
intg  s2,
intg  s3,
intg  s4 = -1,
intg  s5 = -1,
intg  s6 = -1,
intg  s7 = -1 
)

Constructs a fstate_idx of order up to 8, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( parameter< T, fstate_idx< T > > *  st,
const idxdim &  d 
)

Constructs a fstate_idx using the order and dimensions contained in passed idxdim d, by appending the fstate_idx into the same Srg as the fparameter passed as argument. This is useful for allocating multiple fstate_idx inside a fparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::fstate_idx< T >::fstate_idx ( const idx< T > &  x)

constructors from other fstate_idx Constructs a fstate_idx from an existing idx. Note: the data pointed to by idxs is not copied, we only create new idx pointing to the same data.


Member Function Documentation

template<typename T >
void ebl::fstate_idx< T >::clear ( ) [virtual]
template<typename T >
fstate_idx< T > ebl::fstate_idx< T >::narrow ( int  dimension,
intg  size,
intg  offset 
)

Same as idx::narrow(), applied to internal buffers. This returns a state_idx pointing to the same data as current state, but pointing to a slice of it.

Parameters:
dimensionThe dimension to slice.
slice_indexThe size of the slize to return.
offsetThe offset to start slicing.

Reimplemented in ebl::bstate_idx< T >, ebl::bbstate_idx< T >, ebl::bstate_idx< Tdata >, ebl::bstate_idx< Tds2 >, ebl::bstate_idx< Tnet >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
intg ebl::fstate_idx< T >::nelements ( ) [virtual]

return number of elements

information methods

template<typename T>
fstate_idx< T > & ebl::fstate_idx< T >::operator= ( const fstate_idx< T > &  other) [virtual]

Assignment operator, involves assignment of internal idx (avoid using this in critical loops).

template<typename T >
void ebl::fstate_idx< T >::pretty ( ) [virtual]
template<typename T >
void ebl::fstate_idx< T >::resize ( intg  s0 = -1,
intg  s1 = -1,
intg  s2 = -1,
intg  s3 = -1,
intg  s4 = -1,
intg  s5 = -1,
intg  s6 = -1,
intg  s7 = -1 
) [virtual]
template<typename T >
void ebl::fstate_idx< T >::resize1 ( intg  dimn,
intg  size 
) [virtual]
template<typename T >
void ebl::fstate_idx< T >::resize_as ( fstate_idx< T > &  s) [virtual]

resizes this fstate_idx with same sizes a <s>. Both fstate_idx are required to have the same order.

template<typename T>
void ebl::fstate_idx< T >::resize_as_but1 ( fstate_idx< T > &  s,
intg  fixed_dim 
) [virtual]

same as resize_as but leave dimension <fixed_dim> untouched. Both fstate_idx are required to have the same order.

template<typename T >
fstate_idx< T > ebl::fstate_idx< T >::select ( int  dimension,
intg  slice_index 
)

slicing methods Same as idx::select(), applied to internal buffers. This returns a state_idx pointing to the same data as current state, but pointing to a slice of it.

Parameters:
dimensionThe dimension to slice.
slice_indexThe slice to return.

slicing methods

Reimplemented in ebl::bstate_idx< T >, ebl::bbstate_idx< T >, ebl::bstate_idx< Tdata >, ebl::bstate_idx< Tds2 >, ebl::bstate_idx< Tnet >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.


Member Data Documentation

template<typename T>
idx<T> ebl::fstate_idx< T >::x

state itself

member variables


The documentation for this class was generated from the following files: