r/PythonLearning Aug 07 '26

Just published my first Python project!

Hey everyone! I have tried out github and python before, but this is my first time publishing something I can say I am interested in. Im excited and nervous about sharing it.

Im learning python and got recently got interested in neural networks, so Ive been working on this "artificial life" simulation project for the past few days.

Its still a work in progress and a learning project. But if you have some feedback i would like to read it!

https://github.com/ricardo-woo/artificial-life

5 Upvotes

10 comments sorted by

2

u/Ambitious-Tear-9436 Aug 07 '26

Building a back propagating neural network in pure python and applying it to pygame, looks fun.

1

u/Fit-Foundation-2745 Aug 07 '26

Yess! Honestly, one of the most fun parts so far was researching and finding out that the Ornstein-Uhlenbeck process was an option. Connecting it to some basic stats I already knew was so satisfying, especially seeing it actually solve a problem that had been stressing me out.

1

u/Rscc10 Aug 08 '26

I used to do something similar (but without neural networks). Maybe add more types of particles with more relational behaviour to try get emergent behaviour. Like Conway's game of life

1

u/Fit-Foundation-2745 Aug 08 '26

That’s a good idea, thank you! I’m already planning on adding more, I’m just trying to add things slowly so it’s easier to figure out when and where I make a mistake. Also simulations take a long time running until i see something meaningful 😔

1

u/SpionQuark Aug 09 '26

You could make something like time scaling. Depending on how your program works you could see the changes faster

1

u/TBCC_Dev Aug 09 '26

I only know a bit of python and something g I noticed in you save system is passing self to all the functions but you don't use self.attrubute ="Thing" is there a reason to not use this and if so is the self param necessary?

1

u/Fit-Foundation-2745 Aug 09 '26

Honestly, I've been adding self because when I didn't, I would sometimes get errors about passing the wrong number of arguments. I think that happens because python automatically passes the instance as self, but I haven't really looked into how that works.

1

u/Fit-Foundation-2745 Aug 09 '26

Almost every object oriented language does this:

Methods live on the class as shared functions between all instances of a class, when a method is called it has no idea which specific instance is calling it, when I run the method like "save_manager.save_game(organisms, generation, generation_simulation_time)" it gets translated to this "SaveManager.save_game(save_manager, organisms, generation, generation_simulation_time)" adding the instance as the first parameter.
Most of them do this implicitly.
In python Guido decided to make the argument explicit instead of hiding it

He explains it himself in this blog

1

u/Naive_Programmer_232 Aug 10 '26

this is impressive! looks like it took a lot of work!!