0

In my Theano program, I want to split the tensor matrix into two parts, with each of them making different contributions to the error function. Can anyone tell me whether automatic differentiation support this?

For example, for a tensor matrix variable M, I want to split it into M1=M[:300,] and M2=M[300:,], then the cost function is defined as 0.5* M1 * w + 0.8*M2*w. Is it still possible to get the gradient with T.grad(cost,w)?

Or more specifically, I want to construct an Autoencoder with different features having different weights in contribution to the total cost.

Thanks for anyone who answers my question.

Jack Cheng
  • 121
  • 1
  • 11

1 Answers1

0

Theano support this out of the box. You have nothing particular to do. If Theano don't support something in the crash, it should raise an error. But you won't have it for this, if there isn't problem in the way you call it. But the current pseudo-code should work.

nouiz
  • 5,071
  • 25
  • 21