# -*- 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()
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() print("now is in " + reg_p + " and " + reg_c + " regime...")