:
On Fri, Sep 6, 2013 at 10:19 AM, James Bergstra bergs...@iro.umontreal.ca
wrote:
Hi, could someone help me understand why this assertion fails?
def test_is(self):
a = np.empty(1)
b = np.empty(1)
if a.data is not b.data:
assert id(a.data) != id(b.data) # -- fail
I'm
Hi, could someone help me understand why this assertion fails?
def test_is(self):
a = np.empty(1)
b = np.empty(1)
if a.data is not b.data:
assert id(a.data) != id(b.data) # -- fail
I'm trying to write an alternate may_share_memory function.
Thanks,
- James
wrote:
On Fri, Sep 6, 2013 at 5:58 PM, James Bergstra bergs...@iro.umontreal.ca
wrote:
I'm stumped. I can't figure out how to extract from e.g.
view = A[:, 3]
that the view starts at element 3 of A. I was planning to make a
may_share_memory implementation based on the idea of swapping
at 12:48 PM, James Bergstra
bergs...@iro.umontreal.cawrote:
Thanks for the tips! FWIW my guess is that since '.data' is dynamically
generated property rather than an attribute, it is being freed and
re-allocated in the loop, and once for each of my id() expressions.
On Fri, Sep 6, 2013 at 12
On Thu, Jun 14, 2012 at 4:00 AM, Olivier Grisel
olivier.gri...@ensta.org wrote:
2012/6/13 James Bergstra bergs...@iro.umontreal.ca:
Further to the recent discussion on lazy evaluation numba, I moved
what I was doing into a new project:
PyAutoDiff:
https://github.com/jaberg/pyautodiff
On Thu, Jun 14, 2012 at 3:38 PM, Nathaniel Smith n...@pobox.com wrote:
On Thu, Jun 14, 2012 at 7:53 PM, James Bergstra
bergs...@iro.umontreal.ca wrote:
On Thu, Jun 14, 2012 at 11:01 AM, Nathaniel Smith n...@pobox.com wrote:
Indeed that would be great as sympy already has already excellent
On Thu, Jun 14, 2012 at 4:22 PM, srean srean.l...@gmail.com wrote:
For example, I wrote a library routine for doing log-linear
regression. Doing this required computing the derivative of the
likelihood function, which was a huge nitpicky hassle; took me a few
hours to work out and debug. But
On Thu, Jun 14, 2012 at 5:53 PM, Nathaniel Smith n...@pobox.com wrote:
On Thu, Jun 14, 2012 at 9:22 PM, srean srean.l...@gmail.com wrote:
No, I'm saying I totally see the advantages. Here's the code I'm talking
about:
def _loglik(self, params):
alpha, beta =
Further to the recent discussion on lazy evaluation numba, I moved
what I was doing into a new project:
PyAutoDiff:
https://github.com/jaberg/pyautodiff
It currently works by executing CPython bytecode with a numpy-aware
engine that builds a symbolic expression graph with Theano... so you
can
On Mon, Jun 11, 2012 at 12:03 AM, James Bergstra
bergs...@iro.umontreal.ca wrote:
If anyone is interested in my ongoing API bytecode adventure in why
/ how lazy computing could be useful, I've put together a few tiny
hypothetically-runnable examples here:
https://github.com/jaberg/numba/tree
Hi all, (sorry for missing the debate, I don't often check my
numpy-list folder.)
I agree that an official numpy solution to this problem is
premature, but at the same time I think the failure to approach
anything remotely resembling a consensus on how to deal with lazy
evaluation is really
bincount([]) makes no sense, but if a minlength argument is provided,
then the routine should succeed.
It fails in 1.6.1, has it been fixed in master?
- James
--
http://www-etud.iro.umontreal.ca/~bergstrj
___
NumPy-Discussion mailing list
On Sat, Feb 25, 2012 at 5:13 PM, Alan G Isaac alan.is...@gmail.com wrote:
On 2/25/2012 4:44 PM, James Bergstra wrote:
bincount([]) makes no sense,
I disagree:
http://permalink.gmane.org/gmane.comp.python.numeric.general/42041
gmane is down to me at the moment, but if this argues
# re-run the compiled expression on the new value
a, b = expr.run()
- JB
--
James Bergstra, Ph.D.
Research Scientist
Rowland Institute, Harvard University
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo
On Mon, Feb 20, 2012 at 1:01 PM, James Bergstra james.bergs...@gmail.comwrote:
On Mon, Feb 20, 2012 at 12:28 PM, Francesc Alted franc...@continuum.iowrote:
On Feb 20, 2012, at 6:18 PM, Dag Sverre Seljebotn wrote:
You need at least a slightly different Python API to get anywhere, so
numexpr
Looks like Dag forked the discussion of lazy evaluation to a new thread
([Numpy-discussion] ndarray and lazy evaluation).
There are actually several projects inspired by this sort of design: off
the top of my head I can think of Theano, copperhead, numexpr, arguably
sympy, and some non-public
On Mon, Feb 20, 2012 at 2:57 PM, Lluís xscr...@gmx.net wrote:
James Bergstra writes:
[...]
I should add that the biggest benefit of expressing things as compound
expressions in this way is not in saving temporaries (though that is
nice) it's
being able to express enough computation work
On Thu, Jul 7, 2011 at 4:59 PM, James Bergstra
bergs...@iro.umontreal.ca wrote:
On Thu, Jul 7, 2011 at 1:10 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Thu, Jul 7, 2011 at 11:03 AM, James Bergstra bergs...@iro.umontreal.ca
wrote:
In numpy 1.5.1, the functions PyArray_MoveInto
In numpy 1.5.1, the functions PyArray_MoveInto and PyArray_CopyInto
don't appear to treat strides correctly.
Evidence:
PyNumber_InPlaceAdd(dst, src), and modifies the correct subarray to
which dst points.
In the same context, PyArray_MoveInto(dst, src) modifies the first two
rows of the
On Thu, Jul 7, 2011 at 1:10 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Thu, Jul 7, 2011 at 11:03 AM, James Bergstra bergs...@iro.umontreal.ca
wrote:
In numpy 1.5.1, the functions PyArray_MoveInto and PyArray_CopyInto
don't appear to treat strides correctly.
Evidence
I find that numpy.max(0, 1e-6) == 0 is confusing, because it makes bugs
hard to spot. The doc says that the second argument to max is an optional
integer. My bad.
But could the function raise an error if it is passed an invalid 'axis'
argument? That would have helped.
James
--
On Tue, Apr 6, 2010 at 10:08 AM, David Cournapeau wrote:
could be put out of multiarray proper. Also, exposing an API for
things like fancy indexing would be very useful, but I don't know if
it even makes sense - I think a pure python implementation of fancy
indexing as a reference would be
and it will instead use an available CUDA-
capable Nvidia GPU instead of the CPU. I'll admit, when James Bergstra
initially told me about this plan to make it possible to transparently
switch to running stuff on the GPU, I thought it was so ambitious that
it would never happen. Then it did
Thanks all for your help, I think I'm on my way again.
The catch in the first place was not being confident that a
PyArray_Scalar was the thing I needed. I grep'd the code for uint8,
int8 and so on and could not find their definitions.
On first reading I overlooked the PyArray_Scalar link in
On Mon, Mar 1, 2010 at 1:44 AM, David Cournapeau courn...@gmail.com wrote:
On Mon, Mar 1, 2010 at 1:35 PM, James Bergstra
bergs...@iro.umontreal.ca wrote:
Could someone point me to documentation (or even numpy src) that shows
how to allocate a numpy.int8 in C, or check to see if a PyObject
On Tue, Mar 2, 2010 at 3:09 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
James Bergstra wrote:
Maybe I'm missing something... but I don't think I want to create an array.
In [3]: import numpy
In [4]: type(numpy.int8())
Out[4]: type 'numpy.int8'
In [5]: isinstance(numpy.int8
On Tue, Mar 2, 2010 at 7:18 PM, Warren Weckesser
warren.weckes...@enthought.com wrote:
James Bergstra wrote:
On Tue, Mar 2, 2010 at 3:09 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
James Bergstra wrote:
Maybe I'm missing something... but I don't think I want to create an array
On Tue, Mar 2, 2010 at 7:32 PM, David Warde-Farley d...@cs.toronto.edu wrote:
On 2-Mar-10, at 7:23 PM, James Bergstra wrote:
Sorry... again... how do I make such a scalar... *in C* ? What would
be the recommended C equivalent of this python code? Are there C
type-checking functions
Could someone point me to documentation (or even numpy src) that shows
how to allocate a numpy.int8 in C, or check to see if a PyObject is a
numpy.int8?
Thanks,
James
--
http://www-etud.iro.umontreal.ca/~bergstrj
___
NumPy-Discussion mailing list
In case this hasn't been solved in more recent numpy...
I've tried the following lines on two installations of numpy 1.3 with python 2.6
numpy.random.binomial(n=numpy.asarray([2,3,4], dtype='int64'),
p=numpy.asarray([.1, .2, .3], dtype='float64'))
A 64bit computer gives an output of array
Your question involves a few concepts:
- an integer vector describing the position of an element
- the logical shape (another int vector)
- the physical strides (another int vector)
Ignoring the case of negative offsets, a physical offset is the inner
product of the physical strides with the
On Tue, Nov 17, 2009 at 9:53 PM, Robert Kern robert.k...@gmail.com wrote:
On Tue, Nov 17, 2009 at 20:48, James Bergstra bergs...@iro.umontreal.ca
wrote:
Is it by design that numpy.sqrt(None) raises an AttributeError: sqrt?
Yes. numpy.sqrt() is a ufunc. Ufuncs take their arguments and try
Is it by design that numpy.sqrt(None) raises an AttributeError: sqrt?
This was confusing because there was an attribute lookup of 'sqrt' in
numpy right there in the expression I typed, but that was not the
attribute that python was complaining about. I presume that numpy.sqrt
didn't know what
On Tue, Nov 10, 2009 at 7:07 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
Hi all,
I have a bunch of points in 2-d space, and I need to find out which
pairs of points are within a certain distance of one-another (regular
old Euclidean norm).
scipy.spatial.KDTree.query_ball_tree()
On Tue, Nov 10, 2009 at 8:17 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
James Bergstra wrote:
In some cases a brute-force approach is also good.
true.
If r is a matrix of shape Nx2:
(r*r).sum(axis=1) -2 * numpy.dot(r, r.T) +
(r*r).sum(axis=1).reshape((r.shape[0], 1)) thresh**2
On Fri, Oct 30, 2009 at 7:23 AM, Gael Varoquaux
gael.varoqu...@normalesup.org wrote:
On Fri, Oct 30, 2009 at 08:21:16PM +0900, David Cournapeau wrote:
On Fri, Oct 30, 2009 at 8:04 PM, Sebastian Haase seb.ha...@gmail.com wrote:
I understand where this error comes from, however what I was
On Wed, Sep 9, 2009 at 10:41 AM, Francesc Alted fal...@pytables.org wrote:
Numexpr mainly supports functions that are meant to be used element-wise,
so the operation/element ratio is normally 1 (or close to 1). In these
scenarios is where improved memory access is much more important than CPU
On Fri, Aug 21, 2009 at 2:51 PM, Matthew Brettmatthew.br...@gmail.com wrote:
I can imagine Numpy being useful for scripting in this
C-and-assembler-centric world, making it easier to write automated
testers, or even generate C code.
Is anyone out there working on this kind of stuff? I ask
David Warde-Farley dwf at cs.toronto.edu writes:
It did inspire some of our colleagues in Montreal to create this,
though:
http://code.google.com/p/cuda-ndarray/
I gather it is VERY early in development, but I'm sure they'd love
contributions!
Hi David,
That does look quite close to
On Thu, Aug 6, 2009 at 1:19 PM, Charles R
Harrischarlesr.har...@gmail.com wrote:
I almost looks like you are reimplementing numpy, in c++ no less. Is there
any reason why you aren't working with a numpy branch and just adding
ufuncs?
I don't know how that would work. The Ufuncs need a
On Thu, Aug 6, 2009 at 4:57 PM, Sturla Moldenstu...@molden.no wrote:
Now linear algebra or FFTs on a GPU would probably be a huge boon,
I'll admit - especially if it's in the form of a drop-in replacement
for the numpy or scipy versions.
NumPy generate temporary arrays for expressions
41 matches
Mail list logo