[theano-users] Re: Error in a simple scan code

2017-07-26 Thread Sunjeet Jena
Thank you. :)

On Thursday, 27 July 2017 00:42:00 UTC+5:30, Pascal Lamblin wrote:
>
> Since the step function only returns one single variable, the first value 
> returned by scan() is also one single variable. So it should be:
> h, _ = theano.scan(step , sequences=[x])
>
> If instead you use 
> [h], _ = theano.scan(step , sequences=[x])
> then it is trying to expand that variable into a list of one element, 
> which it is not able to do since it does not know its length.
>
> On Wednesday, July 26, 2017 at 8:56:03 AM UTC-4, Sunjeet Jena wrote:
>>
>>
>> Any idea why this code is not working?
>>
>>
>> import theano
>> from theano import tensor
>> from theano import shared
>> from theano import function
>> import numpy as np
>>
>> x=tensor.ivector('x')
>>
>> def step(u_t):
>>
>>
>> h=u_t*1 
>>
>> return h
>>
>> [h], _ = theano.scan(step , sequences=[x])
>>
>> f=function([x],[h])
>>
>> b=[1,2,3,4,5,6]
>> print(f(b))
>>
>> *Error is: *
>>
>> Traceback (most recent call last):
>>   File "Test1.py", line 31, in 
>> [h], _ = theano.scan(step , sequences=x)
>>   File "/usr/local/lib/python2.7/dist-packages/theano/tensor/var.py", 
>> line 596, in __iter__
>> for i in xrange(theano.tensor.basic.get_vector_length(self)):
>>   File "/usr/local/lib/python2.7/dist-packages/theano/tensor/basic.py", 
>> line 4685, in get_vector_length
>> raise ValueError("length not known: %s" % msg)
>> ValueError: length not known: for{cpu,scan_fn} [id A] ''   
>>  |Subtensor{int64} [id B] ''   
>>  | |Shape [id C] ''   
>>  | | |Subtensor{int64::} [id D] 'x[0:]'   
>>  | |   |x [id E]
>>  | |   |Constant{0} [id F]
>>  | |Constant{0} [id G]
>>  |Subtensor{:int64:} [id H] ''   
>>  | |Subtensor{int64::} [id D] 'x[0:]'   
>>  | |ScalarFromTensor [id I] ''   
>>  |   |Subtensor{int64} [id B] ''   
>>  |Subtensor{int64} [id B] ''   
>>
>> Inner graphs of the scan ops:
>>
>> for{cpu,scan_fn} [id A] ''   
>>  >Elemwise{mul,no_inplace} [id J] ''   
>>  > |x[t] [id K] -> [id H]
>>  > |TensorConstant{1} [id L]
>>
>>
>>
>>
>>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] How to update theano-0.9.0 to theano-0.10.0?

2017-07-26 Thread 김병수
Hello, my name is Kim, one of the heavy theano users.

At first, my OS is ubuntu 16.04-2 LTS

I recently installed theano through the command : 'conda install theano 
pygpu', which install the theano-0.9.0.

And updated the theano to bleeding edge version (theano-0.10.0) through the 
commands : 

'sudo pip install --no-deps
 git+https://github.com/Theano/Theano.git#egg=Theano'

'sudo pip install --upgrade --no-deps
 git+https://github.com/Theano/Theano.git#egg=Theano'

And it shows following messages, 

'Installing collected packages: Theano
  Found existing installation: Theano 0.10.0.dev1
Uninstalling Theano-0.10.0.dev1:
  Successfully uninstalled Theano-0.10.0.dev1
  Running setup.py install for Theano ... done
Successfully installed Theano-0.10.0.dev1'

But when I check the theano version, it shows that the theano version is 
still theano-0.9.0.

I suspect that the update is not reflected to the conda environment.

How can I upgrade to the theano-0.10.0?

Thanks, in advance. 




-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: Error in a simple scan code

2017-07-26 Thread Pascal Lamblin
Since the step function only returns one single variable, the first value 
returned by scan() is also one single variable. So it should be:
h, _ = theano.scan(step , sequences=[x])

If instead you use 
[h], _ = theano.scan(step , sequences=[x])
then it is trying to expand that variable into a list of one element, which 
it is not able to do since it does not know its length.

On Wednesday, July 26, 2017 at 8:56:03 AM UTC-4, Sunjeet Jena wrote:
>
>
> Any idea why this code is not working?
>
>
> import theano
> from theano import tensor
> from theano import shared
> from theano import function
> import numpy as np
>
> x=tensor.ivector('x')
>
> def step(u_t):
>
>
> h=u_t*1 
>
> return h
>
> [h], _ = theano.scan(step , sequences=[x])
>
> f=function([x],[h])
>
> b=[1,2,3,4,5,6]
> print(f(b))
>
> *Error is: *
>
> Traceback (most recent call last):
>   File "Test1.py", line 31, in 
> [h], _ = theano.scan(step , sequences=x)
>   File "/usr/local/lib/python2.7/dist-packages/theano/tensor/var.py", line 
> 596, in __iter__
> for i in xrange(theano.tensor.basic.get_vector_length(self)):
>   File "/usr/local/lib/python2.7/dist-packages/theano/tensor/basic.py", 
> line 4685, in get_vector_length
> raise ValueError("length not known: %s" % msg)
> ValueError: length not known: for{cpu,scan_fn} [id A] ''   
>  |Subtensor{int64} [id B] ''   
>  | |Shape [id C] ''   
>  | | |Subtensor{int64::} [id D] 'x[0:]'   
>  | |   |x [id E]
>  | |   |Constant{0} [id F]
>  | |Constant{0} [id G]
>  |Subtensor{:int64:} [id H] ''   
>  | |Subtensor{int64::} [id D] 'x[0:]'   
>  | |ScalarFromTensor [id I] ''   
>  |   |Subtensor{int64} [id B] ''   
>  |Subtensor{int64} [id B] ''   
>
> Inner graphs of the scan ops:
>
> for{cpu,scan_fn} [id A] ''   
>  >Elemwise{mul,no_inplace} [id J] ''   
>  > |x[t] [id K] -> [id H]
>  > |TensorConstant{1} [id L]
>
>
>
>
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: How to import the data of set of images into data-frame.

2017-07-26 Thread Pascal Lamblin
This does not seem to have anything to do with Theano.

On Sunday, July 23, 2017 at 10:32:08 AM UTC-4, Ali Alani wrote:
>
> I try to import the data of 3000 images to the data-frame each row 
> corresponds to one image. the problem with following code is only the last 
> image data store in the data-frame as shown below   
> 
>   
>
>
> from PIL import Image
> import glob
> image_list = []
> for filename in glob.glob('Images path\*.bmp'):
>img = PIL.Image.open(filename).convert("L")
>np1 = numpy.array(img)
>np_convert=numpy.invert(np1)
>flat_arr = np_convert.ravel()
>vector = np.matrix(flat_arr)
>image_list.append(vector)
>df_2 = pd.DataFrame(vector)
>
>
>
> 
>
>
> Please, any help to import all data into data-frame will be highly 
> appreciated
>
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: How to clip tensor value only in forward-pass, not in backward-pass?

2017-07-26 Thread Pascal Lamblin
You could implement a new op similar to clip, except the gradient would be 
1 everywhere.
An option to do that would be to use `OpFromGraph` and override the 
gradient.

On Saturday, July 22, 2017 at 7:42:06 PM UTC-4, Sihyeon Seong wrote:
>
>
> Hi, I found out T.clip(x, min, max) makes gradient zero when x is not in 
> [min, max]. 
>
> It would be useful if there is a function only clips value in the forward 
> pass, and calculate df/dx(x=max) at the backward-pass.
>
> Is the function I explained exist in Theano? Or, can somebody teach me how 
> to implement it? Thanks.
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: Scan checkpointing - what exactly theano stores?

2017-07-26 Thread Pascal Lamblin
I'm not sure I have all the details, but I think in principle, everything 
that is an output of the scan will be stored (if needed) for the backward 
pass.
For scan checkpointing, we basically hide explicit outputs inside another 
level of scan, which forces the recomputation during the backprop.
In order to do it the other way around, adding explicit outputs should make 
them available without recomputation.

On Friday, July 21, 2017 at 8:43:11 PM UTC-4, Alexander Botev wrote:
>
> So the scan checkpointing seems very ineteresting from the prespective 
> that it can be used for things like learning-to-learn.
> However, my question is can we tell Theano which part of each N-th 
> iteration it to store and which not? For instance in the learning-to-learn 
> framework where we unroll SGD
> the optimal would be to store only the "updated" parameters which get pass 
> to the next time step, rather than the whole computation. Is it possible to 
> achieve something like that? 
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: Implementing a GPU op

2017-07-26 Thread Pascal Lamblin
Indeed, there was an issue when using a later version of libgpuarray with 
the released version 0.9 of Theano.
This should be fixed when libgpuarray 0.6.9 is available.
See https://github.com/Theano/Theano/issues/6141

