views:

48

answers:

1

Hi there,

I'm wondering if it's possible for Neural Network to operate on matrices say I want to:

A(i)=matrix(10,10) -> B(i)=matrix(10,10) 
input = vector of matrices, i = sample size
output = vector of matrices

Say I would like to guess an matrix operation transforming matrix into another matrix ie

 f(A(i,j))=2*A(i,j)*b

Matlab does not take arrays with dimension >2 in NNtool

Any idea?

Thanks

A: 

You can simply convert the arrays into vectors before passing them to NNtool. It won't make a difference for the result of your calculation.

In other words, instead of passing A(:,:,i) to NNtool, you pass reshape(A(:,:,i),[],1). Then you reshape the output into a 10x10 array by using B = reshape(outputOfNNtool,10,10).

Jonas
Jonas - what You suggest is only partially good, because You loose index of matrix - It's not the same to represent data from 10 samples in 10 matrices and in one vector. Am I right?
Lewy
This will not result in what I want :/ Matrix representation, and structure is lost.
Lewy
`a = reshape(A(:,:,i),[],1);` is perfectly reversed by `A(:,:,i) = reshape(a,10,10);`, so no, you don't lose the index of the matrix. Also, unless you train the NN on relations between matrix elements, rather than on the value of the elements, it does not matter whether you present the data as array or vector.
Jonas

related questions