319 - What is Simulated Annealing Optimization​?

DigitalSreeni
1 May 202414:17

Summary

TLDRIn this video, the speaker delves into simulated annealing optimization, explaining its fundamentals by drawing parallels to the metallurgical process of annealing. The algorithm lowers temperature iteratively, accepting better solutions and sometimes worse ones to avoid local minima. By doing so, it explores solution spaces effectively. The speaker also walks through Python code snippets, detailing how to set cooling rates, initial and final temperatures, and bounds for the algorithm. The video concludes with a demonstration of a 3D optimization example, setting the stage for further exploration of simulated annealing in practical scenarios.

Takeaways

  • 😀 The video is part of a series covering meta-heuristic algorithms, specifically focusing on simulated annealing and particle swarm optimization.
  • 🤖 Simulated annealing is inspired by the metallurgical process of annealing, where temperature is slowly reduced to achieve an optimal structure.
  • 🔥 The algorithm iteratively decreases the temperature and compares current solutions to previous ones, accepting worse solutions at higher temperatures to avoid local minima.
  • 📉 At high temperatures, the algorithm is more likely to accept suboptimal solutions, which helps explore the search space more effectively.
  • 🌡️ The cooling schedule determines how fast the temperature decreases over each iteration, and the typical approach is to use a fixed cooling rate.
  • 💻 The algorithm is explained through Python code, demonstrating how it starts with an initial solution, iterates through solutions, and accepts or rejects them based on probability.
  • 🔧 The example given uses a simple objective function, with specific bounds set for the search space, and uses standard Python libraries like NumPy and Matplotlib for visualization.
  • 🎲 The algorithm uses random values and probabilities to explore different solutions, with a key focus on finding a balance between exploration and exploitation.
  • 📊 Visualization of the solution space helps demonstrate how the algorithm searches for the optimal solution, navigating through a contour or 3D plot.
  • 📈 The video concludes with an example of visualizing a more complex optimization problem, setting the stage for more practical applications in the next tutorial.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is simulated annealing optimization, which is a metaheuristic algorithm inspired by the metallurgical process of annealing.

  • What is the goal of the simulated annealing algorithm?

    -The goal of the simulated annealing algorithm is to find the optimal solution to a given problem by iteratively adjusting a temperature parameter that guides the search process.

  • How does the simulated annealing algorithm work?

    -The algorithm works by starting at a high temperature and iteratively decreasing it. At each step, it generates a new solution and decides whether to accept it based on whether it's better than the current solution and the current temperature.

  • What is the significance of starting at a high temperature in simulated annealing?

    -Starting at a high temperature allows the algorithm to accept worse solutions, which helps it escape local minima and explore the solution space more effectively.

  • How does the cooling schedule affect the simulated annealing process?

    -The cooling schedule determines how quickly the temperature decreases. A slower cooling schedule allows for more iterations and can lead to better solutions, but it also increases the computation time.

  • What is the role of the probability function in accepting new solutions?

    -The probability function determines the likelihood of accepting a new solution that is worse than the current one. It is higher at higher temperatures, allowing more exploration of the solution space.

  • What does the algorithm do if the new solution is better than the current one?

    -If the new solution is better (i.e., has a lower objective function value), it is accepted as the current solution.

  • How is the initial solution for the algorithm determined?

    -The initial solution is randomly chosen within the defined search space at the start of the algorithm.

  • What is the purpose of defining bounds in the simulated annealing algorithm?

    -Defining bounds helps limit the search space to where the solution is most likely to be found, making the search more efficient.

  • How does the algorithm ensure it finds the global minimum or maximum?

    -The algorithm does not guarantee finding the global minimum or maximum but increases the likelihood by accepting worse solutions at higher temperatures and gradually decreasing the temperature to focus on better solutions.

  • What is the difference between simulated annealing and other optimization algorithms?

    -Simulated annealing differs from other optimization algorithms by using a temperature parameter to control the acceptance of worse solutions, allowing it to escape local minima and explore the solution space more thoroughly.

Outlines

00:00

😀 Introduction to Simulated Annealing Optimization

The speaker introduces the video by recapping the previous discussion on meta-heuristic algorithms and promising to cover simulated annealing (SA) and particle swarm optimization (PSO). This video focuses on SA, an optimization technique inspired by the metallurgical process of annealing, where temperature decreases gradually to reach an optimal structure. SA similarly cools down iteratively to explore potential solutions, comparing them to previous iterations to assess improvements. The speaker hints at the importance of temperature adjustments, discussing how higher temperatures allow the acceptance of worse solutions to avoid getting stuck in local minima.