On Sunday, July 16, 2017 at 7:15:51 AM UTC-4, Christopher Bourez wrote:
>
> Moreover if you install Theano from scratch :
>
> conda install theano pygpu
>
> Fetching package metadata .
> Solving package specifications: .
>
> Package plan for installation in environment /root/miniconda2:
>
> The following NEW packages will be INSTALLED:
>
> libgpuarray: 0.6.8-0 
> pygpu:   0.6.8-py27_0
> theano:  0.9.0-py27_0
>
>
> you need to run the following correction after :
>
> conda install libgpuarray=0.6.4-0 pygpu=0.6.4
>
>
> And now that works on the server I was initially working on. 
>
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] NotImplementedError: In() instances and tuple inputs trigger the old semantics...

2017-07-26 Thread Pascal Lamblin
Indeed, this is the reason. "inputs" has to be a flat list of Theano 
Variables.

On Wednesday, July 19, 2017 at 10:36:47 AM UTC-4, Francesco Ciompi wrote:
>
> Hi,
>
> I found this message while looking for a solution to this same error 
> message.
> I am using theano 0.9 and python 3.5.
>
> The error I get is:
>
> "In() instances and tuple inputs trigger the old "
> NotImplementedError: In() instances and tuple inputs trigger the old 
> semantics, which disallow using updates and givens
>
> when trying to compile:
>
> self.train_fn = theano.function([input_var, target_var], [loss, out], 
> updates=updates)
>
> where input_var is actually a Python list of 3 tensor variables of the 
> same shape.
>
> Could this be the reason for this error? Are lists supported as type of 
> input variables?
>
> Thanks,
> Francesco
>
>
>
> On Friday, February 24, 2017 at 9:43:17 PM UTC+1, nouiz wrote:
>>
>> What is the running code? Did you update theano as the last message 
>> suggest? What is your Theano version?
>>
>> Make sure to use Theano 0.9beta1 or 0.9rc1. If the code come from the 
>> Deep learning tutorial, update it. Old combination of DLT and Theano could 
>> give this.
>>
>> Current Theano version don't raise this error anymore.
>>
>> Fred
>>
>> On Mon, Jun 9, 2014 at 5:10 PM Tariq Daouda  wrote:
>>
>>> Hello,
>>>
>>> Does anyone know what this error means?
>>>
>>> Traceback (most recent call last):
>>>   File "mlp.py", line 115, in 
>>> *nn.train([train_set_x[i]], [train_set_y[i]])*
>>>   File "mlp.py", line 75, in train
>>> *return theano.function(inputs = [x, y], outputs = self.cost, 
>>> updates = self.updates)*
>>>   File 
>>> "/u/daoudat/usr/lib/python2.6/site-packages/theano/compile/function.py", 
>>> line 205, in function
>>> "In() instances and tuple inputs trigger the old "
>>> *NotImplementedError: In() instances and tuple inputs trigger the old 
>>> semantics, which disallow using updates and givens*
>>>
>>> Concerning the inputs, train_set_x[i] is a numpy array and 
>>> train_set_y[i] is an integer.
>>>
>>> Cheers,
>>>
>>> Tariq Daouda
>>>
>>> -- 
>>>
>>> --- 
>>> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: WARNING (theano.gof.cmodule): OPTIMIZATION WARNING: Theano was not able to find the default g++ parameters. This is needed to tune the compilation to your specific CPU. This can slo

2017-07-26 Thread Pascal Lamblin
Which version of Theano are you using?
I think this error could happen before the 0.9 release.
I would encourage you to update to the latest development version.

