MachineIntelligenceCore:Algorithms
|
Template-typed Matrix of dynamic size. Uses OpenBLAS if found by CMAKE - overloaded, specializations of * operator for types: float, double. More...
#include <Matrix.hpp>
Public Member Functions | |
EIGEN_STRONG_INLINE | Matrix () |
EIGEN_STRONG_INLINE | Matrix (int Rows_, int Cols_) |
EIGEN_STRONG_INLINE | Matrix (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &vector_) |
EIGEN_STRONG_INLINE | Matrix (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix_) |
EIGEN_STRONG_INLINE | Matrix (mic::types::Tensor< T > &tensor_) |
EIGEN_STRONG_INLINE Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | operator= (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &mat_) |
EIGEN_STRONG_INLINE Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | operator* (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &mat_) |
void | setValue (T value_) |
void | enumerate () |
void | randn (T mean=0, T stddev=1) |
void | rand (T min=0, T max=1) |
void | elementwiseFunction (T(*func)(T)) |
void | elementwiseFunctionScalar (T(*func)(T, T), T scalar_) |
void | elementwiseFunctionMatrix (T(*func)(T, T), Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &mat_) |
void | matrixColumnVectorFunction (T(*func)(T, T), Eigen::Matrix< T, Eigen::Dynamic, 1 > &v_) |
void | matrixRowVectorFunction (T(*func)(T, T), Eigen::Matrix< T, Eigen::Dynamic, 1 > &v_) |
void | repeatVector (Eigen::Matrix< T, Eigen::Dynamic, 1 > &in) |
Eigen::Matrix< T, Eigen::Dynamic, 1 > | colwiseReturnMaxIndices () |
T | calculateCrossEntropy (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &targets_) |
void | zeros () |
T & | operator[] (int idx) |
T | operator[] (int idx) const |
template<> | |
Eigen::MatrixXd | operator* (const Eigen::MatrixXd &mat_) |
template<> | |
Eigen::MatrixXf | operator* (const Eigen::MatrixXf &mat_) |
Private Member Functions | |
template<class Archive > | |
void | save (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | load (Archive &ar, const unsigned int version) |
Friends | |
class | boost::serialization::access |
Template-typed Matrix of dynamic size. Uses OpenBLAS if found by CMAKE - overloaded, specializations of * operator for types: float, double.
T | Template parameter denoting elementary type of data used (int, float, double etc.) |
Definition at line 64 of file Matrix.hpp.
|
inline |
Constructor. Calls default Eigen::MatrixXf constructor.
Definition at line 71 of file Matrix.hpp.
|
inline |
Constructor. Calls default Eigen::MatrixXf constructor.
Rows_ | Number of rows. |
Cols_ | Number of columns. |
Definition at line 81 of file Matrix.hpp.
|
inline |
Copying constructor on the basis of a vector. Sets dimensions to rows = size(), cols = 1.
vector_ | Vector |
Definition at line 91 of file Matrix.hpp.
|
inline |
Copying constructor on the basis of another matrix.
matrix_ | Matrix to be copied. |
Definition at line 103 of file Matrix.hpp.
|
inline |
Copying constructor on the basis of a tensor. Copies dimensions and data. Note: tensor must be 2D.
tensor_ | Tensor |
Definition at line 116 of file Matrix.hpp.
References mic::types::Tensor< T >::data(), mic::types::Tensor< T >::dims(), and mic::types::Tensor< T >::size().
|
inline |
Calculates the cross entropy as measure of how accurate given matrix (treated as prediction) fits to the desired (target) matrix.
targets_ | Desired results (targets) in the form of a matrix of answers. |
Definition at line 396 of file Matrix.hpp.
|
inline |
Returns a vector of indices indicating maximal elements in consecutive matrix columns (colwise).
Definition at line 366 of file Matrix.hpp.
|
inline |
Applies elementwise function to all matrix elements.
func | Function to be applied. |
Definition at line 242 of file Matrix.hpp.
|
inline |
Applies elementwise function to all matrix elements and uses additional Matrix mat_ data as function parameter.
func | Function to be applied. |
mat_ | Matrix passed to function as argument. |
Definition at line 276 of file Matrix.hpp.
|
inline |
Applies elementwise function to all matrix elements passing scalar as function argument.
func | Function to be applied. |
scalar_ | Scalar passed to function as argument. |
Definition at line 259 of file Matrix.hpp.
|
inline |
Enumerates - sets values of elements to their indices.
Definition at line 185 of file Matrix.hpp.
Referenced by TEST().
|
inlineprivate |
Serialization load - loads the matrix object to archive.
ar | Used archive. |
version | Version of the matrix class. |
Definition at line 456 of file Matrix.hpp.
|
inline |
Applies function to all matrix elements and uses additional vector data as function parameter - columnwise.
func | Used function |
v_ | Vector passed to function |
Definition at line 299 of file Matrix.hpp.
|
inline |
Applies function to all matrix elements and uses additional vector data as function parameter - rowwise.
func | Used function |
v_ | Vector passed to function |
Definition at line 325 of file Matrix.hpp.
|
inline |
Definition at line 40 of file MatrixXdSpecializations.hpp.
|
inline |
Definition at line 43 of file MatrixXfSpecializations.hpp.
|
inline |
Overloaded multiplication operator.
mat_ | Input matrix |
Definition at line 162 of file Matrix.hpp.
|
inline |
Overloaded assignment operator - calls base operator.
mat_ | Input matrix |
Definition at line 149 of file Matrix.hpp.
|
inline |
Definition at line 419 of file Matrix.hpp.
|
inline |
Definition at line 423 of file Matrix.hpp.
|
inline |
Set values of all matrix elements to random numbers from range <min, max> - uniform distribution.
min | Min value. |
max | Max value. |
Definition at line 221 of file Matrix.hpp.
|
inline |
Set values of all matrix elements to random with a normal distribution.
mean | Mean |
stddev | Variance |
Definition at line 199 of file Matrix.hpp.
Referenced by TEST().
|
inline |
Sets the consecutive columns to be equal to given vector.
in | Input vector, that will be "cloned". |
Definition at line 352 of file Matrix.hpp.
|
inlineprivate |
Serialization save - saves the matrix object to archive.
ar | Used archive. |
version | Version of the matrix class. |
Definition at line 438 of file Matrix.hpp.
|
inline |
Sets values of all element to the value given as parameter.
value_ | The value to be set. |
Definition at line 173 of file Matrix.hpp.
|
inline |
|
friend |
Definition at line 430 of file Matrix.hpp.