Re: [theano-users] How to build different average pooling operation I'll call it local average pooling ?

2017-08-09 Thread Jesse Livezey
I think this idea would be something like y = [1, 2, 3, 0] y_current_avgpool = (1 + 2 + 3 + 0) / 4 y_new_avgpool = (1 + 2 + 3) / 3 I'm not sure that there is a simple way to do this currently. You could do sum pooling first, then compute the divisors by looking at the number of non-zero

[theano-users] Re: Theano GPU results not reproducible

2017-07-19 Thread Jesse Livezey
Some operations on GPU are not deterministic. I think some convolution operations and also reduction operations are two examples. See this thread for more info https://groups.google.com/forum/#!searchin/theano-users/atomic$20add%7Csort:relevance/theano-users/g-BF6zwMirM/ojWzbUBPBwAJ On Tuesday,

[theano-users] Re: Error performing 2D convolution on Binomial distribution sample (gemm error)

2017-07-18 Thread Jesse Livezey
FYI, I created an issue to improve the error messages https://github.com/Theano/Theano/issues/6167 On Tuesday, July 18, 2017 at 12:18:53 PM UTC-7, Jesse Livezey wrote: > > The conv2d operation doesn't support int64 (th_sampled) and it looks like > it doesn't fail gracefully with a sensi

[theano-users] Re: Error performing 2D convolution on Binomial distribution sample (gemm error)

2017-07-18 Thread Jesse Livezey
The conv2d operation doesn't support int64 (th_sampled) and it looks like it doesn't fail gracefully with a sensible error message when the GpuCorrMM op is used. If you cast th_sampled to float32 it should work fine. You'll also need to cast kernel. On Tuesday, July 18, 2017 at 2:07:36 AM

[theano-users] Re: About theano.function inside for loop

2017-07-12 Thread Jesse Livezey
Yes, you should be able to just call theano.function(...) before the loops. On Wednesday, July 12, 2017 at 4:13:33 AM UTC-7, Kelvin Chiu wrote: > > for x in range(x_range): > for y in range(y_range): > t_test_set_x = theano_translation(test_set_x, x, y, borrow=True) >

[theano-users] Re: How to implement binary activation in theano?

2017-07-12 Thread Jesse Livezey
Do you need to take derivatives through the activation? If not, then you could use switch, i.e. x = some theano variable threshold = .5 x_binary = T.switch(x > theshold, 1., 0.) On Wednesday, July 12, 2017 at 10:27:32 AM UTC-7, zxzh...@gmail.com wrote: > > In the binarized network github code

Re: [theano-users] Re: How create activation function from scratch in python

2017-07-07 Thread Jesse Livezey
Here you're treating val like it is a symbolic theano variable T.log(val) But here you're treating it like a numpy array and passing it into a compiled theano function return f_switch(val, 0, val, val) Maybe you're intending to just return the function f_switch and then call it with values?

[theano-users] Re: How can implemeant BackPropagation through time in Theano?

2017-06-18 Thread Jesse Livezey
You can use the scan function to create RNN architectures. http://deeplearning.net/software/theano/library/scan.html On Sunday, June 18, 2017 at 4:13:44 PM UTC-7, Sunjeet Jena wrote: > > I am building a multi-layer RNN network and thus need a way to back > propagate through time in Theano. Does

[theano-users] Re: Modify theano MLP class object with multiple outputs

2017-05-31 Thread Jesse Livezey
Theano functions can have multiple outputs. What error are you getting? On Monday, May 29, 2017 at 2:52:17 PM UTC-7, rogelio andrade wrote: > > Hi > > > I am using this theano code MLP > which implements a > variational AE. I am interested on

[theano-users] Re: tensor grad with respect to shared variable

2017-05-18 Thread Jesse Livezey
t will have dtype "int64" because 5 is an integer. If you do t = theano.shared(5.,'t') # added period after 5 it should work On Thursday, May 18, 2017 at 2:59:17 AM UTC-7, phamminhquang pham wrote: > > I have tried following code and it's result confuse me. > > import theano > import

[theano-users] Re: Classic error: Expected an array-like object, but found a Variable

2017-05-18 Thread Jesse Livezey
That isn't a normal way to use theano. Have you read about creating theano functions with "updates" dictionaries? There are simple examples here: http://deeplearning.net/software/theano/tutorial/examples.html#using-shared-variables On Sunday, May 14, 2017 at 3:05:01 AM UTC-7, Mohamed Akrout

[theano-users] Re: Is there a way to speed this operation in theano

2017-05-08 Thread Jesse Livezey
e: >> >> I have tried that, but to no avail. The problem is that I have to >> multiply on 2 axes, but sum only on 1. >> >> On Friday, 5 May 2017 19:23:12 UTC+3, Jesse Livezey wrote: >>> >>> I think tensordot should do what you want &g

[theano-users] Re: Is there a way to speed this operation in theano

2017-05-05 Thread Jesse Livezey
I think tensordot should do what you want http://deeplearning.net/software/theano/library/tensor/basic.html#theano.tensor.tensordot something like result = T.tensordot(prob, cases, axes=1) On Friday, May 5, 2017 at 3:17:14 AM UTC-7, Šarūnas S. wrote: > > I was shown that in *numpy* I could

Re: [theano-users] improving fft performance on cpu

2017-04-19 Thread Jesse Livezey
>From tests I've done, the MKL fft library is comparable and sometimes faster than the FFTW package. Both are much faster than the numpy fft. It's available in the accelerate package from Continuum (mkl conda package only has blas). It also looks like intel has a free conda channel, which

[theano-users] Re: RuntimeError: Mixed dnn version. The header is version 5105 while the library is version 5110.

2017-04-17 Thread Jesse Livezey
Sounds like the cudnn header and libraries are not consistent. When you install cudnn, did you move all of the files into the correct cuda folders? On Monday, April 17, 2017 at 8:30:03 PM UTC-7, Robert Lee wrote: > > I'm trying to get theano to work with keras. My program runs fine with >

[theano-users] Re: Decrypting theano scan error message

2017-03-28 Thread Jesse Livezey
It looks like originally x was a list of ints. Your x is a vector. I think what you currently have written will take one element of the vector x per time step and so T.dot(W_xh, x_t) will be a matrix times a scalar which is probably leading to your shape problems. Do you have a sequence of

Re: [theano-users] Re: IfElse GPU version

2017-03-25 Thread Jesse Livezey
> > I have decided to precompile a general graph in which all the possible > graphs are nested. Then during realtime I would set which parts of the > general graph to use using the *allowed_branch* variables and *if* nodes. > Since afaik ifs are evaluated lazily in each case I would only be

Re: [theano-users] What i do wrong when I use theano in production?

