You must make your indices interger like `B = T.ivector('B')`.
With that, you can do indexing to select just the values you want:
A[B]
Thean compute the mean on them:
C = A[B].mean()
If E should be a vector, you can concatenate C and D like this:
theano.tensor.concatenate([C, D])
Frédéric
On Mon, Sep 4, 2017 at 3:36 AM Shadekur Rahman <[email protected]>
wrote:
> I am quite new in theano. I am having problem to implement the following:
>
> import theano.tensor as T
> A = T.vector('A')
> B = T.vector('B') #represents list of indices of A
> C = T.scalar('C') #represents mean of A for certain indices stored in B
> D = T.vector('D')
> E = T.vector('E')
> # E should be concatenation of C and D with length (D.length+1)
> func = theano.function(inputs=[A,B,D],outputs=E)
>
> Can anyone give me idea how to calculate C and E?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.