05:00

🔍 Overview of the Simulated Annealing Process

This section delves deeper into the SA process, explaining how it works by starting with an initial solution and iteratively generating new ones. If the new solution is better, it's accepted; if worse, it's accepted with a certain probability, especially at high temperatures. The idea is to explore a wider solution space and avoid local optima by accepting worse solutions during the early stages. The cooling schedule dictates how fast the temperature decreases over iterations. A balance between exploration (high temperatures) and exploitation (low temperatures) is emphasized.

10:01

📊 Setting Up the Simulated Annealing Algorithm

Here, the speaker transitions into setting up the algorithm using Python code. They define an objective function and set bounds for the search space. Initial and final temperatures, as well as the cooling rate, are established. The speaker describes the goal as finding the optimal solution within these bounds, working through iterations to achieve that. They also explain how visualizing the solution space via contour plots aids in understanding the optimization process, though this part of the visualization is optional for the audience.

🖥️ Coding the Simulated Annealing Algorithm

The speaker outlines the implementation of the SA algorithm in Python, step by step. The function takes parameters like the objective function, bounds, initial and final temperatures, and the cooling rate. The process involves initializing random parameters and iterating while the temperature is higher than the final set point. The speaker explains how solutions are updated, the delta is calculated, and how probabilities influence whether to accept worse solutions. The cooling rate controls how quickly temperature decreases, and multiple cooling rates are tested to see how they affect optimization performance.

📈 Visualizing the Optimization Process

In this final section, the speaker introduces a more complex objective function and uses 3D plotting to visualize the optimization process. The goal is to start at a random point in the solution space and iteratively navigate toward the peak. The speaker demonstrates how the SA algorithm finds the peak in the 3D plot and emphasizes that the method used for visualization can help in understanding how SA performs in real-world scenarios. The speaker ends by teasing a future video focused on a steel optimization example and the use of pre-existing libraries for optimization tasks.

Mindmap

Keywords

💡Simulated Annealing

Simulated annealing is a metaheuristic optimization algorithm inspired by the process of annealing in metallurgy, where the temperature of a material is slowly cooled to reach an optimal structure. In this context, the algorithm starts at a high 'temperature' and iteratively cools down, exploring various solutions to find an optimal or near-optimal result. The video focuses on how this technique is applied to optimization problems, comparing solutions at each iteration and adjusting based on a cooling schedule.

💡Cooling Schedule

The cooling schedule in simulated annealing determines how quickly the temperature decreases over time. A slower cooling schedule allows more exploration of the solution space, while a faster schedule speeds up the process but might lead to suboptimal solutions. In the video, different cooling rates (e.g., 0.95, which means a 5% decrease per iteration) are experimented with to demonstrate their impact on finding an optimal solution.

💡Objective Function

The objective function is the function that needs to be optimized, whether by minimizing or maximizing its value. In the video, a mathematical function involving parameters like x, y, and z is used as the objective function, and the goal is to find the parameter values that yield the best solution (e.g., 4, 5, and -6). The function serves as the core problem that the simulated annealing algorithm attempts to solve.

💡Temperature

In simulated annealing, temperature is a metaphor for the control parameter that decreases over time. The algorithm starts with a high temperature, allowing it to explore more random solutions, including worse ones, and gradually lowers the temperature to narrow down to a more precise solution. The temperature is reduced according to a cooling schedule, and at lower temperatures, the algorithm becomes less likely to accept worse solutions.

💡Solution Space

The solution space refers to the range of possible solutions that the algorithm explores to find an optimal answer. In the video, the bounds for x, y, and z parameters (e.g., 0 to 10 for x, -10 to 0 for z) define the limits of the search. Visualizations, such as contour plots and 3D graphs, are used to depict the solution space and how the algorithm navigates through it to find the optimal solution.

💡Probability

Probability plays a key role in determining whether or not to accept a solution, especially when it is worse than the current one. At higher temperatures, the probability of accepting a worse solution is higher, which allows the algorithm to explore different areas of the solution space. The video explains that this randomness is gradually reduced as the temperature lowers, making the algorithm more selective as it approaches an optimal solution.

💡Delta (Δ)

Delta represents the change in the value of the objective function between iterations. It is used to compare the new solution with the current solution. If Delta is less than zero (i.e., the new solution is better), it is accepted outright. Otherwise, it is accepted with a certain probability based on the temperature. The concept of Delta is crucial in understanding how simulated annealing balances exploration and exploitation.