2017-03-25 Thread Jesse Livezey
Rather than using givens, and getting the batch through indexing, you can just have a theano variable be an input to your function. You should only need to compile the function once if your model does not change. You should be able to do something like this (you may need to modify this since I

[theano-users] Re: about conv2d on CPU

2017-03-21 Thread Jesse Livezey
That is correct as of theano 0.8 (I think). If you use the bleeding edge version of theano, you can let CorrMM use openmp to parallelize across batches. If you have more than 2 cores, this should give additional speedup. GPUs are going to be much faster than CPUs generally, if you have large

[theano-users] Re: Some help optimizing a function involving 1D dot products for multidimensional tensors

2017-03-16 Thread Jesse Livezey
If I'm understanding your code correctly, you should be able to use tensordot http://deeplearning.net/software/theano/library/tensor/basic.html#theano.tensor.tensordot rather than doing the multiply and sum. On Thursday, March 16, 2017 at 10:59:14 AM UTC-4, Eelke Spaak wrote: > > Apologies for

[theano-users] Re: AlexNet_theano_generate_toy_data.sh problems

2017-03-13 Thread Jesse Livezey
You can probably modify line 27 in make_labels.py to be for ind in range(labels.size // batch_size): This code was probably written with python 2 where division worked differently. On Monday, March 13, 2017 at 8:45:39 AM UTC-7, Goffredo Giordano wrote: > > Hi, > I'm a new user and I'm trying to

[theano-users] Re: Gradients are always 0 for custom loss function

2017-03-06 Thread Jesse Livezey
; everywhere except the discontinuous point at which the function equals 1, > but I'm having trouble imagining what the gradient would be for something > like T.set_subtensor, which also seems to have a 0 gradient. > > On Monday, March 6, 2017 at 11:38:59 AM UTC-6, Jesse Livezey wrote

[theano-users] Re: Gradients are always 0 for custom loss function

2017-03-06 Thread Jesse Livezey
it in this line: > > pred_up = T.flatten(pred_one_hot[T.eq(unchanged_col, 0).nonzero(), > preprocess.up_index]) > > Is T.eq ok to use in some contexts and not others? > > On Sunday, March 5, 2017 at 9:14:20 PM UTC-6, Jesse Livezey wrote: >> >> The gradi

[theano-users] Re: Gradients are always 0 for custom loss function

2017-03-05 Thread Jesse Livezey
The gradient of T.eq will be zero (almost) everywhere and you're using it to compute num_win and num_lose. On Sunday, March 5, 2017 at 2:42:14 PM UTC-8, tarom...@alum.northwestern.edu wrote: > > Also, the return values of this loss function are small compared to > cross-entropy, some sample

[theano-users] Re: Keeping word embeddings static

2017-02-21 Thread Jesse Livezey
If your model returns the embedding matrix in self.model.params here https://github.com/attapol/nn_discourse_parser/blob/534a633d87d671126f135ccebfaa9817947730a7/nets/learning.py#L186 then it will be updated since everything returned in that line gets optimized. If you don't want it to be

[theano-users] Re: Logistic Regression for Semantic Segmentation

2017-02-13 Thread Jesse Livezey
The first line should probably be logits = x.dot(w) + b.dimshuffle('x', 0') On Monday, February 13, 2017 at 3:05:34 PM UTC-8, Jesse Livezey wrote: > > You haven't used w or b in the graph to compute the cost function. You > need to add something like > > logits = w.dot(x) + b.di

[theano-users] Re: Logistic Regression for Semantic Segmentation

2017-02-13 Thread Jesse Livezey
You haven't used w or b in the graph to compute the cost function. You need to add something like logits = w.dot(x) + b.dimshuffle('x', 0') logitsdev = logits - logits.max(1, keepdims=True) you probably also want b to be of length 257 rather than a scalar. On Monday, February 13, 2017 at

Re: [theano-users] Re: How to get the value of theano tensor variable

2017-01-28 Thread Jesse Livezey
s type of variable? > > > On Saturday, January 28, 2017 at 6:27:24 AM UTC+5:30, Jesse Livezey wrote: > > You can use eval > > http://deeplearning.net/software/theano/library/gof/graph.html#theano.gof.graph.Variable.eval > > On Friday, January 27, 2017 at 4:39:56 PM UTC-8, chathu

[theano-users] Re: How to get the value of theano tensor variable

2017-01-27 Thread Jesse Livezey
You can use eval http://deeplearning.net/software/theano/library/gof/graph.html#theano.gof.graph.Variable.eval On Friday, January 27, 2017 at 4:39:56 PM UTC-8, chathu matharage wrote: > > Hi, > Is there a method to print the value of a tensor variable? > -- --- You received this message

[theano-users] Re: How should I concatenate the matrices in a tensor?

2016-12-26 Thread Jesse Livezey
You can use reshape rather than concatenate (similar to how you could do it in numpy). On Saturday, December 24, 2016 at 2:48:58 AM UTC-5, Quanty wrote: > > I know there is a T.concatenate function but the input of it can only be > list. But the output of theano.scan is a tensor. For example, I

[theano-users] Re: Concurrent GPU threads in Theano

2016-10-27 Thread Jesse Livezey
If you can create a theano vector that has all of the i's and a second theano vector that has all of the j's, then you can just do i*j and will will perform all of the multiplications in parallel. On Wednesday, October 26, 2016 at 11:48:06 PM UTC-7, kd...@cornell.edu wrote: > > I would like to

[theano-users] Re: Can't import Theano!!! configparser.DuplicateSectionError: While reading from '/home/rik/.theanorc' [line 6]: section 'nvcc' already exists

2016-10-11 Thread Jesse Livezey
What are the contents of this file? /home/rik/.theanorc Does is have [nvcc] multiple times? On Monday, October 10, 2016 at 9:00:52 PM UTC-7, Rik wrote: > > Hey all, > > Python won't let me import theano. Here is the error I get: > > >>> import theano > Traceback (most recent call last): > File

[theano-users] Re: Input error(extra dimensions) at theano.function

2016-09-06 Thread Jesse Livezey
Your inputs should be tensor4 rather than matrix if you're passing them into a CNN. On Tuesday, September 6, 2016 at 7:22:38 AM UTC-7, Ganesh Iyer wrote: > > > Hi guys, > > I'm new to this group and theano in general. I'm trying to send 2 image > patches, greyscale ( 2D numpy arrays of size

[theano-users] Re: error 4D input data

2016-09-06 Thread Jesse Livezey
One of your labels is too large, or possibly too small. Are your labels from 0 to n-1 or 1 to n? They should be 0 to n-1. On Tuesday, September 6, 2016 at 2:19:18 AM UTC-7, Beatriz G. wrote: > > HI everyone > > I am trying to use 4 dimension image, but I get the following error and I > do not

Re: [theano-users] TypeError: unhashable type: 'numpy.ndarray'

2016-08-31 Thread Jesse Livezey
@Fred and Pascal, I think Beatriz's question was answered in another thread. On Wednesday, August 31, 2016 at 12:58:11 PM UTC-7, Pascal Lamblin wrote: > > `salidas_capa3` is a theano function, which is a callable object. > However, you are trying to _index_ into it using >

[theano-users] Re: get test labels

2016-08-02 Thread Jesse Livezey
help, really, really thankful. > > > El viernes, 29 de julio de 2016, 4:00:51 (UTC+2), Jesse Livezey escribió: >> >> I think you just want to do >> >> for i in range(n_test_batches): >> test_losses = [test_model(i)] >> y_pred_test = salidas_cap

[theano-users] Re: get test labels

2016-07-26 Thread Jesse Livezey
You should be able to use this function to output y_pred salidas_capa3 = theano.function( [index], layer3.y_pred, givens={ x: test_set_x[index * batch_size: (index + 1) * batch_size], } ) On Monday, July 25, 2016 at 3:09:09 AM UTC-7, Beatriz

[theano-users] Re: Non-linear convolution

2016-07-25 Thread Jesse Livezey
You could do the L2 norm using the regular convolution by using the identity ||w-x||^2 = ||w||^2-2||w dot x||+||x||^2 and using http://deeplearning.net/software/theano/library/tensor/nnet/neighbours.html#theano.tensor.nnet.neighbours.images2neibs to help with the ||x||^2 and regular convolution