On Tuesday, July 18, 2017 at 7:31:56 AM UTC-4, mai Khai wrote:
>
> Dear group,
> I ran into this problem when i ran a program using theano:
> "WARNING (theano.gof.cmodule): OPTIMIZATION WARNING: Theano was not able 
> to find the default g++ parameters. This is needed to tune the compilation 
> to your specific CPU. This can slow down the execution of Theano functions. 
> Please submit the following lines to Theano's mailing list so that we can 
> fix this problem:"
> Here is the content to submit: 
>
>  ['# 1 ""\n', '# 1 ""\n', '# 1 ""\n', '# 1 
> "/usr/include/stdc-predef.h" 1 3 4\n', '# 1 "" 2\n', '# 1 
> ""\n', 'Using built-in specs.\n', 'COLLECT_GCC=/usr/bin/g++\n', 
> 'Target: aarch64-linux-gnu\n', "Configured with: ../src/configure -v 
> --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4' 
> --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs 
> --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
> --program-suffix=-5 --enable-shared --enable-linker-build-id 
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
> --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu 
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes 
> --with-default-libstdcxx-abi=new --enable-gnu-unique-object 
> --disable-libquadmath --enable-plugin --with-system-zlib 
> --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo 
> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home 
> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 
> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 
> --with-arch-directory=aarch64 
> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch 
> --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release 
> --build=aarch64-linux-gnu --host=aarch64-linux-gnu 
> --target=aarch64-linux-gnu\n", 'Thread model: posix\n', 'gcc version 5.4.0 
> 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) \n', 
> "COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mlittle-endian' 
> '-mabi=lp64'\n", ' /usr/lib/gcc/aarch64-linux-gnu/5/cc1 -E -quiet -v 
> -imultiarch aarch64-linux-gnu - -mlittle-endian -mabi=lp64 
> -fstack-protector-strong -Wformat -Wformat-security\n', 'ignoring 
> nonexistent directory "/usr/local/include/aarch64-linux-gnu"\n', 'ignoring 
> nonexistent directory 
> "/usr/lib/gcc/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/include"\n', 
> '#include "..." search starts here:\n', '#include <...> search starts 
> here:\n', ' /usr/lib/gcc/aarch64-linux-gnu/5/include\n', ' 
> /usr/local/include\n', ' /usr/lib/gcc/aarch64-linux-gnu/5/include-fixed\n', 
> ' /usr/include/aarch64-linux-gnu\n', ' /usr/include\n', 'End of search 
> list.\n', 
> 'COMPILER_PATH=/usr/lib/gcc/aarch64-linux-gnu/5/:/usr/lib/gcc/aarch64-linux-gnu/5/:/usr/lib/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/5/:/usr/lib/gcc/aarch64-linux-gnu/\n',
>  
> 'LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/5/:/usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/5/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/5/../../../:/lib/:/usr/lib/\n',
>  
> "COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mlittle-endian' 
> '-mabi=lp64'\n"]
> error at line: 4592
>
> Best regard,
> Khai 
>
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [theano-users] dot product of sparse and dense matrix

2017-07-26 Thread Pascal Lamblin
You just have to declare a symbolic input variable representing the sparse 
matrix, use it in the computation graph, compile a theano.function, and 
then pass the value when calling it.
See the examples at 
http://deeplearning.net/software/theano/library/sparse/index.html#csr-matrix 
in particular.

