Month: February 2009

News, Python, Time Waste

Python: 3D real-time debugging and function call structure

Here is two videos of a small script (python and xmlrpc calls to ubigraph visualization server) created to show a 3D graph of  the function call structure of a python application, the first shows only the structure created while running the application and the next video shows a debugging-like tool, it changes the node color to red when the function is called, and the labels shows: function name, python file name and the line on the python file where the code is.

Update (26/02): download here the script source-code.

To use the script, start the Ubigraph visualization server and add the profile module to your python application, it will looks like this:

import prof3d

def run_main():
   # your code

if __name__ == "__main__":
   prof3d.profile_me()
   run_main()

News, Python, Time Waste

Twitter in 3D !

I was doing some tests on the Ubigraph dynamic graph visualization tool and I have this idea to use the Ubigraph tool to render 3D graphs of Twitter friends on real-time. Follows the video of the scripting utility I’ve created, it starts with a red node of your twitter and when you click, it shows your friends, when you click on your friends, it shows their  friends, and so on. I think it is interesting those social network graphs, when I got more time I’ll put more ideas on the pratice =)

Update (26/02): download here the script source-code.
To use it, you must install python-twitter, use the easy_install:

easy_install python-twitter

I’ve tested with Python 2.5, but it should works on 2.4 and 2.6 too.

Start the Ubigraph visualization server and run the script. The syntax for the script is like this:

python twitter3d.py -u username

You can get a help using:

python twitter3d.py –help

Genetic Algorithms, News, Science

Genetic Algorithms help us to understand how we see

There is a very interesting article on the insciences.org, it talks about the use of a Genetic Algorithm to create images used to test people brain performance:

The team developed a ‘genetic algorithm’, based on a simple model of evolution, that can breed a range of images and visual stimuli which were then used to test people’s brain performance. By using artificial intelligence to design the test patterns, the team removed any likelihood of predetermining the results which could have occurred if researchers had designed the test pictures themselves.

Read the full article or see the created images.

Pyevolve, Python

Good news: IronPython and Jython compatibility !

Good news, I’ve tested Pyevolve 0.5 with the IronPython 2.0.1 and Jython 2.5b1, and the framework is working perfect (besides the performance loss when comparing with CPython 2.5 and 2.6). The only feature that do not worked is the dump of statistics with the sqlite3, sine there is no sqlite3 on the default install of Jython and IronPython. To Pyevolve work on IronPython, you must install the zlib module for IronPython and import your Python modules like this:

import sys
sys.path.append(r"c:\python25\lib")

With this compatibility issue, you can use Pyevolve on your .NET platform or in your Java applications.

Pyevolve, Python

Pyevolve profiling dot graph

I’ve created a profiling dot graph of the pyevolve_example15_rosenbrock.py with the Gprof2Dot, this Pyevolve example is the minimization of the Rosenbrock function with 20 variables.

stat

I’ve created that graph to show the call structure of Pyevolve, as you can see, the accumulation in FunctionSlot applyFunctions method is the effect of the use of FunctionSlot use in many operations like scaling,  selection, evaluation, crossover and mutation.

Article, Philosophy

Considerações sobre a filosofia da ciência de Karl Popper e Algoritmos Evolutivos

Sou um grande fã da filosofia da ciência de Karl Popper, desta maneira, resolvi escrever algo sobre o que eu acho interessante na filosofia dele, principalmente em relação à crítica racional, pra depois falar um pouco do que acho sobre isto em relação aos algoritmos evolutivos em geral.

Popper, em seu livro Em busca de um mundo melhor (o título original é “Auf der Suche nach einer besseren Welt“), cita a importância da crítica racional na ciência e combate o dogmatismo na crença da autoridade científica. Para mim, esta idéia, apensar de intrínseca no pensamento de muitos filósofos, não foi tão claramente exposta como Popper o fez, a clareza com que Popper nos apresenta a idéia sobre como a nossa ciência cresce e melhora através da crítica racional é notável e vou tentar resumir aqui o que ele tentou explicar por quase uma vida.

(more…)

News, Science

Happy Darwin day !

As Wikipedia says:

Darwin Day is a recently instituted celebration intended to commemorate the anniversary of the birth of Charles Darwin on February 12, 1809. The day is used to highlight Darwin’s contribution to science and to promote science in general.

Today is the bicentenary of Darwin’s birth and the 150th anniversary of the publication of the On the Origin of Species. So, take some time to read.

“I love fools experiments.
I am always making them.

charles-darwin-cropped-1258

Charles R. Darwin (b. 1809 – † 1882)

I'm starting a new course "Machine Learning: Foundations and Engineering" for 2024.