Beispiel #1
0
    def _setup_initial_blobs(self):
        MLTrainer._setup_initial_blobs(self)

        self.output_conv_blob = "Conv_output_{}".format(self.model_id)
        workspace.FeedBlob(self.output_conv_blob, np.zeros(1,
                                                           dtype=np.float32))

        self.conv_weights: List[str] = []
        self.conv_biases: List[str] = []

        for x in six.moves.range(len(self.dims) - 1):
            dim_in = self.dims[x]
            dim_out = self.dims[x + 1]
            kernel_h = self.conv_height_kernels[x]
            kernel_w = self.conv_width_kernels[x]

            weight_shape = [dim_out, kernel_h, kernel_w, dim_in]
            bias_shape = [
                dim_out,
            ]

            conv_weight_name = "ConvWeights_" + str(x) + "_" + self.model_id
            bias_name = "ConvBiases_" + str(x) + "_" + self.model_id
            self.conv_weights.append(conv_weight_name)
            self.conv_biases.append(bias_name)

            conv_bias = np.zeros(shape=bias_shape, dtype=np.float32)
            workspace.FeedBlob(bias_name, conv_bias)

            conv_weights = scipy.stats.norm(0, np.sqrt(
                1 / dim_in)).rvs(size=weight_shape).astype(np.float32)
            workspace.FeedBlob(conv_weight_name, conv_weights)
Beispiel #2
0
    def _setup_initial_blobs(self):
        self.input_dim = self.num_state_features
        self.output_dim = self.num_actions

        self.action_blob = "action"
        workspace.FeedBlob(self.action_blob, np.zeros(1, dtype=np.float32))

        MLTrainer._setup_initial_blobs(self)
Beispiel #3
0
    def _setup_initial_blobs(self):
        self.input_dim = self.num_features
        self.output_dim = 1

        MLTrainer._setup_initial_blobs(self)
 def _setup_initial_blobs(self):
     MLTrainer._setup_initial_blobs(self)
     if self.scaled_output:
         self._setup_initial_extension_blobs()
 def _setup_initial_blobs(self):
     MLTrainer._setup_initial_blobs(self)
     if self.extension_mltrainer is not None or self.scaled_output:
         self._setup_initial_extension_blobs()
    def _setup_initial_blobs(self):
        self.input_dim = self.num_state_features + self.num_action_features
        self.output_dim = 1

        MLTrainer._setup_initial_blobs(self)