regimes_C = ['sparse', 'extreme_dilution', 'dense'] figFile = r'E:\KCL\FinalProject\figures\withoutExt\trials_0\alpha_1_C_3/' config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.allocator_type = 'BFC' config.gpu_options.per_process_gpu_memory_fraction = 0.95 dm = DynamicModel(temperature, N, avgDegree, alpha, tfConfig=config, gamma=gamma, withExt=True) re = Recoder(dm, totalSteps, binDist, False) simulator = MonteCarloSimulator(dm, totalSteps, numSim) matShape = (simulator.numSim, simulator.numSim) compute_q_matrix = Recoder.observable_matrix(re, simulator, matShape)(Recoder.EA_overlap) for reg_p in regimes_P: for reg_c in regimes_C: if reg_p is not 'limited': dm.regime_P(reg_p) else: dm.regime_P(reg_p, limitedRegimePatNum) if reg_c is not 'dense': dm.regime_C(reg_c) else:
# -*- coding: utf-8 -*- """ Created on Wed Jun 19 10:26:13 2019 @author: Jerry """ from GRN import DynamicModel, Recoder, MonteCarloSimulator N = 2000 alpha = 0.003 avgDegree = 3 temperature = 0.00 totalSteps = 50 binDist = 20 numSim = 20 dm = DynamicModel(temperature, N, avgDegree, alpha) re = Recoder(dm, totalSteps, binDist, False) simulator = MonteCarloSimulator(dm, totalSteps, numSim) matShape = (simulator.numSim, re.dynModel.P) simulator.simulation() compute_observable_matrix = Recoder.observable_matrix( re, simulator, matShape, True)(Recoder.hamming_overlap) print("computing observable matrix...") compute_observable_matrix() print("Done. Now drawing...") re.draw_distance_matrix()
regimes_C = ['sparse', 'extreme_dilution', 'dense'] figFile = r'E:\KCL\FinalProject\figures\withExt\trials_1\alpha_1_C_3/' config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.allocator_type = 'BFC' config.gpu_options.per_process_gpu_memory_fraction = 0.95 dm = DynamicModel(temperature, N, avgDegree, alpha, tfConfig=config, gamma=gamma, withExt=True) re = Recoder(dm, totalSteps, binDist, False) simulator = MonteCarloSimulator(dm, totalSteps, numSim) for reg_p in regimes_P: for reg_c in regimes_C: if reg_p is not 'limited': dm.regime_P(reg_p) else: dm.regime_P(reg_p, limitedRegimePatNum) if reg_c is not 'dense': dm.regime_C(reg_c) else: dm.regime_C(reg_c, denseRegimeExpRate) dm._init_memMat()
# -*- coding: utf-8 -*- """ Created on Sat Jun 15 18:01:49 2019 @author: Jerry """ from GRN import DynamicModel, Recoder N = 2000 alpha = 0.03 avgDegree = 1000 temperature = 0.00 totalSteps = 90 binDist = 20 dm = DynamicModel(temperature, N, avgDegree, alpha) re = Recoder(dm, totalSteps, binDist) multi_overlap_observation = Recoder.multi_observation(6)( Recoder.hamming_overlap) multi_overlap_observation(re) re.plot() mean_overlap_observation = Recoder.observation_mean(Recoder.hamming_overlap) mean_overlap_observation(re) re.plot() dist = Recoder.distribution(Recoder.hamming_overlap) dist(re) re.hist()
regimes_C = ['sparse', 'extreme_dilution', 'dense'] figFile = r'E:\KCL\FinalProject\figures\withExt\trials_1\alpha_1_C_3/' config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.allocator_type = 'BFC' config.gpu_options.per_process_gpu_memory_fraction = 0.95 dm = DynamicModel(temperature, N, avgDegree, alpha, tfConfig=config, gamma=gamma, withExt=False) re = Recoder(dm, totalSteps, binDist, False) simulator = MonteCarloSimulator(dm, totalSteps, numSim) for reg_p in regimes_P: for reg_c in regimes_C: if reg_p is not 'limited': dm.regime_P(reg_p) else: dm.regime_P(reg_p, limitedRegimePatNum) if reg_c is not 'dense': dm.regime_C(reg_c) else: dm.regime_C(reg_c, denseRegimeExpRate) dm._init_memMat()
numSim = 70 config = tf.ConfigProto() config.gpu_options.allow_growth=True config.gpu_options.allocator_type = 'BFC' config.gpu_options.per_process_gpu_memory_fraction = 0.95 dm = DynamicModel(temperature, N, avgDegree, alpha, ifDeco=False, tfConfig=config, withExt=False) recorder = Recoder(dm, totalSteps, binDist) simulator = MonteCarloSimulator(dm, totalSteps, numSim) matShape = (totalSteps, dm.P) compute_observable_matrix = Recoder.observable_matrix(recorder, simulator, matShape, True)(Recoder.hamming_overlap) for n in range(totalSteps): simulator.simulation(runByStep=True) compute_observable_matrix() resMat = recorder.disMat
""" import tensorflow as tf from GRN import DynamicModel,Recoder N = 2000 alpha = 0.09 avgDegree = 3 temperature = 0.0 totalSteps = 50 binDist = 20 runTimes = 1 config = tf.ConfigProto() config.gpu_options.allow_growth=True config.gpu_options.allocator_type = 'BFC' config.gpu_options.per_process_gpu_memory_fraction = 0.95 dm = DynamicModel(temperature, N, avgDegree, alpha, ifDeco=False, tfConfig=config, withExt=True) re = Recoder(dm,totalSteps,binDist,False) multi_overlap_observation = Recoder.multi_observation(55)(Recoder.hamming_overlap) for n in range(runTimes): multi_overlap_observation(re) re.plot() print("activity level: ",re.activity)