Skip to content

Instantly share code, notes, and snippets.

Avatar

Lincoln de Macêdo demacdolincoln

  • Brasil
View GitHub Profile
@demacdolincoln
demacdolincoln / pso.py
Created Sep 21, 2015
uma adaptação do PSO que busca uma palavra, apenas um simples exercício para ajudar a esclarecer seu funcionamento. como se trata de valores aleatórios e como eu não me preocupei com muitos detalhes, pode ser que algumas vezes o algoritmo não funcione
View pso.py
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
View perceptron.py
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:
View schaffer_4.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View comparação de topologias 1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View teste_opencv_1.py
"""
dependências:
* python2
* opencv
* numpy
* matplotlib
"""
import cv2
import numpy as np
View slides.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fractal.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View elnino_jl.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View rsa.jl
#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
View exercicio_industrializacao_Brasil.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.