💡Local Minima

A local minimum is a solution that is better than neighboring solutions but may not be the best possible (global) solution. Simulated annealing helps overcome the problem of getting stuck in local minima by allowing worse solutions to be accepted at higher temperatures. The video emphasizes that this helps the algorithm explore more broadly before narrowing in on a final solution as the temperature decreases.

💡Perturbation

Perturbation refers to the small changes made to the current solution to generate new solutions. In each iteration of simulated annealing, the algorithm perturbs the parameters (e.g., x, y, z) to explore new possibilities in the solution space. The video discusses how these perturbations are evaluated to decide whether to accept the new solution based on the objective function and temperature.

💡Metaheuristic Algorithms

Metaheuristic algorithms are optimization techniques that provide near-optimal solutions for complex problems by exploring a large search space. Simulated annealing is one such algorithm. The video mentions that other metaheuristic algorithms, such as particle swarm optimization, will be discussed in future videos. Metaheuristics are widely used in situations where finding an exact solution is computationally impractical.

Highlights

Introduction to simulated annealing optimization and comparison with particle swarm optimization.

Simulated annealing is inspired by the metallurgical process of annealing, where temperature is slowly decreased to achieve an optimal grain structure.

The key principle is decreasing temperature slowly to optimize the solution and avoid being stuck in local minima.

At high temperatures, the algorithm may accept worse solutions to explore other areas of the solution space.

As the temperature lowers, the algorithm becomes more selective, accepting fewer solutions that are worse than the previous iteration.

The cooling schedule controls how fast the temperature decreases, with a typical constant cooling rate used in practice.

A probability-based approach is used to accept or reject solutions at each iteration, allowing the algorithm to explore diverse possibilities.

Key parameters in simulated annealing include the initial temperature, final temperature, and the cooling rate.

Demonstration of how the algorithm works through a Python code example, with a visual representation of the search space.

In the Python example, an objective function is defined, and the search space is visualized using a contour plot.

The algorithm randomly starts with a solution and iteratively perturbs the parameters to find better solutions.

The code showcases how different cooling rates affect the optimization process, with results printed for cooling rates ranging from 0.2 to 0.9.

At a higher cooling rate of 0.9, the solution is close to the true minimum of the objective function.

Another example is presented using a more complex 3D objective function, with the goal of finding the peak in the solution space.

Conclusion of the video with a teaser for the next video, which will focus on applying simulated annealing to real-world problems.

Transcripts

play00:00

hi everyone welcome back I hope you

play00:02

watched the last video where I quickly

play00:05

provided an overview of meta heuristic

play00:08

algorithms and I promise to talk to you

play00:10

about simulated annealing optimization

play00:12

and particle swarm optimization so here

play00:16

we go in this video I'm going to talk

play00:18

about simulated annealing the goal is

play00:20

for us to understand exactly what it is

play00:22

by looking at uh you know a little bit

play00:25

of code and uh and in the next videos or

play00:29

in the upcoming videos I'll talk about

play00:31

particles form optimization in a very

play00:33

similar way now if you would like to be

play00:36

informed about the upcoming ones as soon

play00:39

as it gets released you know what to do

play00:41

hit the Subscribe button and of course

play00:43

while you're there find the thanks

play00:45

button if you're feeling extra generous

play00:47

okay let's jump in here again I provided

play00:49

a brief overview of simulated annealing

play00:51

optimization in the last video but let's

play00:54

understand this at a little bit more

play00:56

depth in this one now it's again it's uh

play01:00

it's inspired by the metallurgical

play01:02

process of annealing where the

play01:04

temperature is slowly cooled so you get

play01:06

the optimal grain structure for the

play01:07

material but in this case for

play01:09

optimization algorithm there is nothing

play01:11

like Metallurgy grain structure so

play01:13

forget all of that it's basically comes

play01:15

down to one fact you're decreasing the

play01:17

temperature slowly

play01:19

to get the desired result what happens

play01:22

when you're doing that and that's let's

play01:24

understand that and how does it work it

play01:26

works by iteratively adjusting the

play01:28

temperature obviously not adjusting

play01:31

actually decreasing the temperature uh

play01:33

in an iterative way and looking at your

play01:36

final solution and comparing it with the

play01:38

solution from previous iteration and

play01:40

saying is this better or worse now again

play01:43

I'll explain that in a minute if you

play01:44

haven't watched the last video I mean

play01:46

this is basically the same slide from

