Šarūnas S.
2017-05-05 08:15:26 UTC
In my current theano script the bottleneck is equivalent to the following
numpy code:
import numpy as np
# 3D example
axis = 0
prob = np.random.random( ( 1, 1000, 50 ) )
cases = np.random.random( ( 1000, 1000, 50 ) )
start = time.time( )
for i in xrange( 1000 ):
result = ( cases * prob ).sum( axis=1-axis, keepdims=True )
print '3D naive method took {} seconds'.format( time.time() - start )
print result.shape
print
I had seen in 2D case that replacing elementwise+sum with a dot product
gave me 5x speedup. Are there any theano matrix operations that could help
me out here?
numpy code:
import numpy as np
# 3D example
axis = 0
prob = np.random.random( ( 1, 1000, 50 ) )
cases = np.random.random( ( 1000, 1000, 50 ) )
start = time.time( )
for i in xrange( 1000 ):
result = ( cases * prob ).sum( axis=1-axis, keepdims=True )
print '3D naive method took {} seconds'.format( time.time() - start )
print result.shape
I had seen in 2D case that replacing elementwise+sum with a dot product
gave me 5x speedup. Are there any theano matrix operations that could help
me out here?
--
---
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 theano-users+***@googlegroups.com.
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 theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.