OpenANN/PyBrain : sparse input Vectors - neural-network

Does the OpenANN (or PyBrain or any other open-source scalable) project have support for sparse inputs vectors?For example input vectors represented in libsvm format? I want to build an autoencoder which basically finds a lower dimension representation for sparse high-dimension input vectors (something like a 100,000- dimension vector which has about 100 non-zero values). Is there some other library which would enable me to represent sparse input vectors and hence build an autoencoder for sparse input vectors?

Related

Getting a sparse vector from sparse matrix by sparse vector dot product in Swift

Swift's library "Accelerate" has sparse matrix types and several classes of functions for sparse matrix multiplication with different argument types, and BLAS-like functions with sparse matrices and vectors.
Interestingly, there are no functions that produce a sparse vector from a sparse matrix dot product with a sparse vector. (Or at least I did not see any in
Accelerate's documentation
.)
It looks like the workflow using
SparseVector_double for d = S . v
could be:
Convert the sparse vector v into a dense vector (or matrix)
Use the function SparseMultiply
Make the dense result d sparse
Alternative workflows with the BLAS functions are possible, say, using the function
sparse_matrix_product_sparse_double, but, again, the result is dense and has to be converted into a sparse vector/matrix.
I have several questions:
Is my conjecture that there is no direct way of getting a sparse vector from a dot product correct?
What is the fastest and easiest way to convert the dense vector/matrix results from the dot product functions into a sparse vector/matrix?
I should just scan the 0's with a loop, or there are relevant library functions?
What are the reasons none of these functions produce sparse structures?

How can I reduce extract features from a set of Matrices and vectors to be used in Machine Learning in MATLAB

I have a task where I need to train a machine learning model to predict a set of outputs from multiple inputs. My inputs are 1000 iterations of a set of 3x 1 vectors, a set of 3x3 covariance matrices and a set of scalars, while my output is just a set of scalars. I cannot use regression learner app because these inputs need to have the same dimensions, any idea on how to unify them?
One possible way to solve this is to flatten the covariance matrix into a vector. Once you did that, you can construct a 1000xN matrix where 1000 refers to the number of samples in your dataset and N is the number of features. For example if your features consist of a 3x1 vector, a 3x3 covariance matrix and lets say 5 other scalars, N could be 3+3*3+5=17. You then use this matrix to train an arbitrary model such as a linear regressor or more advanced models like a tree or the like.
When training machine learning models it is important to understand your data and exploit its structure to help the learning algorithms. For example we could use the fact that a covariance matrix is symmetric and positive semi-definite and thus lives in a closed convex cone. Symmetry of the matrix implies that it lives in a subspace of the set of all 3x3 matrices. In fact the dimension of the space of 3x3 symmetric matrices is only 6. You can use that knowledge to reduce redundancy in your data.

Adjacency matrix to show flow conservation in maxflow

I want to use adjacency matrix in MATLAB to solve a maximum flow problem formulated in Linear Programming. I want to try with adjacency matrix because using incidence matrix gives huge matrices due to the number of edges.

Direction of the normal vector to the decision hyper-plane of support vector machine

Given the coefficients of the hyper-plane of the support vector machine for classifying an mxn-dimensional dataset into two classes as an n-dimensional vector, how can we find out the direction (e.g. cosines) of the normal vector to that hyper-plane?
FYI, the coefficients and the support vectors were calculated by using the svmtrain function in Matlab.

MATLAB: Calculating AIC of a Linear Regression Model

I have a matrix X with each row containing one training set, and each column containing unique features; and a vector y with each row containing respective responses (or solutions) for X. I can create a Linear Model like so:
modl = fitlm(X,y)
How can I calculate the AIC value for the above model? Unfortunately, the aic() function in matlab is not defined for linear models.