(self, in_obj)
Determine dimensions of cost and error buffers and allocate space from the input layer

        Arguments:
            in_obj (Layer): input layer from which to calculate costs
Determine dimensions of cost and error buffers and allocate space from the input layer
Determine dimensions of cost and error buffers and allocate space from the input layer
def initialize(self, in_obj):
        """
        Determine dimensions of cost and error buffers and allocate space from the input layer

        Arguments:
            in_obj (Layer): input layer from which to calculate costs
        """

        assert isinstance(in_obj, Layer)
        self.prev_layer = in_obj
        self.parallelism = self.prev_layer.parallelism
        self.costfunc.parallelism = self.parallelism
        (_, self.nstep) = interpret_in_shape(in_obj.out_shape)
        self.outputs = self.be.iobuf((1, self.nstep),
                                     parallelism=self.parallelism,
                                     persist_values=False)
        self.deltas = self.be.iobuf(in_obj.out_shape,
                                    parallelism=self.parallelism,
                                    persist_values=False)
        self.cost = np.empty([1, 1], dtype=np.float32)
def initialize ( self , in_obj ) : assert isinstance ( in_obj , Layer ) self . prev_layer = in_obj self . parallelism = self . prev_layer . parallelism self . costfunc . parallelism = self . parallelism ( _ , self . nstep ) = interpret_in_shape ( in_obj . out_shape ) self . outputs = self . be . iobuf ( ( 1 , self . nstep ) , parallelism = self . parallelism , persist_values = False ) self . deltas = self . be . iobuf ( in_obj . out_shape , parallelism = self . parallelism , persist_values = False ) self . cost = np . empty ( [ 1 , 1 ] , dtype = np . float32 )