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
| from string import ascii_uppercase as ascii_up | |
| from random import choice, uniform | |
| from copy import deepcopy | |
| class Particle(object): | |
| def __init__(self, dim, limit_max, limit_min): | |
| self._position = [ord(choice(ascii_up)) for _ in range(dim)] | |
| self._best_posit = self._position[::] | |
| self._fitness = None | |
| self._best_fitness = None |
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 numpy as np | |
| class Perceptron(object): | |
| ''' | |
| Implementacao do perceptron | |
| ''' | |
| def __init__(self, dimensoes): | |
| ''' | |
| :dimensoes: list com o nome das variaveis de entrada | |
| ''' | |
| for dim in dimensoes: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| """ | |
| dependências: | |
| * python2 | |
| * opencv | |
| * numpy | |
| * matplotlib | |
| """ | |
| import cv2 | |
| import numpy as np |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #Pkg.add("Primes") | |
| using Primes | |
| function genBigPrime() | |
| prime = 0 | |
| while prime == 0 | |
| #possiblePrime = rand(BigInt(1e+50):BigInt(1e+100)) | |
| possiblePrime = Int(rand(1e+2:1e+4)) | |
| if isprime(possiblePrime) | |
| prime = possiblePrime |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer