Skip to content

Instantly share code, notes, and snippets.

View Uiuran's full-sized avatar
💭
Focus and Flowers

Daniel Penalva Uiuran

💭
Focus and Flowers
View GitHub Profile
@Uiuran
Uiuran / kc.py
Last active December 21, 2018 22:43
Simula automata neural de Kinouchi-Copelli
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
def kc( ativos0, num_estados, rede, tempo):
firstN = set();
ativos = set();
ativos.add(ativos0);
firstN.add(ativos0);
@Uiuran
Uiuran / rw2D.py
Last active December 21, 2018 23:14
Metodo monte-carlo
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
dx = 0.001;
dy = 0.001;
alpha = 0.025; # quando alpha e beta != 0 teremos drift, isso eh, ddeslocamento do centro de massa
beta = 0.025; #
a = 0.25; # quando a = b = 1/4, difusao eh homogenea
b = 0.25; #
@Uiuran
Uiuran / keras_super_duper_decorator.py
Created September 23, 2019 12:31
Decorator used in keras test methods, ultra xeno though, hard to understand
def run_with_all_model_types(
test_or_class=None,
exclude_models=None):
"""Execute the decorated test with all Keras model types.
This decorator is intended to be applied either to individual test methods in
a `keras_parameterized.TestCase` class, or directly to a test class that
extends it. Doing so will cause the contents of the individual test
method (or all test methods in the class) to be executed multiple times - once
for each Keras model type.
The Keras model types are: ['functional', 'subclass', 'sequential']
@Uiuran
Uiuran / gist:52e1a0a377621522edbc70fbd024e7c9
Created October 7, 2019 01:31
Builder with super function as calling Parent Class
class Person(object):
def __init__(self):
self.name = None
self.position = None
self.date_of_birth = None
def __str__(self):
return '{} born on {} works as a {}'.format(self.name,self.date_of_birth,self.position)
# @staticmethod
# def new():
# return PersonBuilder()