Last active
January 17, 2020 09:05
-
-
Save tarlanahad/1493ffa73598af40b10ac23918f835d3 to your computer and use it in GitHub Desktop.
This file contains 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 PSO: | |
w = 0.729 | |
c1 = 1.49445 | |
c2 = 1.49445 | |
lr = 0.01 | |
def __init__(self, dims, numOfBoids, numOfEpochs): | |
self.swarm_list = [self.Particle(dims, -500, 500) for i in range(numOfBoids)] | |
self.numOfEpochs = numOfEpochs | |
self.best_swarm_position = np.random.uniform(low=-500, high=500, size=dims) | |
self.best_swarm_error = 1e80 # Set high value to best swarm error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment