Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gradient_epoch_start: int = 20,
centering: bool = True):
super(LinearPCALayer, self).__init__()
self.register_buffer('eigenvalues', torch.zeros(in_features, dtype=torch.float64))
self.register_buffer('eigenvectors', torch.zeros((in_features, in_features), dtype=torch.float64))
self.register_buffer('_threshold', torch.Tensor([threshold]).type(torch.float64))
self.register_buffer('sum_squares', torch.zeros((in_features, in_features), dtype=torch.float64))
self.register_buffer('seen_samples', torch.zeros(1, dtype=torch.float64))
self.register_buffer('running_sum', torch.zeros(in_features, dtype=torch.float64))
self.register_buffer('mean', torch.zeros(in_features, dtype=torch.float32))
self.keepdim: bool = keepdim
self.verbose: bool = verbose
self.pca_computed: bool = True
self.gradient_epoch = gradient_epoch_start
self.epoch = 0
self.name = f'pca{LinearPCALayer.num}'
LinearPCALayer.num += 1
self._centering = centering
self.data_dtype = None
centering: bool = True):
super(LinearPCALayer, self).__init__()
self.register_buffer('eigenvalues', torch.zeros(in_features, dtype=torch.float64))
self.register_buffer('eigenvectors', torch.zeros((in_features, in_features), dtype=torch.float64))
self.register_buffer('_threshold', torch.Tensor([threshold]).type(torch.float64))
self.register_buffer('sum_squares', torch.zeros((in_features, in_features), dtype=torch.float64))
self.register_buffer('seen_samples', torch.zeros(1, dtype=torch.float64))
self.register_buffer('running_sum', torch.zeros(in_features, dtype=torch.float64))
self.register_buffer('mean', torch.zeros(in_features, dtype=torch.float32))
self.keepdim: bool = keepdim
self.verbose: bool = verbose
self.pca_computed: bool = True
self.gradient_epoch = gradient_epoch_start
self.epoch = 0
self.name = f'pca{LinearPCALayer.num}'
LinearPCALayer.num += 1
self._centering = centering
self.data_dtype = None