Skip to main content

Making AI Play Games


The Artificial Intelligence era has started only a while ago and it is drastically augmenting and amplifying our lives But in this sphere of development, the developers have had a big problem to test their AI.

This is where great minds like Elon Musk step in and create adroit and efficient resources to test the Intelligence that we create. His vision and aspiration led to the start of OpenAI, a free open source library and a company specializing in research. They create toolkits for Deep Learning developers like us to deploy models and make AI play games. This helps us to analyze the power of the intelligence by simulating game environments. 

OpenAI provides enthusiasts with 2 toolkits to work with

Gym - Toolkit for comparing and developing deep reinforcement learning algorithms...

Universe - A collection of gym environments to train and measure an AI's general intelligence...





Today we are going to write a simple script in python to help build a model that plays Dusk-Drive. The model will train itself and become better and better as we allow it to train. This is the code:-

import gym
import universe  # register the universe environments

env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes=1)  # automatically creates a local docker container
observation_n = env.reset()

while True:
  action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]  # your agent here
  observation_n, reward_n, done_n, info = env.step(action_n)
  env.render()

If you try to run your model , it will creash along the bylanes but will gradually improve over time. The console will Print certain statistics that will help you measure your AI's general Intellegence. This is a great tool for harnessing the power of AI , and I will surely keep you posted ...



Comments

Popular posts from this blog

Impact of Chatbots on Human Driven sectors of business

Chatbots are Machine Learning and Deep Learning powered programs that can conduct meaningful conversations. Most of them use technical attributes like Natural Language Processing and Context Analysis to converse with a human or another chatbot. The bot is programmed to self-learn as it is introduced to supplementary dialogues and words. In consequence, as a chatbot receives new voice or textual dialogues, the number of inquiries that it can reply and the accuracy of each response it gives increases. A Chabot can converse with the user through self-embedded messaging platforms like Facebook Messenger or through various flagship Assistants such as Google Assistant, Siri or Amazon Alexa. Nowadays, chatbots are being deployed in fields where their use clearly seemed to be obvious. Firms engaging in Financial Planning, Investment Management and Expense Tracking could reap a wide array of benefits when they make use of this technology. They can have a lasting impact on human-driven sec...

Recommender System using Python

Recommender systems are everywhere. Amazon recommends buys we like, google recommends searches, Youtube recommends systems and Facebook recommends people. All of these implementations describe Recommender Systems. There are 2 types of Recommender Systems. Collaborative Systems - Systems that recommend information based on what you like and what the others like. Content Based Systems- Based on what you have viewed This is a simple ML based recommender System in python. It uses the LightFM library as the dataset import numpy as np from lightfm import LightFM from fetch_lastfm import fetch_lastfm data = fetch_lastfm() model = LightFM( loss = ' warp ' ) model.fit(data[ ' matrix ' ], epochs = 30 , num_threads = 2 ) # Get recommendationns function def get_recommendations ( model , coo_mtrx , users_ids ): n_items = coo_mtrx.shape[ 1 ] for user in users_ids: # TODO create known positives # Artists the model pred...

Why online learning needs AI augmentation

With a large portion of schools having moved to online based learning through platforms like Zoom and Microsoft Teams, students are required to grasp concepts in a one-dimensional online medium as opposed to a constructive and collaborative class environment. Being a student during the pandemic, I have first hand experience with the mundane manner of teaching- and why we need to augment this with Artificial Intelligence algorithms. In a classroom, teachers can somehow manage to personalise some parts of learning or pay attention to weak students. However, in an online medium, with all the latency issues and network constraints, also moving in a general pace can be tough. Therefore for online learning,AI can be key, by providing a personalised learning path for the students. Using algorithms like NLP ( Natural Language Processing ), the online class can be transcribed according to the student's intellectual levels. AI, in this case, can make a specific-tailored learning path ...