On 07/21/2013 04:19 AM, pablobarhamal...@gmail.com wrote:
> Thank's for all the replies! I've tried some of the imporovements you
> suggested (using math.exp() and sum() or math.fsum()).
> None of that made the code faster, because they are functions you are calling
> lots of times, and function
pablobarhamal...@gmail.com, 21.07.2013 12:48:
> El domingo, 21 de julio de 2013 12:31:42 UTC+2, Steven D'Aprano escribió:
>> [steve@ando ~]$ python3.3 -m timeit -s "x = 2.357e7" "x**0.5"
>> 100 loops, best of 3: 0.319 usec per loop
>> [steve@ando ~]$ python3.3 -m timeit -s "x = 2.357e7" -s "fr
On 20 July 2013 21:22, wrote:
> Ok, I'm working on a predator/prey simulation, which evolve using genetic
> algorithms. At the moment, they use a quite simple feed-forward neural
> network, which can change size over time. Each brain "tick" is performed by
> the following function (inside the
El domingo, 21 de julio de 2013 12:31:42 UTC+2, Steven D'Aprano escribió:
> On Sun, 21 Jul 2013 03:19:24 -0700, pablobarhamalzas wrote:
>
>
>
> > Thank's for all the replies! I've tried some of the imporovements you
>
> > suggested (using math.exp() and sum() or math.fsum()). None of that made
On Sun, Jul 21, 2013 at 8:31 PM, Steven D'Aprano
wrote:
> On Sun, 21 Jul 2013 03:19:24 -0700, pablobarhamalzas wrote:
>
>> Thank's for all the replies! I've tried some of the imporovements you
>> suggested (using math.exp() and sum() or math.fsum()). None of that made
>> the code faster, because t
On Sun, 21 Jul 2013 03:19:24 -0700, pablobarhamalzas wrote:
> Thank's for all the replies! I've tried some of the imporovements you
> suggested (using math.exp() and sum() or math.fsum()). None of that made
> the code faster, because they are functions you are calling lots of
> times, and function
Thank's for all the replies! I've tried some of the imporovements you suggested
(using math.exp() and sum() or math.fsum()).
None of that made the code faster, because they are functions you are calling
lots of times, and function calling is quite time expensive (same as x**(1/2)
is faster than
On Sun, Jul 21, 2013 at 5:11 PM, Paul Rudin wrote:
> Steven D'Aprano writes:
>
>> On Sat, 20 Jul 2013 13:22:03 -0700, pablobarhamalzas asked:
>>
>> "How can I make this piece of code even faster?"
>>
>> - Use a faster computer.
>> - Put
How about using numpy?
Am 20.07.13 22:22, schrieb pablobarhamal...@gmail.com:
Ok, I'm working on a predator/prey simulation, which evolve using genetic algorithms. At
the moment, they use a quite simple feed-forward neural network, which can change size
over time. Each brain "tick" is performe
Steven D'Aprano writes:
> On Sat, 20 Jul 2013 13:22:03 -0700, pablobarhamalzas asked:
>
> "How can I make this piece of code even faster?"
>
> - Use a faster computer.
> - Put in more memory.
> - If using Unix or Linux, decrease the "nice" priori
20.07.13 23:22, pablobarhamal...@gmail.com написав(ла):
e = math.e
count = -1
for x in range(hidden_num):
temp = 0
for y in range(input_num):
count += 1
temp += inputs[y] * h_weight[count]
hidden[
pablobarhamal...@gmail.com wrote:
> Ok, I'm working on a predator/prey simulation, which evolve using genetic
> algorithms. At the moment, they use a quite simple feed-forward neural
> network, which can change size over time. Each brain "tick" is performed
> by the following function (inside the
On Sat, 20 Jul 2013 13:22:03 -0700, pablobarhamalzas asked:
"How can I make this piece of code even faster?"
- Use a faster computer.
- Put in more memory.
- If using Unix or Linux, decrease the "nice" priority of the process.
I mention these because sometimes people forge
On Sun, Jul 21, 2013 at 9:24 AM, wrote:
> Hi there Chris.
> Unfortunately, using iterations was about twice as slow as the original
> implementation, so that's not the solution.
> Thank's anyway.
Fascinating! Well, was worth a try anyhow. But that's a very surprising result.
ChrisA
--
http://
Hi there Chris.
Unfortunately, using iterations was about twice as slow as the original
implementation, so that's not the solution.
Thank's anyway.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Jul 21, 2013 at 6:22 AM, wrote:
> temp = 0
> for y in range(input_num):
> count += 1
> temp += inputs[y] * h_weight[count]
> hidden[x] = 1/(1+e**(-temp))
It's a micro-optimization that'll probably have negligible effect,
Hi there.
I'm using python 3, where xrange doesn't exist any more (range is now
equivalent). And "temp" doesn't have any fixed discrete values it always takes.
I have tried cython but it doesn't seem to work well (maybe using it wrong?).
Any other ideas?
--
http://mail.python.org/mailman/lis
In article <6bf4d298-b425-4357-9c1a-192e6e6cd...@googlegroups.com>,
pablobarhamal...@gmail.com wrote:
> Ok, I'm working on a predator/prey simulation, which evolve using genetic
> algorithms. At the moment, they use a quite simple feed-forward neural
> network, which can change size over time.
On Sat, Jul 20, 2013 at 5:22 PM, wrote:
> Ok, I'm working on a predator/prey simulation, which evolve using genetic
> algorithms. At the moment, they use a quite simple feed-forward neural
> network, which can change size over time. Each brain "tick" is performed by
> the following function (insi
Ok, I'm working on a predator/prey simulation, which evolve using genetic
algorithms. At the moment, they use a quite simple feed-forward neural network,
which can change size over time. Each brain "tick" is performed by the
following function (inside the Brain class):
def tick(self):
20 matches
Mail list logo