Skip to content

Commit 1cfca52

Browse files
xiaoxianBoycclausstianyizheng02
authored
chore: fix typos (#11467)
* chore: fix typos Signed-off-by: snoppy <michaleli@foxmail.com> * Apply suggestions from code review Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com> --------- Signed-off-by: snoppy <michaleli@foxmail.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
1 parent 31d1cd8 commit 1cfca52

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

computer_vision/haralick_descriptors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def transform(
141141

142142
center_x, center_y = (x // 2 for x in kernel.shape)
143143

144-
# Use padded image when applying convolotion
144+
# Use padded image when applying convolution
145145
# to not go out of bounds of the original the image
146146
transformed = np.zeros(image.shape, dtype=np.uint8)
147147
padded = np.pad(image, 1, "constant", constant_values=constant)

graphs/strongly_connected_components.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def find_components(
3838
reversed_graph: dict[int, list[int]], vert: int, visited: list[bool]
3939
) -> list[int]:
4040
"""
41-
Use depth first search to find strongliy connected
41+
Use depth first search to find strongly connected
4242
vertices. Now graph is reversed
4343
>>> find_components({0: [1], 1: [2], 2: [0]}, 0, 5 * [False])
4444
[0, 1, 2]

maths/points_are_collinear_3d.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ def get_3d_vectors_cross(ab: Vector3d, ac: Vector3d) -> Vector3d:
7676

7777
def is_zero_vector(vector: Vector3d, accuracy: int) -> bool:
7878
"""
79-
Check if vector is equal to (0, 0, 0) of not.
79+
Check if vector is equal to (0, 0, 0) or not.
8080
81-
Sine the algorithm is very accurate, we will never get a zero vector,
81+
Since the algorithm is very accurate, we will never get a zero vector,
8282
so we need to round the vector axis,
8383
because we want a result that is either True or False.
8484
In other applications, we can return a float that represents the collinearity ratio.
@@ -97,9 +97,9 @@ def are_collinear(a: Point3d, b: Point3d, c: Point3d, accuracy: int = 10) -> boo
9797
"""
9898
Check if three points are collinear or not.
9999
100-
1- Create tow vectors AB and AC.
101-
2- Get the cross vector of the tow vectors.
102-
3- Calcolate the length of the cross vector.
100+
1- Create two vectors AB and AC.
101+
2- Get the cross vector of the two vectors.
102+
3- Calculate the length of the cross vector.
103103
4- If the length is zero then the points are collinear, else they are not.
104104
105105
The use of the accuracy parameter is explained in is_zero_vector docstring.

neural_network/convolution_neural_network.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
- - - - - -- - - - - - - - - - - - - - - - - - - - - - -
33
Name - - CNN - Convolution Neural Network For Photo Recognizing
4-
Goal - - Recognize Handing Writing Word Photo
4+
Goal - - Recognize Handwriting Word Photo
55
Detail: Total 5 layers neural network
66
* Convolution layer
77
* Pooling layer
@@ -135,7 +135,7 @@ def convolute(self, data, convs, w_convs, thre_convs, conv_step):
135135
)
136136
data_featuremap.append(featuremap)
137137

138-
# expanding the data slice to One dimenssion
138+
# expanding the data slice to one dimension
139139
focus1_list = []
140140
for each_focus in data_focus:
141141
focus1_list.extend(self.Expand_Mat(each_focus))
@@ -304,7 +304,7 @@ def draw_error():
304304
plt.grid(True, alpha=0.5)
305305
plt.show()
306306

307-
print("------------------Training Complished---------------------")
307+
print("------------------Training Complete---------------------")
308308
print((" - - Training epoch: ", rp, f" - - Mse: {mse:.6f}"))
309309
if draw_e:
310310
draw_error()
@@ -353,5 +353,5 @@ def convolution(self, data):
353353

354354
if __name__ == "__main__":
355355
"""
356-
I will put the example on other file
356+
I will put the example in another file
357357
"""

0 commit comments

Comments
 (0)