On Monday, July 17, 2017 at 11:55:50 AM UTC-4, Lalit Pradhan wrote:
>
> Hi, 
>
> I have:
> A scipy sparse matrix 'csr' with shape (262144, 262144)  and 6522916 non 
> zero rows
> and 
> A theano tensor variable, a flattened (512*512) = 262144 output of a 
> feature map.
>
> I want to do a dot product in theano between them. How can i convert the 
> scipy sparse matrix into a theano sparse matrix? How do I go about this 
> task?
>
> Thanks,
> Lalit
>
>
>
> On Tuesday, March 5, 2013 at 2:21:43 AM UTC+5:30, Frédéric Bastien wrote:
>>
>> I split the PR, the new PR is: https://github.com/Theano/Theano/pull/1264 
>>
>> I updated your name. 
>>
>> thanks 
>>
>> Fred 
>>
>> On Mon, Mar 4, 2013 at 3:08 PM, bizso09  wrote: 
>> > thank you for the credit. If we are going formal, you can include my 
>> real 
>> > name which is Zsolt Bitvai, no less peculiar 
>> > 
>> > 
>> > On Mon, Mar 4, 2013 at 6:43 PM, Frédéric Bastien  
>> wrote: 
>> >> 
>> >> The fix are in PR: https://github.com/Theano/Theano/pull/1263 
>> >> 
>> >> thanks for the report. 
>> >> 
>> >> Fred 
>> >> 
>> >> On Mon, Mar 4, 2013 at 1:40 PM, Frédéric Bastien  
>> wrote: 
>> >> > I have a fix in preparation. 
>> >> > 
>> >> > The problem is sparse.Dot.make_node. It was always making a matrix 
>> >> > output even if the inputs aren't matrices. 
>> >> > 
>> >> > Fred 
>> >> > 
>> >> > On Mon, Mar 4, 2013 at 1:35 PM, Pascal Lamblin 
>> >> >  wrote: 
>> >> >> On Mon, Mar 04, 2013, bizso09 wrote: 
>> >> >>> theano.printing.debugprint(r) 
>> >> >>> 
>> >> >>> SparseDot [@A] '' 
>> >> >>>  |SparseVariable{csc,float64} [@B] 
>> >> >>>  |Subtensor{::, 3} [@C] '' 
>> >> >>>|W [@D] 
>> >> >> 
>> >> >> I'm guessing the problem is that SparseDot.infer_shape returns 
>> >> >> something 
>> >> >> of length 1, because one of the inputs is a vector, but it should 
>> be of 
>> >> >> length 2, because the output is a sparse matrix, as there are no 
>> sparse 
>> >> >> vectors. 
>> >> >> 
>> >> >>> I'm running '0.6.0rc3' When I try to upgrade I get an error 
>> though. 
>> >> >>> 
>> >> >>> sudo pip install --upgrade theano 
>> >> >>> Command python setup.py egg_info failed with error code 1 in 
>> >> >>> /home/user/build/scipy 
>> >> >> 
>> >> >> 0.6.0rc3 is the last release candidate at the moment, so it's OK. 
>> >> >> In the future, you should run "sudo pip install --upgrade --no-deps 
>> >> >> theano". 
>> >> >> The "--no-deps" bit ensures you upgrade only Theano, not scipy and 
>> >> >> numpy. 
>> >> >> 
>> >> >> -- 
>> >> >> Pascal 
>> >> >> 
>> >> >> -- 
>> >> >> 
>> >> >> --- 
>> >> >> 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/groups/opt_out. 
>> >> >> 
>> >> >> 
>> >> 
>> >> -- 
>> >> 
>> >> --- 
>> >> You received this message because you are subscribed to a topic in the 
>> >> Google Groups "theano-users" group. 
>> >> To unsubscribe from this topic, visit 
>> >> 
>> https://groups.google.com/d/topic/theano-users/_rEHTO06utQ/unsubscribe?hl=en.
>>  
>>
>> >> To unsubscribe from this group and all its topics, send an email to 
>> >> theano-users...@googlegroups.com. 
>> >> 
>> >> For more options, visit https://groups.google.com/groups/opt_out. 
>> >> 
>> >> 
>> > 
>> > -- 
>> > 
>> > --- 
>> > 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/groups/opt_out. 
>> > 
>> > 
>>
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Re: Non-machine learning applications for Theano?

2017-07-26 Thread Pascal Lamblin
I would say PyMC3 https://github.com/pymc-devs/pymc3, which uses Theano for 
probabilistic programming.

On Thursday, July 13, 2017 at 9:06:20 PM UTC-4, Prashant Raina wrote:
>
> Does anyone have any ideas for using Theano for other things besides 
> machine learning?
> Do such projects already exist?
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[theano-users] Error in a simple scan code

2017-07-26 Thread Sunjeet Jena

Any idea why this code is not working?


import theano
from theano import tensor
from theano import shared
from theano import function
import numpy as np

x=tensor.ivector('x')

def step(u_t):


h=u_t*1 

return h

[h], _ = theano.scan(step , sequences=[x])

f=function([x],[h])

b=[1,2,3,4,5,6]
print(f(b))

*Error is: *

Traceback (most recent call last):
  File "Test1.py", line 31, in 
[h], _ = theano.scan(step , sequences=x)
  File "/usr/local/lib/python2.7/dist-packages/theano/tensor/var.py", line 
596, in __iter__
for i in xrange(theano.tensor.basic.get_vector_length(self)):
  File "/usr/local/lib/python2.7/dist-packages/theano/tensor/basic.py", 
line 4685, in get_vector_length
raise ValueError("length not known: %s" % msg)
ValueError: length not known: for{cpu,scan_fn} [id A] ''   
 |Subtensor{int64} [id B] ''   
 | |Shape [id C] ''   
 | | |Subtensor{int64::} [id D] 'x[0:]'   
 | |   |x [id E]
 | |   |Constant{0} [id F]
 | |Constant{0} [id G]
 |Subtensor{:int64:} [id H] ''   
 | |Subtensor{int64::} [id D] 'x[0:]'   
 | |ScalarFromTensor [id I] ''   
 |   |Subtensor{int64} [id B] ''   
 |Subtensor{int64} [id B] ''   

Inner graphs of the scan ops:

for{cpu,scan_fn} [id A] ''   
 >Elemwise{mul,no_inplace} [id J] ''   
 > |x[t] [id K] -> [id H]
 > |TensorConstant{1} [id L]




-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.