Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64255

Re: Need help vectorizing code

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joshua.landau.ws@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:code': 0.07; 'subject:help': 0.08; 'throws': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'computes': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'kevin': 0.30; 'message- id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'january': 0.37; 'subject:Need': 0.64; 'to:addr:gmail.com': 0.65; 'skip:w 30': 0.69
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LQD1VxnresNjFC1tXSVrEfJ/0n4Y/1K2OCjjDvFMAio=; b=cyKKlRdmZl22/K33JqtlrGFuyxgNBu4oHGPIFCVUmxlgvHJ8mLSWIJulRi3hEHDW1e OgIKO2cme7DHWfetduqTuafJ2tuIuIX9oj93uv0593AOaA6FR5l7yA6c/avm9j7ZR33i 4R7WP1JvibMY/4MatMXxm9WkH6bjpHwfAO51XKIj94ly0INVYc8sqadMMgN5+eROIStt ej0Z+5L9ZwOmjxkSaQIFRAAccXT3S8DM0ORSJK8Q44VEZjh0to4r4BQgpm+Y87lJ+QIs A3BSVCEdC6VkS3Qe3fwTB4fEFl52Wh4iEnpCBqoUlN+l2heqBSwQQPKif7QlAoBKpcrD iRQg==
X-Received by 10.112.201.167 with SMTP id kb7mr2427770lbc.32.1390079112796; Sat, 18 Jan 2014 13:05:12 -0800 (PST)
MIME-Version 1.0
Sender joshua.landau.ws@gmail.com
In-Reply-To <140f8aea-d3c5-4c0d-94f5-6aa064e353d1@googlegroups.com>
References <140f8aea-d3c5-4c0d-94f5-6aa064e353d1@googlegroups.com>
From Joshua Landau <joshua@landau.ws>
Date Sat, 18 Jan 2014 21:04:32 +0000
X-Google-Sender-Auth QIAIBgdXBkaNzWHhlzMVYFLDt6U
Subject Re: Need help vectorizing code
To Kevin K <richyokevin@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5689.1390079454.18130.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390079454 news.xs4all.nl 2965 [2001:888:2000:d::a6]:52361
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64255

Show key headers only | View raw


On 18 January 2014 20:51, Kevin K <richyokevin@gmail.com> wrote:
> def foo(X, y, mylambda, N, D, epsilon):
> ...
>         for j in xrange(D):
>             aj = 0
>             cj = 0
>             for i in xrange(N):
>                 aj += 2 * (X[i,j] ** 2)
>                 cj += 2 * (X[i,j] * (y[i] - w.transpose()*X[i].transpose() + w[j]*X[i,j]))

Currently this just computes and throws away values...

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Need help vectorizing code Kevin K <richyokevin@gmail.com> - 2014-01-18 12:51 -0800
  Re: Need help vectorizing code Joshua Landau <joshua@landau.ws> - 2014-01-18 21:04 +0000
  Re: Need help vectorizing code Kevin K <richyokevin@gmail.com> - 2014-01-18 13:18 -0800
  Re: Need help vectorizing code Peter Otten <__peter__@web.de> - 2014-01-18 22:50 +0100
  Re: Need help vectorizing code Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-01-19 15:46 +0000

csiph-web