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 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() |
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
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'] |
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
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; # |
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
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); |
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
from mnet_pack import * | |
# Multi topologies network and cyclic Kinouchi-Copelli like automatas | |
# Copyleft (AA) 2014 ooOOOoooOOOoo8OOOooooOOOOooo8ooOO69 | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero 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 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 | |
from types import * | |
sin = np.sin | |
# Deterministic Kuramoto model like functions | |
# Copyright (C) 2013 \0/\o/\0/\o/\0/ | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the |
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
''' | |
@author: Uiuran 2013 | |
''' | |
from GraphMovie import GraphMovie | |
import igraph | |
import numpy as np | |
import agents0020 as am | |
if __name__ == "__main__": |
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
#agent002, agent simulation in a General Topology with 1 float field for each agent (node) and random sampling of interactions (egdes) between time step, the process evaluation is a adition of the mean interaction to the fields { fieldA[time] =( fieldA[ time-1] + fieldB[time-1])/2 , the same is true for fieldB}, ie homophilic interaction, the agents start with random float number sampled from uniform [0,1). This process prints the visualization of the network. | |
#import paintGraph as pg | |
import numpy as np | |
import networkx as nx | |
import GraphMovie as gm | |
import igraph | |
class AgentModel(object): | |
''' |
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
import numpy as np | |
import scipy | |
from scipy.integrate import * | |
import matplotlib.pyplot as plot | |
sin = np.sin | |
def kuramotoGrid(x,t0, K, w): | |
l = [len(w[1,:]),len(w[:,1])]; | |
x = x.reshape((l[1],l[0])); | |
# l[0] is horizontal, columns, l[1] is vertical, rows, dimension |
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
import Image | |
import numpy as np | |
import scipy | |
# To test the codes put a number between [1,2] in the variable do_code | |
do_code = 2; | |
if do_code == 1: | |
import kuramotoGrid as kg | |
K = 20.0 |
NewerOlder