Giter VIP home page Giter VIP logo

ga_in_python's People

Contributors

gmichaelson avatar medicyp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ga_in_python's Issues

Simulated Annealing

Sir, Can you please tell the approach of how to modify this algorithm according to simulated annealing procedure.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.