1602410578

# Application of Genetic Algorithm for Policy Search in Open AI ‘CartPole-v1’ Environment

Aim : To implement a Genetic Algorithm for Policy Search For Solving Open AI ‘CartPole-v1’ Environment. Open AI ‘CartPole-v1’ Environment consists of a pole balanced on a cart which moves on a frictionless track. The system is controlled by applying a force of +1 and -1 on the cart. A reward of +1 is awarded for every time-step the pole remains upright. Episode ends when the pole is more than 15 degrees from the vertical or the cart is 2.4 units from the center. The goal was to collect a average reward of 300 over 100 population. This is considered the population from which the best strategy is extracted.

Tech Stack Used :

1. ) Open AI Gym : https://gym.openai.com/ For simulating the cartpole environment in python
2. ) DEAP : https://github.com/deap/deap For implementing Genetic Algorithm for policy search
3. )PyTorch : https://pytorch.org/ For implementing neural networks in python

#ai

1602410578

## Application of Genetic Algorithm for Policy Search in Open AI ‘CartPole-v1’ Environment

Aim : To implement a Genetic Algorithm for Policy Search For Solving Open AI ‘CartPole-v1’ Environment. Open AI ‘CartPole-v1’ Environment consists of a pole balanced on a cart which moves on a frictionless track. The system is controlled by applying a force of +1 and -1 on the cart. A reward of +1 is awarded for every time-step the pole remains upright. Episode ends when the pole is more than 15 degrees from the vertical or the cart is 2.4 units from the center. The goal was to collect a average reward of 300 over 100 population. This is considered the population from which the best strategy is extracted.

Tech Stack Used :

1. ) Open AI Gym : https://gym.openai.com/ For simulating the cartpole environment in python
2. ) DEAP : https://github.com/deap/deap For implementing Genetic Algorithm for policy search
3. )PyTorch : https://pytorch.org/ For implementing neural networks in python

#ai

1619511840

## Making Sales More Efficient: Lead Qualification Using AI

If you were to ask any organization today, you would learn that they are all becoming reliant on Artificial Intelligence Solutions and using AI to digitally transform in order to bring their organizations into the new age. AI is no longer a new concept, instead, with the technological advancements that are being made in the realm of AI, it has become a much-needed business facet.

AI has become easier to use and implement than ever before, and every business is applying AI solutions to their processes. Organizations have begun to base their digital transformation strategies around AI and the way in which they conduct their business. One of these business processes that AI has helped transform is lead qualifications.

#ai-solutions-development #artificial-intelligence #future-of-artificial-intellige #ai #ai-applications #ai-trends #future-of-ai #ai-revolution

1602255900

## Amsterdam And Helsinki Launch Open AI Registers

Amsterdam and Helsinki both launched an Open AI Register at the Next Generation Internet Summit. According to sources, these two cities are the first in the world that are aiming to be open and transparent about the use of algorithms and AI in the cities.

Currently, in the beta version, Algorithm Register is an overview of the artificial intelligence systems and algorithms used by the City of Amsterdam. The register is an effort to show where the cities are currently making use of AI and how the algorithms work.

Jan Vapaavuori, Mayor of Helsinki stated, “Helsinki aims to be the city in the world that best capitalises on digitalisation. Digitalisation is strongly associated with the utilisation of artificial intelligence. With the help of artificial intelligence, we can give people in the city better services available anywhere and at any time. In the front rank with the City of Amsterdam, we are proud to tell everyone openly what we use Artificial Intelligence for.”

#news #ai register #amsterdam ai #helsinki ai #open ai register #ai

1593358380

## A genetic algorithm is a higher level method to produce

• A genetic algorithm (GA) is a higher level method to produce/ generate a sufficiently good solution to an optimization problem, inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA).
• Genetic algorithms are commonly used to generate high-quality solutions to optimization and search problems by relying on biologically inspired operators such as mutation, crossover and selection.
• John Holland introduced genetic algorithms in 1960 based on the concept of Darwin’s theory of evolution

Evolutionary algorithms (EA):

In artificial intelligence (AI), an evolutionary algorithm (EA) is a subset of evolutionary computation, a generic population-based metaheuristic optimization algorithm. An EA uses mechanisms inspired by biological evolution, such as reproduction, mutation, recombination, and selection.

Evolutionary algorithms have three main characteristics:

· Population-Based: Evolutionary algorithms are to optimize a process in which current solutions are bad to generate new better solutions. The set of current solutions from which new solutions are to be generated is called the population.

· Fitness-Oriented: If there are some several solutions, how to say that one solution is better than another? There is a fitness value associated with each individual solution calculated from a fitness function. Such fitness value reflects how good the solution is.

· Variation-Driven: If there is no acceptable solution in the current population according to the fitness function calculated from each individual, we should make something to generate new better solutions. As a result, individual solutions will undergo a number of variations to generate new solutions.

In

a genetic algorithm, a population of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem is evolved toward better solutions. Each candidate solution has a set of properties (its chromosomes or genotype) which can be mutated and altered; traditionally, solutions are represented in binary as strings of 0s and 1s, but other encodings are also possible.

The process of natural selection starts with the selection of fittest individuals from a population. They produce offspring which inherit the characteristics of the parents and will be added to the next generation. If parents have better fitness, their offspring will be better than parents and have a better chance at surviving. This process keeps on iterating and at the end, a generation with the fittest individuals will be found.

Six phases are considered in a genetic algorithm:

· Initial population

· Fitness function

· Selection

· Crossover

· Mutation

· Termination

flowchart for process in a genetic algorithm

#evolutionary-algorithms #optimization #genetic-algorithm #machine-learning #ai #algorithms

1603767600

## Search Algorithms

Today, let us touch base on some fundamental concepts like search algorithms.

In simple terms, **searching **is a process of looking up a particular data record in the database or in the collection of items. A search typically answers as true or false whether the particular data in which we are referring is found or not and perform the next action accordingly.

Commonly used algorithms for search are:

• Linear search
• Binary search
• Interpolation search

Let us understand them in detail with some example

## Linear Search Algorithm

Linear Search Algorithm is the simplest and easiest form of the search algorithm. In this algorithm, a sequential search is made over all the items one by one to search for the targeted item. Each item is checked in sequence until the match is found. If the match is found, the searched item is returned otherwise the search continues till the end.

To make it easy to understand, let us see understand linear search using a flow diagram

Linear Search — Data Flow

### Points to note:

• Does not need sorted array list
• Performs equality comparisons
• The time complexity is O(n)
• Time taken to search elements keeps increasing as the number of elements is increased.

## Binary Search Algorithm

In _Binary search algorithm, _begins with an interval covering the whole array and diving it in half. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty.

To make it easy to understand, let us see understand binary search using flow diagram and example as below.

Binary Search — Data Flow

### Points to note:

• The array needs to be sorted
• Performs ordering comparisons
• Time complexity to O(log n).
• Search is done to either half of the given list, thus cut down your search to half time

#sorting-algorithms #algorithms #data-structures #search-and-sort #searching-algorithm