This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enter your code here. Read input from STDIN. Print output to STDOUT | |
| class Node: | |
| def __init__(self,value,point): | |
| self.value = value | |
| self.point = point | |
| self.parent = None | |
| self.H = 0 | |
| self.G = 0 | |
| def move_cost(self,other): | |
| return 0 if self.value == '.' else 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # On remote server | |
| jupyter notebook --no-browser | |
| # On local host | |
| ssh -N -f -L localhost:8888:localhost:8889 remoteuser@remotehost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Genetic Algorithm that solves the one-max problem. | |
| Genetic Algorithm that solves the one-max problem, many parameters in the GA | |
| can be changed by command line. This script has been designed for teaching | |
| GA. Its code is based on the inspyred library examples. | |
| This program is free software: you can redistribute it and/or modify it under | |
| the terms of the GNU General Public License as published by the Free Software | |
| Foundation, either version 3 of the License, or (at your option) any later | |
| version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dog: | |
| def __init__(self): | |
| self.name = "Unknown" | |
| self.age = 10 | |
| def bit(self): | |
| print(self.name + " has bitten") | |
| def describe(self): | |
| print("Name: ", self.name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Animal: | |
| def __init__(self): | |
| self.name = "Unknown" | |
| self.age = 10 | |
| def describe(self): | |
| print("Name: ", self.name) | |
| print("Age: ", self.age) | |
| class Dog(Animal): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Animal: | |
| def __init__(self): | |
| self.name = "Unknown" | |
| self.age = 10 | |
| def describe(self): | |
| print("Name: ", self.name) | |
| print("Age: ", self.age) | |
| def attack(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dog: | |
| def __init__(self): | |
| self.__name = "Unknown" | |
| self.__age = 10 | |
| def setName(self, name): | |
| self.__name = name | |
| def getName(self): | |
| return self.__name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Title: Moon probe evolution example | |
| # Author: Mike Vella | |
| # Adapted by David F. Barrero | |
| #start_imports | |
| import os | |
| import math | |
| import pylab | |
| import itertools | |
| from matplotlib import pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import keras | |
| from sacred import Experiment | |
| from sacred.observers import MongoObserver, FileStorageObserver | |
| ex = Experiment("keras-sacred") | |
| #ex.observers.append(MongoObserver()) | |
| ex.observers.append(FileStorageObserver("cnn-experiment")) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Title: Moon probe evolution example | |
| # Author: Mike Vella | |
| # | |
| # Modified by David F. Barrero | |
| # TODO: Change blend crossover by an arithmetic crossover | |
| #start_imports | |
| import os | |
| import math |