def fprop(self, input, output, train=TRAIN): cudaconv2.localFilterActs(input, self.weight.wt, output, self.img_size, self.outputSize, self.outputSize, -self.padding, self.stride, self.numColor, 1) #util.log_info('%s', output.get().mean()) self.tmp = gpuarray.empty((self.numFilter, self.get_single_img_size() * self.batch_size / self.numFilter), dtype=np.float32) add_vec_to_rows(output, self.bias.wt) if PFout: print_matrix(output, self.name)
def fprop(self, input, output, train=TRAIN): cudaconv2.localFilterActs(input, self.weight.wt, output, self.img_size, self.outputSize, self.outputSize, -self.padding, self.stride, self.numColor, 1) #util.log_info('%s', output.get().mean()) self.tmp = gpuarray.empty((self.numFilter, self.get_single_img_size() * self.batch_size / self.numFilter), dtype=np.float32) add_vec_to_rows(output, self.bias.wt) if PFout: print_matrix(output, self.name)
def fprop(self, input, output, train=TRAIN): gpu_copy_to(dot(self.weight.wt, input), output) add_vec_to_rows(output, self.bias.wt) if train == TEST: if self.dropRate > 0.0: output *= (1.0 - self.dropRate) else: if self.dropRate > 0.0: self.dropMask = to_gpu(np.random.uniform(0, 1, output.size).astype(np.float32).reshape(output.shape)) bigger_than_scaler(self.dropMask, self.dropRate) gpu_copy_to(output * self.dropMask, output) if PFout: print_matrix(output, self.name)
def fprop(self, input, output, train=TRAIN): gpu_copy_to(dot(self.weight.wt, input), output) add_vec_to_rows(output, self.bias.wt) if train == TEST: if self.dropRate > 0.0: output *= (1.0 - self.dropRate) else: if self.dropRate > 0.0: self.dropMask = to_gpu(np.random.uniform(0, 1, output.size).astype(np.float32).reshape(output.shape)) bigger_than_scaler(self.dropMask, self.dropRate) gpu_copy_to(output * self.dropMask, output) if PFout: print_matrix(output, self.name)