play01:48

the last video but I promise to give

play01:50

more context and at high temperatures

play01:52

you start at a high temperature you go

play01:54

to low temperature okay that's what

play01:56

annealing is and at high temperature the

play01:59

algorithm accepts solutions that are

play02:01

worse

play02:02

than the previous iteration because

play02:04

maybe you're stuck at a local Minima or

play02:08

maybe what where you are is not the

play02:10

right solution

play02:12

okay so the right solution may be

play02:14

somewhere else so you need to explore

play02:17

that and that's exactly why you change

play02:20

this temperature and at high

play02:21

temperatures you accept there's a good

play02:23

chance that you're accepting the

play02:24

solution at low temperatures there's a

play02:26

good chance you are not accepting this

play02:28

weird solutions that are out of the

play02:29

scope and the cooling schedule of course

play02:32

determines how fast you are actually

play02:33

changing this over every iteration now

play02:36

let's go to the next slide and just look

play02:38

at a couple of aspects here which is it

play02:41

starts with an initial solution like I

play02:43

mentioned and iteratively generates a

play02:45

new solution now if this is not better

play02:48

it's accepted now again I'm repeating

play02:50

myself I hear that so let's go and look

play02:52

at exactly what happens yeah so if the

play02:55

Delta is less than zero Delta is again

play02:57

the change from last time to this time

play03:00

it's less than zero means I have a

play03:02

better solution this time

play03:04

or greater than zero depending on

play03:06

whether you're finding Maxima or Minima

play03:07

either way if the change is uh within

play03:11

what you wanted to accept then accept

play03:13

the new solution else

play03:16

you accept it with certain probability

play03:18

then you calculate that okay what is the

play03:20

probability at high temperature the

play03:23

probability is high

play03:24

there's a negative sign right there at

play03:26

high temperature there is a higher

play03:29

probability and then you generate a

play03:30

random number and say okay is that less

play03:32

than this probability if so accept the

play03:34

new solution if not X rejects the new

play03:37

solution meaning you are rejecting the

play03:40

good solution and sticking with the bad

play03:43

solution so you can explore this space

play03:45

better

play03:46

okay I hope things make sense once we go

play03:48

into the code but I'll show you uh

play03:51

Snippets of code before jumping into the

play03:53

uh into actual or Google collab notebook

play03:56

now cooling schedule as I mentioned

play03:58

determines how quickly the temperature

play04:00

actually decreases

play04:01

of course everyone wants to have like

play04:03

infinitely slow cooling temperatures but

play04:05

that means you have a lot more

play04:07

iterations to go through

play04:08

and usually you the common convention is

play04:12

set a constant cooling rate and then

play04:14

just go through it I say usually but you

play04:16

can be a bit more tricky you can say hey

play04:19

when the temperature is large I just

play04:21

want like uh you know smaller steps or

play04:24

larger steps but as temperature gets

play04:27

lower and lower I want the cooling to be

play04:29

slower for example yeah you can schedule

play04:31

it but typically people leave it at a

play04:34

fixed fraction uh just like the one I

play04:37

show you on the screen some Alpha some

play04:39

value multiplied by the temperature is

play04:41

what you're taking as the next one and

play04:43

Alpha can be 0.95 for example which

play04:46

means you're cooling the temperature by

play04:47

five percent

play04:48

each iteration okay now let's understand

play04:51

the algorithm by looking at the python

play04:54

code here there is an objective function

play04:56

where we Define some function the goal

play04:58

is to find the Minima

play05:00

or the solution basically right for this

play05:02

one

play05:03

and in this case the answer is 4 5 and

play05:05

minus 6 as you know

play05:07

and you define a search space you say

play05:10

okay my bounce again this is a lot we

play05:12

will look at this in a minute but you

play05:14

basically say the bounce is uh okay my

play05:18

solution is between 0 to 10 x 0 to 10

play05:21

why and minus 10 to 0 Z right so those

play05:25

are the bounds and you need to Define

play05:27

that otherwise if your solution is here

play05:28

no point in searching somewhere else you

play05:30

have to search where the solution is

play05:32

most probably lying and you also provide

play05:35

initial and final temperature so you

play05:37

start at certain temperature and you

play05:39

cool it uh I don't know five percent

play05:41

every time yeah uh

play05:44

and uh yeah so here is something that we

play05:47

will be generating in this uh in this

play05:49

tutorial which is you we have a solution

play05:52

space and trying to find the Maxima in

play05:55

this example so you start somewhere you

play05:57

