diff --git a/docs/source/networks.rst b/docs/source/networks.rst index 15d7cb80b0..abf75bda1d 100644 --- a/docs/source/networks.rst +++ b/docs/source/networks.rst @@ -99,7 +99,7 @@ Blocks .. autoclass:: SEResNetBottleneck :members: -`Squeeze-and-Excitation ResneXt Bottleneck` +`Squeeze-and-Excitation ResNeXt Bottleneck` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autoclass:: SEResNeXtBottleneck :members: diff --git a/monai/apps/pathology/datasets.py b/monai/apps/pathology/datasets.py index 01902d1ee2..cba8cd2da9 100644 --- a/monai/apps/pathology/datasets.py +++ b/monai/apps/pathology/datasets.py @@ -283,7 +283,7 @@ def _load_a_patch(self, index): """ Load sample given the index - Since index is sequential and the patches are comming in an stream from different images, + Since index is sequential and the patches are coming in an stream from different images, this method, first, finds the whole slide image and the patch that should be extracted, then it loads the patch and provide it with its image name and the corresponding mask location. """ diff --git a/monai/csrc/filtering/bilateral/bilateralfilter_cuda_phl.cu b/monai/csrc/filtering/bilateral/bilateralfilter_cuda_phl.cu index 603ab689cf..17dc9e7ebd 100644 --- a/monai/csrc/filtering/bilateral/bilateralfilter_cuda_phl.cu +++ b/monai/csrc/filtering/bilateral/bilateralfilter_cuda_phl.cu @@ -95,7 +95,7 @@ void BilateralFilterPHLCuda( cudaMalloc(&data, desc.batchCount * desc.channelStride * desc.channelCount * sizeof(scalar_t)); cudaMalloc(&features, desc.batchCount * desc.channelStride * featureChannelCount * sizeof(scalar_t)); - // Prparing constant memory + // Preparing constant memory cudaMemcpyToSymbol(cBatchStride, &desc.batchStride, sizeof(int)); cudaMemcpyToSymbol(cChannelStride, &desc.channelStride, sizeof(int)); cudaMemcpyToSymbol(cSpatialStrides, desc.strides, sizeof(int) * desc.dimensions); diff --git a/monai/csrc/filtering/permutohedral/hash_table.cuh b/monai/csrc/filtering/permutohedral/hash_table.cuh index 7d9d7eb163..f9893dffe2 100644 --- a/monai/csrc/filtering/permutohedral/hash_table.cuh +++ b/monai/csrc/filtering/permutohedral/hash_table.cuh @@ -15,7 +15,7 @@ limitations under the License. //#define USE_ADDITIVE_HASH -// turn this on if you want to get slighly less memory consumption and slightly longer run times. +// turn this on if you want to get slightly less memory consumption and slightly longer run times. //#define LINEAR_D_MEMORY #define USE_CUSTOM_MODULO diff --git a/monai/networks/blocks/crf.py b/monai/networks/blocks/crf.py index 27556a2c72..635c750ba9 100644 --- a/monai/networks/blocks/crf.py +++ b/monai/networks/blocks/crf.py @@ -20,7 +20,7 @@ class CRF(torch.nn.Module): """ Conditional Random Field: Combines message passing with a class - compatability convolution into an iterative process designed + compatibility convolution into an iterative process designed to successively minimise the energy of the class labeling. In this implementation, the message passing step is a weighted @@ -40,7 +40,7 @@ def __init__( bilateral_color_sigma: float = 0.5, gaussian_spatial_sigma: float = 5.0, update_factor: float = 3.0, - compatability_kernel_range: int = 1, + compatibility_kernel_range: int = 1, iterations: int = 5, ): """ @@ -51,7 +51,7 @@ def __init__( bilateral_color_sigma: standard deviation in color space for the bilateral term. gaussian_spatial_sigma: standard deviation in spatial coordinates for the gaussian term. update_factor: determines the magnitude of each update. - compatability_kernel_range: the range of the kernel used in the compatability convolution. + compatibility_kernel_range: the range of the kernel used in the compatibility convolution. iterations: the number of iterations. """ super(CRF, self).__init__() @@ -61,14 +61,14 @@ def __init__( self.bilateral_color_sigma = bilateral_color_sigma self.gaussian_spatial_sigma = gaussian_spatial_sigma self.update_factor = update_factor - self.compatability_kernel_range = compatability_kernel_range + self.compatibility_kernel_range = compatibility_kernel_range self.iterations = iterations def forward(self, input_tensor: torch.Tensor, reference_tensor: torch.Tensor): """ Args: input_tensor: tensor containing initial class logits. - referenece_tensor: the reference tensor used to guide the message passing. + reference_tensor: the reference tensor used to guide the message passing. Returns: output (torch.Tensor): output tensor. @@ -77,7 +77,7 @@ def forward(self, input_tensor: torch.Tensor, reference_tensor: torch.Tensor): # useful values spatial_dim = input_tensor.dim() - 2 class_count = input_tensor.size(1) - padding = self.compatability_kernel_range + padding = self.compatibility_kernel_range # constructing spatial feature tensor spatial_features = _create_coordinate_tensor(reference_tensor) @@ -88,18 +88,18 @@ def forward(self, input_tensor: torch.Tensor, reference_tensor: torch.Tensor): ) gaussian_features = spatial_features / self.gaussian_spatial_sigma - # compatability matrix (potts model (1 - diag) for now) - compatability_matrix = _potts_model_weights(class_count).to(device=input_tensor.device) + # compatibility matrix (potts model (1 - diag) for now) + compatibility_matrix = _potts_model_weights(class_count).to(device=input_tensor.device) # expanding matrix to kernel - compatability_kernel = _expand_matrix_to_kernel( - compatability_matrix, spatial_dim, self.compatability_kernel_range + compatibility_kernel = _expand_matrix_to_kernel( + compatibility_matrix, spatial_dim, self.compatibility_kernel_range ) # choosing convolution function conv = [conv1d, conv2d, conv3d][spatial_dim - 1] - # seting up output tensor + # setting up output tensor output_tensor = softmax(input_tensor, dim=1) # mean field loop @@ -114,7 +114,7 @@ def forward(self, input_tensor: torch.Tensor, reference_tensor: torch.Tensor): # compatibility convolution combined_output = pad(combined_output, 2 * spatial_dim * [padding], mode="replicate") - compatibility_update = conv(combined_output, compatability_kernel) + compatibility_update = conv(combined_output, compatibility_kernel) # update and normalize output_tensor = softmax(input_tensor - self.update_factor * compatibility_update, dim=1) diff --git a/monai/networks/blocks/regunet_block.py b/monai/networks/blocks/regunet_block.py index f4c2c1f3a7..591837be75 100644 --- a/monai/networks/blocks/regunet_block.py +++ b/monai/networks/blocks/regunet_block.py @@ -227,7 +227,7 @@ def __init__( spatial_dims: number of spatial dimensions extract_levels: spatial levels to extract feature from, 0 refers to the input scale num_channels: number of channels at each scale level, - List or Tuple of lenth equals to `depth` of the RegNet + List or Tuple of length equals to `depth` of the RegNet out_channels: number of output channels kernel_initializer: kernel initializer activation: kernel activation function diff --git a/monai/networks/layers/filtering.py b/monai/networks/layers/filtering.py index fc6c0a38b5..3b2214d59a 100644 --- a/monai/networks/layers/filtering.py +++ b/monai/networks/layers/filtering.py @@ -32,7 +32,7 @@ class BilateralFilter(torch.autograd.Function): input: input tensor. spatial sigma: the standard deviation of the spatial blur. Higher values can - hurt performace when not using the approximate method (see fast approx). + hurt performance when not using the approximate method (see fast approx). color sigma: the standard deviation of the color blur. Lower values preserve edges better whilst higher values tend to a simple gaussian spatial blur. @@ -95,7 +95,7 @@ def forward(ctx, input, features, sigmas=None): @staticmethod def backward(ctx, grad_output): - raise NotImplementedError("PHLFilter does not currently support backpropergation") + raise NotImplementedError("PHLFilter does not currently support Backpropagation") # scaled_features, = ctx.saved_variables # grad_input = _C.phl_filter(grad_output, scaled_features) # return grad_input diff --git a/monai/transforms/compose.py b/monai/transforms/compose.py index d509ea33a1..dd40663e2a 100644 --- a/monai/transforms/compose.py +++ b/monai/transforms/compose.py @@ -19,7 +19,7 @@ from monai.transforms.inverse import InvertibleTransform -# For backwards compatiblity (so this still works: from monai.transforms.compose import MapTransform) +# For backwards compatibility (so this still works: from monai.transforms.compose import MapTransform) from monai.transforms.transform import ( # noqa: F401 MapTransform, Randomizable, diff --git a/tests/test_crf_cpu.py b/tests/test_crf_cpu.py index f6e82d16a5..41ae75f4b4 100644 --- a/tests/test_crf_cpu.py +++ b/tests/test_crf_cpu.py @@ -30,7 +30,7 @@ 0.5, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 5, # iterations ], # Input @@ -92,7 +92,7 @@ 0.5, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 5, # iterations ], # Input @@ -189,7 +189,7 @@ 0.1, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 2, # iterations ], # Input diff --git a/tests/test_crf_cuda.py b/tests/test_crf_cuda.py index 55d57d67bf..6e67d4ec8c 100644 --- a/tests/test_crf_cuda.py +++ b/tests/test_crf_cuda.py @@ -30,7 +30,7 @@ 0.5, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 5, # iterations ], # Input @@ -92,7 +92,7 @@ 0.5, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 5, # iterations ], # Input @@ -189,7 +189,7 @@ 0.1, # bilateral_color_sigma 5.0, # gaussian_spatial_sigma 1.0, # update_factor - 1, # compatability_kernel_range + 1, # compatibility_kernel_range 2, # iterations ], # Input