ga_in_python's People
Forkers
philipismyen kings26 hillaryhitch margon777 flakon84 monterich amanjafari xzhou2018 ranasingh-gkp biswajitghosh98 hafidzdaud haard-shah henriwout campioni1 wille097 sangramkrout tvlahopanagiotis mgocken anjalibennett anandjage veredlevi88 niklasheg rbi-international snehabisht sambalshikhar damirzk test00dezwebsite ranjithksoman lucgbrl lulada gast04 bsmdev niloy37 mashfiq137 shwkat wzj207 medicyp jsanderink wolfedwolf jimmy-inl asrihyasser nujcharee jovanad29 mulham-alesali lphgpc kshitij-bajpai quantumintelligence tabithako aashispi jamesspillane daunfamily jambez-hub bradday4 mmeehhrr citasiadari omarsenoussaoui yosr-blh digicornio robinaar jekijekicom philescandon handresforero clementanafuga_in_python's Issues
ValueError: x and y must have same first dimension, but have shapes (1,) and (18,) from **plot_best()**
Hi gmichealson,
Came across your video and wanted to give it a go. Found the video very useful, please keep making them.
I found a minor bug in your script was able to get a work around.
x=[0.5] + [x + 0.5 for x in route[0:len(route)-1]] + [len(the_map) - 0.5]
I think what is happening is that, in this line, the value of x is the last element from the for-loop instead of what we assign from the whole statement
when I tried to print out value of x and y, I get
999 (value of x)
[0.5, 738.5, 387.5, 224.5, 323.5, 302.5, 112.5, 655.5, 427.5, 873.5, 299.5, 997.5, 999.5, 999.5] (value of y)
I hence used a different variable x1 (see code snippet below) for the plot and all works well
def plot_best(the_map, route, iteration_number):
ax = sns.heatmap(the_map)
x1=[0.5] + [x + 0.5 for x in route[0:len(route)-1]] + [len(the_map) - 0.5]
y=[0.5] + [x + 0.5 for x in route[1:len(route)]] + [len(the_map) - 0.5]
plt.plot(x1, y, marker = 'o', linewidth=4, markersize=12, linestyle = "-", color='white')
#plt.savefig('images/new1000plot_%i.png' %(iteration_number), dpi=300)
plt.show()
Thanks again for the video.
Simulated Annealing
Sir, Can you please tell the approach of how to modify this algorithm according to simulated annealing procedure.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.