work your way you work your way not the

play05:58

right solution not the right solution

play06:00

not the right solution and so on and you

play06:02

finally find the peak in this case yeah

play06:04

so we'll visually do this in this uh in

play06:07

in just by jumping into the code right

play06:10

now so let's go ahead and do that

play06:12

and I am going to give you this this

play06:14

this uh notebook linked to this so don't

play06:18

bother writing down anything and I have

play06:20

all the text here in case you want to go

play06:22

back and read it at your own pace okay

play06:25

so understanding the algorithm via

play06:27

python code I explained a lot of this

play06:29

stuff but a couple of things I want to

play06:30

show you the initial T final we talked

play06:33

about it cooling rate I'm gonna set it

play06:35

to 0.95 which means it's going to change

play06:37

by five percent

play06:39

every iteration and the bounds we are

play06:41

going to set between 0 to 10 for the

play06:43

first two values and minus 10 to 0 for

play06:45

the third parameter because that's where

play06:47

the solution lies okay

play06:50

okay I think that's enough background

play06:53

let's go ahead and run this all I'm

play06:56

using is standard libraries there is no

play06:58

tricky libraries here numpy random math

play07:01

and matplotlib for plotting and I'm

play07:03

defining my objective function as this

play07:06

x minus 4 squared so you know the

play07:08

solution is going to be 4 5 and minus 6.

play07:12

okay now let's define the range because

play07:15

our solution lies between -10 oh in this

play07:18

case I'm instead of defining 0 to 10 for

play07:20

all of these I'm actually defining minus

play07:22

10 to 10. which is okay we know that our

play07:25

solution lies between this a bit larger

play07:27

search space but still I'm confident

play07:29

we'll find this in a fraction of a

play07:31

second so minus 10 to 10 minus 10 to 10

play07:34

minus 10 to 10 for x y z and I'm going

play07:36

to create a mesh right there from and my

play07:40

objective function

play07:42

and filling that objective function

play07:44

right there and creating a contour plot

play07:46

so basically this this part is just so

play07:49

we can visualize how the objective

play07:52

function looks like and this is a

play07:53

contour plot so I expect a 2d Contour

play07:56

plot let's see that's what I'm yeah

play07:59

that's not a 3D plot

play08:03

okay there we go and again all of this

play08:05

is optional I'm just doing this because

play08:07

I just want to show you how the solution

play08:09

space looks like and initially I I said

play08:12

these are my bounds these are not the

play08:14

bounds this is just my X range y range

play08:16

and Z range for the plotting itself so

play08:18

you can ignore this part completely if

play08:20

you don't want to visualize this but I

play08:22

just want to show you how the solution

play08:24

space looks like yeah so the goal for

play08:27

our optimization algorithm is to

play08:29

navigate through this and find the right

play08:30

solution which is around 5 and 6 and in

play08:34

Z it's going to be around -6 right so

play08:37

that's the solution so how do we do that

play08:39

so let's define our simulated annealing

play08:41

functions and then go ahead and run

play08:43

these functions so I again showed this

play08:46

as part of our presentation the

play08:47

parameters that go in are the objective

play08:49

function that we are trying to you know

play08:52

use as a fitness function here bounce

play08:54

the limits the initial temperature final

play08:56

temperature and the cooling that's it

play08:58

it's very straightforward actually and

play09:01

uh you're looking at how many parameters

play09:03

uh based on the bounce right I mean if

play09:06

my bounds have uh multiple parameters

play09:08

like three parameters then I have three

play09:10

that's the number of parameters what are

play09:12

the current parameters just go ahead and

play09:14

start somewhere you have to start

play09:15

somewhere so I'm gonna randomly start

play09:17

somewhere within this space and the

play09:19

current solution is you take those

play09:21

parameters and plug them into objective

play09:24

function then you get a solution

play09:26

right and that is your current solution

play09:28

and then you have your current

play09:30

temperature

play09:32

and while the current temperature is

play09:36

higher than the final temperature go

play09:38

ahead and do the following

play09:40

perturbed parameters or the new

play09:41

parameters

play09:43

are updated parameters are the ones

play09:46

right there and the updated solution is

play09:48

where you plug in the updated parameters

play09:51

into the objective function so you get

play09:53

updated solution now now you take the

play09:56

supply difference between the updated

play09:58

solution and the previous solution or

play10:01

the current solution the existing

play10:02

solution and that is your Delta and in

play10:04

this case I'm accepting I'm trying to

play10:07

find the peak so if the Delta is less

