Published my historical comics, a spin off for Kurosawa’s Ran, In the brutal era of feudal Japan, where katana and blood decides who is strongest. Don't miss today's update of #clans! #webcomic #WEBTOON
Aqua Utopia|海の底で記憶を紡ぐ
Show & Tell
Claire Keane

Kaledo Art
taylor price
sheepfilms
trying on a metaphor

祝日 / Permanent Vacation
Today's Document
"I'm Dorothy Gale from Kansas"
Game of Thrones Daily

Origami Around

⁂
Acquired Stardust
hello vonnie

Product Placement

Kiana Khansmith
art blog(derogatory)

Discoholic 🪩
No title available
seen from Thailand

seen from United Kingdom
seen from Malaysia

seen from Australia

seen from Malaysia

seen from T1

seen from Türkiye

seen from United States
seen from United Kingdom
seen from Switzerland

seen from Malaysia

seen from Algeria

seen from Malaysia
seen from Türkiye

seen from United States
seen from China
seen from Netherlands

seen from Türkiye

seen from India

seen from Japan
@pythonsnippetizer
Published my historical comics, a spin off for Kurosawa’s Ran, In the brutal era of feudal Japan, where katana and blood decides who is strongest. Don't miss today's update of #clans! #webcomic #WEBTOON
Python code snippets turned 9 today!
Part - I
Hello world ! This weekend I picked up a machine learning project to work around and I'm thinking of jotting down my journey as a series of blogs with layman's definitions which would be helpful for anyone who wants to dive into Artificial Intelligence.The main intention of this project is to slowly descend into Artificial Intelligence from a layman's perspective.I'm going to build an AI bot which will play the classic Supermario game.Due to lack of computing resource am not going to work around the entire game.Instead of letting my bot to play the entire game I will take few frames of the game and improvise things accordingly.
On top of all, I need to figure out a way to run the Supermario game on my machine, for that I just found this beautiful repo on github which does have the entire SuperMario game in HTML5 format.Now I can run the game on my browser.
Alright lets descend slowly, this is my problem statement,I need to create an AI bot which will play a game.Let's look in to the process with a layman's perspective ! I need to pick up a machine learning approach to provide solution to my problem statement, which is going to be "Reinforcement learning".
List of things I've been read up in the entire weekend/ will read in the upcoming weekends:
What is Reinforcement learning(RL)/ Why I picked this approach ?
What is the mathematical concept behind it ?
What is Markov decision process ? (RL is relying on this)
How to feed a game into a decision making algorithm which will let our AI bot to understand how to play the game ?
What is Deep Q-learning ? (RL is relying on this)
How to train an AI bot to achieve the target ?
What is Bellman equation (Q-learning is based on this)
How to architect a reward based system which will let my neural network to understand which moves are good one and which moves are bad ?
How to programmatically give inputs to the game which will be running on my browser ?
How to retrieve the result after an action is done on the game (running/Jumping/Shooting) ?
How to feed the retrieved results' data into my neural network ?
And the final and most important one , "How to train my neural network with limited computing resource" ?
Now we have a list of things to do let's strike through one by one !
Firstly I would like to work around this one, "How to programmatically give inputs to the game which will be running on my browser ?"
To Run the game on my browser am going to use Selenium.
Now we need to work around the following major modules:
Playing the game
Getting outputs from each game before the character dies with a high focus on getting good scores rather than surviving alone.I can survive my character by simply Jumping the Goomba(one of the enemy) but killing that by stepping on it will gives score.
Training the neural network with the outputs by using very limited computing resources.
Playing the game :
For playing the game programmatically I'm going to use selenium library.I have created a github repo with a class "Game" which will contains the list of methods needed to be done on the game to play and to get results while playing it on the browser.
class Game contains run(), Jump(), get_score() methods for now will enhance it as time moves on.
Now I can run the game programmatically on my browser.I have miles to go !
I will write about all the mathematical concepts involved in the progress in my next blog.
Built-in functions: divmod()
Python class attribute : __class__
Python class attribute : __dict__
Things to note : “isinstance” of subclass
Built-in functions : sorted()
Built-in functions: type()
Things to note:
“raw_input’s” datatype
Keywords
assert
What is ‘assert’ keyword ? what does it do ?
Now consider the following example where we used “AssertionError” to write our logic
Output of our script
Dictionary : update()
os:
os.system()
os module:
Introduction :
os module in python will allow you to do all types of operating system based functionalities like creating a folder, deleting and stuffs like that. we can also access terminal level commands with os module.
why we need to do operating system based functionality in our python code?
Consider this scenario where we are going to write an automation script which will take backup and store it in a directory (which should be in the name of current date).normally we use “mkdir” in linux to create a folder via terminal now by using os module’s function we can make our python code to do that.
Datetime : Getting current date
Datetime : Getting current year
Getting arguments from command line using “argparse”
Running our script and getting arguements from command line :