def __init__(self, num_pixels, layers, H_decision, imageSize): super(PropagationOnly_SharedPixel, self).__init__() weightMask, diagMask, edgeMask, cornerMask = generateFixedWeightMask_PredPrey( imageSize) self.iteratedLayer_Pred = RangePropgation_SharedPixel( num_pixels, num_pixels, layers, weightMask, diagMask, edgeMask, cornerMask)
def __init__(self, num_pixels, layers, H_decision, imageSize): super(FixedAll_PredPrey, self).__init__() weightMask, diagMask, edgeMask, cornerMask = generateFixedWeightMask_PredPrey( imageSize) self.iteratedLayer = RecurrentDecision_FixedAll( num_pixels, num_pixels, layers, weightMask, diagMask, edgeMask, cornerMask)
def __init__(self, num_pixels, layers, H_decision, imageSize): super(Fixed_PredPrey, self).__init__() weightMask, diagMask, edgeMask, cornerMask = generateFixedWeightMask_PredPrey( imageSize) self.iteratedLayer = FixedPropagationDecision(num_pixels, num_pixels, layers, weightMask, diagMask, edgeMask, cornerMask)
def __init__(self, num_pixels, layers, H_decision, imageSize): super(RecurrentSharedPixel_PredPrey, self).__init__() weightMask, diagMask, edgeMask, cornerMask = generateFixedWeightMask_PredPrey( imageSize) self.iteratedLayer_Pred = RepeatedLayersSharedPixel( num_pixels, num_pixels, layers, weightMask, diagMask, edgeMask, cornerMask) self.tanh = nn.Tanh()
cmap2._init() # create the _lut array, with rgba values cmap3._init() # create your alpha array and fill the colormap with them. # here it is progressive, but you can create whathever you want alphas = np.linspace(0, 0.8, cmap2.N + 3) cmap2._lut[:, -1] = alphas cmap3._lut[:, -1] = alphas # General parameters that would get set in other code image_size = 15 N = image_size num_nodes = image_size**2 weightMask, diagMask, edgeMask, cornerMask = generateFixedWeightMask_PredPrey( image_size) centerMask = ~(edgeMask + cornerMask) dtype = torch.FloatTensor testDict = generateSamples(image_size, 2, 10) for i in range(3): modelBlock_State = torch.load(model_path + model_name[i], map_location=torch.device('cpu')) modelBlock = loadStateDict(modelBlock_State) layers = layers_list[i]