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 / neuron_logistic.py
Created December 6, 2012 04:02
Logistic Neuron class
""" NeuronLogistic class to logistic neurons with logit input """
# Field input receives a dictionaire where key = number of the input unit,
# element = length 2 list with signal and synaptic weights respectively
import numpy as np
class NeuronLogistic:
def __init__(self,presynaptics):
if type(presynaptics) != dict:
@Uiuran
Uiuran / neural_net.py
Created December 8, 2012 17:49
Minimum framework for simulation of neural networks evolution and computing
""" NeuralNetwork class to arrange neurons in a topology and do dynamics """
# MinimumBrain is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# MinimumBrain is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Uiuran
Uiuran / GraphMovie.py
Last active December 15, 2015 08:59 — forked from mjbommar/GraphMovie.py
'''
@Forked by Uiuran (c) 2013
@date Feb 21, 2011
@original author: mjbommar (c) 2011
@license Simplified BSD, (C) 2011.
Free to use for non-commerical purposes. Attribution appreciated :)
'''
import igraph
'''
@Fork by Uiuran 2013
@created on Jan 17, 2010
@author: mjbommar
'''
from GraphMovie import GraphMovie
import igraph
import numpy as np
@Uiuran
Uiuran / simulateImage.py
Last active December 15, 2015 12:39
Generative texture research
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
@Uiuran
Uiuran / kuramotoGrid.py
Last active December 25, 2018 18:13
Sinusoid coupled functions with natural frequency "w" with eight neighbors coupling Grid (except for the border that behaves like a bi-dimensional Grid)
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
@Uiuran
Uiuran / agent0020.py
Last active December 15, 2015 19:49
Preliminar version of random agent in complex network topology simulation AND animation
#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):
'''
'''
@author: Uiuran 2013
'''
from GraphMovie import GraphMovie
import igraph
import numpy as np
import agents0020 as am
if __name__ == "__main__":
@Uiuran
Uiuran / kuramoto.py
Last active December 18, 2015 21:28
deterministic kuramoto models
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
@Uiuran
Uiuran / multi_topos.py
Last active January 4, 2016 04:19
This code is to simulate a multi-topology network with homeostatic individuals that are influential on their neighbors. The code is not perfect yet, mnet_pack are networkx, numpy and other necessaries packages to come...
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.