|
libeblearn
|
#include <ebl_states.h>
Public Member Functions | |
| bstate_idx () | |
| Constructs a bstate_idx of order 0. | |
| bstate_idx (intg s0) | |
| Constructs a bstate_idx of order 1. | |
| bstate_idx (intg s0, intg s1) | |
| Constructs a bstate_idx of order 2. | |
| bstate_idx (intg s0, intg s1, intg s2) | |
| Constructs a bstate_idx of order 3. | |
| bstate_idx (intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1) | |
| Constructor. A bstate_idx can have up to 8 dimensions. | |
| bstate_idx (const idxdim &d) | |
| Constructor. Use the order and dimensions contained in passed idxdim d. | |
| bstate_idx (intg n, bstate_idx< T > &fs) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1, intg s2) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1) | |
| bstate_idx (parameter< T, bstate_idx< T > > *st, const idxdim &d) | |
| bstate_idx (const idx< T > &x, const idx< T > &dx) | |
| virtual void | clear () |
| clear x and dx. | |
| virtual void | clear_dx () |
| clear gradients dx | |
| virtual void | update_gd (gd_param &arg) |
| update with gradient descent | |
| 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 (bstate_idx &s) |
| virtual void | resize_as_but1 (bstate_idx< T > &s, intg fixed_dim) |
| bstate_idx< T > | select (int dimension, intg slice_index) |
| bstate_idx< T > | narrow (int dimension, intg size, intg offset) |
| bstate_idx< T > | make_copy () |
| make a new copy of self | |
| virtual bstate_idx< T > & | operator= (const bstate_idx< T > &other) |
| virtual void | copy (bstate_idx< T > &cpy) |
| Copy state 'cpy' into internal buffers. | |
| virtual void | pretty () |
| Prints idx metadata. | |
| virtual void | print () |
| Prints all elements. | |
A class that stores a vector/tensor state.
| ebl::bstate_idx< T >::bstate_idx | ( | ) |
Constructs a bstate_idx of order 0.
constructors from specific dimensions
| ebl::bstate_idx< T >::bstate_idx | ( | intg | n, |
| bstate_idx< T > & | fs | ||
| ) |
This constructor initializes each buffer to the same order as 'ms.x' but sets all dimensions to 'n'.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_idx< T > > * | st | ) |
constructors from specific dimensions using a bparameter Constructs a bstate_idx of order 0, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_idx< T > > * | st, |
| intg | s0 | ||
| ) |
Constructs a bstate_idx of order 1, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_idx< T > > * | st, |
| intg | s0, | ||
| intg | s1 | ||
| ) |
Constructs a bstate_idx of order 2, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_idx< T > > * | st, |
| intg | s0, | ||
| intg | s1, | ||
| intg | s2 | ||
| ) |
Constructs a bstate_idx of order 3, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_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 bstate_idx of order up to 8, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | parameter< T, bstate_idx< T > > * | st, |
| const idxdim & | d | ||
| ) |
Constructs a bstate_idx using the order and dimensions contained in passed idxdim d, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.
| ebl::bstate_idx< T >::bstate_idx | ( | const idx< T > & | x, |
| const idx< T > & | dx | ||
| ) |
constructors from other bstate_idx Constructs a bstate_idx from a bstate_idx's 3 internal idx Note: the data pointed to by idxs is not copied, we only create new idx pointing to the same data.
| void ebl::bstate_idx< T >::clear | ( | ) | [virtual] |
clear x and dx.
clear methods
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| bstate_idx< T > ebl::bstate_idx< T >::make_copy | ( | ) |
make a new copy of self
copy methods
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| bstate_idx< T > ebl::bstate_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.
| dimension | The dimension to slice. |
| slice_index | The size of the slize to return. |
| offset | The offset to start slicing. |
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| bstate_idx< T > & ebl::bstate_idx< T >::operator= | ( | const bstate_idx< T > & | other | ) | [virtual] |
Assignment operator, involves assignment of internal idx (avoid using this in critical loops).
| void ebl::bstate_idx< T >::pretty | ( | ) | [virtual] |
Prints idx metadata.
info printing methods
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| void ebl::bstate_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] |
resize. The order cannot be changed with this.
resize methods
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| void ebl::bstate_idx< T >::resize1 | ( | intg | dimn, |
| intg | size | ||
| ) | [virtual] |
resize one dimension <dimn> with size <size>. The order cannot be changed.
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.
| void ebl::bstate_idx< T >::resize_as | ( | bstate_idx< T > & | s | ) | [virtual] |
resizes this bstate_idx with same sizes a <s>. Both bstate_idx are required to have the same order.
| void ebl::bstate_idx< T >::resize_as_but1 | ( | bstate_idx< T > & | s, |
| intg | fixed_dim | ||
| ) | [virtual] |
same as resize_as but leave dimension <fixed_dim> untouched. Both bstate_idx are required to have the same order.
| bstate_idx< T > ebl::bstate_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.
| dimension | The dimension to slice. |
| slice_index | The slice to return. |
slicing methods
Reimplemented from ebl::fstate_idx< T >.
Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.