Get the initializers of the network, considering the pretrained models.

        :return: List of tuples (string name, mxnet initializer)
518711
def get_initializers(self) -> List[Tuple[str, mx.init.Initializer]]:
        
        patterns_vals = []
        # Load from args/auxs
        for k in self.args.keys():
            patterns_vals.append((k, mx.init.Load({k: self.args[k]})))
        for k in self.auxs.keys():
            patterns_vals.append((k, mx.init.Load({k: self.auxs[k]})))
        # Initialize
        for k in self.names:
            patterns_vals.append((k, mx.init.Xavier(rnd_type='uniform', factor_type='avg', magnitude=3)))

        return patterns_vals
1271123
def init_net_params(scale, layer_sizes, rs=npr.RandomState(0)):
    """"""
    return [(scale * rs.randn(m, n),   # weight matrix
             scale * rs.randn(n))      # bias vector
            for m, n in zip(layer_sizes[:-1], layer_sizes[1:])]
718678
private function getInitializers(): array
    {
        if (empty($this->sortedInitializers)) {
            $this->sortedInitializers = $this->sortInitializers();
        }

        return $this->sortedInitializers;
    }
715855
def initialize_fsm(self):
        
        self.fabric_fsm = {
            fw_const.INIT_STATE:
                [self.init_state, self.init_state],
            fw_const.OS_IN_NETWORK_STATE:
                [self.create_os_in_nwk, self.delete_os_in_nwk],
            fw_const.OS_OUT_NETWORK_STATE:
                [self.create_os_out_nwk, self.delete_os_out_nwk],
            fw_const.OS_DUMMY_RTR_STATE:
                [self.create_os_dummy_rtr, self.delete_os_dummy_rtr],
            fw_const.DCNM_IN_NETWORK_STATE:
                [self.create_dcnm_in_nwk, self.delete_dcnm_in_nwk],
            fw_const.DCNM_IN_PART_UPDATE_STATE:
                [self.update_dcnm_in_part, self.clear_dcnm_in_part],
            fw_const.DCNM_OUT_PART_STATE:
                [self.create_dcnm_out_part, self.delete_dcnm_out_part],
            fw_const.DCNM_OUT_NETWORK_STATE:
                [self.create_dcnm_out_nwk, self.delete_dcnm_out_nwk],
            fw_const.DCNM_OUT_PART_UPDATE_STATE:
                [self.update_dcnm_out_part, self.clear_dcnm_out_part],
            fw_const.FABRIC_PREPARE_DONE_STATE:
                [self.prepare_fabric_done, self.prepare_fabric_done]}
205768
def initialize_connections(self):
        
        n, m = self.connections.visible_to_hidden.shape
        self.connections.visible_to_hidden = np.zeros((n, m))

        for i in range(n):
            random_vector = self._random.rand(m)
            # norm          = np.sqrt( np.sum(random_vector * random_vector) )
            self.connections.visible_to_hidden[i]  = random_vector
1162066
def lstm_init_states(batch_size):
    
    hp = Hyperparams()
    init_shapes = lstm.init_states(batch_size=batch_size, num_lstm_layer=hp.num_lstm_layer, num_hidden=hp.num_hidden)
    init_names = [s[0] for s in init_shapes]
    init_arrays = [mx.nd.zeros(x[1]) for x in init_shapes]
    return init_names, init_arrays
112721
private void initializeNetwork()
	{
		this.hiddenLayerSize = this.hiddenLayerOption.getValue();
		this.learningRate = this.learningRateOption.getValue();
		this.threshold = this.thresholdOption.getValue();
		double[][] randomWeightsOne = new double[this.hiddenLayerSize][this.numAttributes];
		double[][] randomWeightsTwo = new double[this.numAttributes][this.hiddenLayerSize];
		
		for(int i = 0 ; i < this.numAttributes ; i++)
		{
			for(int j = 0 ; j < this.hiddenLayerSize ; j++)
			{
				randomWeightsOne[j][i] = this.classifierRandom.nextDouble();
				randomWeightsTwo[i][j] = this.classifierRandom.nextDouble();
			}
		}
		
		this.weightsOne = new Array2DRowRealMatrix(randomWeightsOne);
		this.weightsTwo = new Array2DRowRealMatrix(randomWeightsTwo);
		this.biasOne = this.classifierRandom.nextDouble();
		this.biasTwo = this.classifierRandom.nextDouble();
		
		this.reset = false;
	}
1204956
def _initialize_initial_state_fluents(self):
        ''''''
        state_fluents = self.rddl.domain.state_fluents
        initializer = self.rddl.instance.init_state
        self.initial_state_fluents = self._initialize_pvariables(
            state_fluents,
            self.rddl.domain.state_fluent_ordering,
            initializer)
        return self.initial_state_fluents
725633
def get_innerclasses(self):
          # noqa

        buff = self.get_attribute("InnerClasses")
        if buff is None:
            return tuple()

        with unpack(buff) as up:
            return tuple(up.unpack_objects(JavaInnerClassInfo, self.cpool))
1252346
def List(self, name, initial=None):
        
        return types.List(name, self.api, initial=initial)
1048927
def get_variables(self):
        
        variables = [variable.find('NAME').text for variable in self.network.findall('VARIABLE')]
        return variables
238966
def prior_model_tuples(self):
        
        return list(filter(lambda t: isinstance(t[1], AbstractPriorModel), self.__dict__.items()))
73108
def _initialize_operations(self):
    
    if isinstance(self._graph, tf.Graph):
      return self._graph.get_operations()
    elif isinstance(self._graph, mtf.Graph):
      return self._graph.operations
    else:
      raise TypeError('Graph is not tf.Graph or mtf.Graph: {}'
                      .format(type(self._graph)))
1203991
def network_sets(self):
        
        if not self.__network_sets:
            self.__network_sets = NetworkSets(self.__connection)
        return self.__network_sets
1188493
def _get_ctypes(self):
        
        ctypes = []
        for related_object in self.model._meta.get_all_related_objects():
            model = getattr(related_object, 'related_model', related_object.model)
            ctypes.append(ContentType.objects.get_for_model(model).pk)
            if model.__subclasses__():
                for child in model.__subclasses__():
                    ctypes.append(ContentType.objects.get_for_model(child).pk)
        return ctypes
832534
def _get_model_nodes(self, model):
        
        nodes = [(name, node) for name, node in model._nodes.items()
                if node._is_auto_created is False]
        nodes.sort(key=lambda n: n[0])
        return nodes
663918
def get_network(self):
        
        props = self.get_chain_properties()
        chain_id = props["chain_id"]
        for k, v in known_chains.items():
            if v["chain_id"] == chain_id:
                return v
        raise Exception("Connecting to unknown network!")