play10:08

than zero go ahead and accept it which

play10:11

means current parameters equals to the

play10:13

the updated one or the new one current

play10:15

solution is the new one if not go ahead

play10:17

and calculate the probability based on

play10:19

the current temperature

play10:21

and if that probability is greater or if

play10:24

a random number is less than that

play10:26

probability then go ahead and accept the

play10:29

solution right there uh current

play10:31

parameters is the perturbed parameters

play10:34

and current solution is the Prototype

play10:36

solution right there okay and uh go

play10:39

ahead and I mean basically this part

play10:42

again I hope this is the meat of it yeah

play10:45

which means instead of rejecting the

play10:47

solution we are accepting a solution

play10:50

that's worse with a certain probability

play10:53

that's exactly what we are doing right

play10:54

there okay and then we are just changing

play10:56

the temperature that's it and this part

play10:59

is basically plotting the cooling rates

play11:01

so let me go ahead and

play11:04

run that and now let's go ahead and run

play11:07

this so our bounds are minus 10 to 10.

play11:10

for all of these well I guess I ended up

play11:12

using minus 10 to 10 as bounds for all

play11:15

and the initial temperature 100 final

play11:18

temperature is 0.1 and change it at five

play11:21

percent and cooling rates are there and

play11:25

plot the cooling rates right here so

play11:27

let's go ahead and so it took that many

play11:30

result for cooling rate 0.2 for cooling

play11:33

rate 0.5 instead of doing one cooling

play11:36

rate by the way I should explain this

play11:37

instead of doing one cooling rate of 0.2

play11:39

remember we set the cooling rate

play11:41

constant uh so instead of that I

play11:45

actually experimented with a few

play11:47

different cooling rates like

play11:49

0.2.5.6.8 and 0.9 and I'm printing all

play11:52

the values down here

play11:53

so the result at cooling rate 0.2 is 6.5

play11:57

minus 0.6 that's not a good result

play12:01

in fact if you look at a high uh

play12:04

equivalent rate of 0.9 the solution is 3

play12:07

7 and minus 5. so what is the actual

play12:10

solution

play12:12

4 5 and minus 6. so this is almost minus

play12:16

six this is 7 this is 2.8 which is like

play12:19

3 let's say this is uh it should be four

play12:21

so maybe we should just do more

play12:23

iterations or more you know smaller I

play12:27

mean eventually you can see that how the

play12:29

solution is actually showing up right

play12:31

there for this cooling rate it's

play12:32

actually doing a much better much better

play12:34

job

play12:36

okay so with that information let's go

play12:38

ahead and actually understand the

play12:40

visualizing the optimization process

play12:42

again I did kind of something similar

play12:45

but I kind of got a bit more complex

play12:48

objective function

play12:49

the one that you saw in the image before

play12:51

so let's go ahead and run that Define

play12:53

the objective function and now let's go

play12:56

ahead and plot it yeah this is a 3D plot

play12:58

not a controller plot so let's go ahead

play12:59

and see so this is the new objective

play13:01

function instead of just a

play13:03

a simple one that I showed you earlier

play13:05

so the goal is to start somewhere but

play13:07

then find the peak right here okay so

play13:11

for that we have a simulated any link

play13:13

right there I called it 3d nothing

play13:15

everything is exactly identical I don't

play13:18

have like much of a difference between

play13:20

previous one and here so you can see

play13:22

it's very similar code right here and

play13:26

I'm defining my bounce and cooling rate

play13:28

of 0.95 let's set it to 0.95 which means

play13:30

we are changing the rate at five percent

play13:34

and there you go that's the plot and

play13:37

this time it actually started when I did

play13:38

the first simulation you saw on my

play13:40

Opening screen that it started over

play13:43

there and it worked its way to the top

play13:44

now it started over here and slowly it

play13:47

found its way to the top right there so

play13:49

uh I think again these are abstract

play13:53

examples in the next video let's go

play13:55

ahead and use the steel optimization

play13:57

example and then try to understand how

play14:00

we can put the simulated annealing to

play14:02

use and should we actually code all of

play14:05

this or is this is there a standard

play14:06

library that we can import and do these

play14:08

type of examples we'll see go ahead and

play14:11

watch our next tutorial until then keep

play14:14

learning see you next time

Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
Simulated AnnealingOptimizationPython CodeAlgorithm TutorialMetaheuristicMachine LearningData ScienceProblem SolvingProgramming GuideCooling Schedule
Besoin d'un résumé en anglais ?