@@ -43,7 +43,7 @@ def SOM_Batch(
4343 radii : tuple ,
4444 ncodes : int ,
4545 rlen : int ,
46- nr_batches : int = 10 ,
46+ num_batches : int = 10 ,
4747 distf : Callable [[np .ndarray , np .ndarray ], float ] = eucl_without_sqrt ,
4848 seed = None ,
4949):
@@ -57,7 +57,7 @@ def SOM_Batch(
5757 radii (tuple): The radii.
5858 ncodes (int): The number of codes.
5959 rlen (int): The number of iterations.
60- nr_batches (int): The number of batches.
60+ num_batches (int): The number of batches.
6161 distf (function): The distance function.
6262 seed (int): The seed for the random number generator.
6363
@@ -82,7 +82,7 @@ def SOM_Batch(
8282 treshold_step = (radii [0 ] - radii [1 ]) / niter
8383
8484 # Keep the temporary codes, using the given codes as the initial codes, for every batch
85- tmp_codes_all = np .empty ((nr_batches , ncodes , px ), dtype = np .float64 )
85+ tmp_codes_all = np .empty ((num_batches , ncodes , px ), dtype = np .float64 )
8686
8787 # Copy the codes as a float64, because the codes are updated in the algorithm
8888 copy_codes = codes .copy ().astype (np .float64 )
@@ -117,14 +117,14 @@ def SOM_Batch(
117117 init_threshold -= treshold_step
118118
119119 # Choose random data points, for the different batches, and the rlen iterations
120- data_points_random = np .random .choice (n , nr_batches * rlen * n , replace = True )
120+ data_points_random = np .random .choice (n , num_batches * rlen * n , replace = True )
121121
122122 # Decrease the number of iterations, because the first iterations are already done
123123 rlen = int (rlen / 2 )
124124
125125 for iteration in range (rlen ):
126126 # Execute the batches in parallel
127- for batch_nr in prange (nr_batches ):
127+ for batch_nr in prange (num_batches ):
128128 # Keep the temporary codes, using the given codes as the initial codes
129129 tmp_codes = copy_codes .copy ()
130130
0 commit comments