Skip to content

Commit ad01618

Browse files
committed
Fix non-breaking typos
1 parent eb7c626 commit ad01618

File tree

9 files changed

+20
-22
lines changed

9 files changed

+20
-22
lines changed

autograd/context.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mut:
1313
// This list can contain duplicates
1414
nodes []&Node[T]
1515
// If no_grad is set to true, operations will not
16-
// be cached, and backpropogation will not be possible
16+
// be cached, and backpropagation will not be possible
1717
no_grad bool
1818
}
1919

autograd/gate.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import vtl
55
pub interface CacheParam {}
66

77
// Gate is an object that can cache the result of an operation,
8-
// as well as backpropogate a payload backwards along the
8+
// as well as backpropagate a payload backwards along the
99
// computational graph
1010
//
1111
// Structs that implement from this interface can add instance

autograd/gates_basic.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub fn subtract_gate[T]() &SubstractGate[T] {
4545

4646
pub fn (g &SubstractGate[T]) backward[T](payload &Payload[T]) ![]&vtl.Tensor[T] {
4747
gradient := payload.variable.grad
48-
oposite := gradient.multiply_scalar[T](vtl.cast[T](-1))!
49-
return [gradient, oposite]
48+
opposite := gradient.multiply_scalar[T](vtl.cast[T](-1))!
49+
return [gradient, opposite]
5050
}
5151

5252
pub fn (g &SubstractGate[T]) cache[T](mut result Variable[T], args ...CacheParam) ! {
@@ -134,8 +134,8 @@ pub fn (g &DivideGate[T]) backward[T](payload &Payload[T]) ![]&vtl.Tensor[T] {
134134
gradient := payload.variable.grad
135135
r0 := gradient.divide[T](g.b.value)!
136136
bx2 := g.b.value.multiply_scalar[T](vtl.cast[T](2))!
137-
oposite := gradient.multiply_scalar[T](vtl.cast[T](-1))!
138-
mut r1 := oposite.multiply[T](g.a.value)!
137+
opposite := gradient.multiply_scalar[T](vtl.cast[T](-1))!
138+
mut r1 := opposite.multiply[T](g.a.value)!
139139
r1 = r1.divide[T](bx2)!
140140
return [r0, r1]
141141
}

autograd/variable.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import vtl
55
// Variable is an abstraction of a vtl.Tensor that tracks
66
// the operations done to the vtl.Tensor. It also keeps
77
// track of the gradient of the operation if a Variable
8-
// needs to backpropogate.
8+
// needs to backpropagate.
99
// This is the fundamental object used in automatic
1010
// differentiation, as well as the neural network aspects
1111
// of VTL
@@ -64,7 +64,7 @@ pub fn (v &Variable[T]) str() string {
6464
return v.value.str()
6565
}
6666

67-
// backprop Back propogates an operation along a computational graph.
67+
// backprop Back propagates an operation along a computational graph.
6868
// This operation will destroy the operational graph, populating
6969
// the gradients for all variables that are predecessors of
7070
// the Variable this is called on.

datasets/loader.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct DatasetDownload {
4848
fn download_dataset(data DatasetDownload) !string {
4949
dataset_dir := os.real_path(get_cache_dir('datasets', data.dataset))
5050

51-
// Handline extensions like `*.tar.gz`.
51+
// Handle extensions like `*.tar.gz`.
5252
exts := os.file_name(data.file).rsplit_nth('.', 3)
5353
is_tar := exts[0] == 'tar' || (exts.len > 1 && exts[1] == 'tar')
5454

examples/vtl_opencl_vcl_support/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example shows how to use the OpenCL backend with VCL support.
44

55
## Prerequisites
66

7-
Read the [docs](https://vlang.github.io/vsl/vcl.html) of the V Computating Language (VCL) and the OpenCL backend.
7+
Read the [docs](https://vlang.github.io/vsl/vcl.html) of the V Computing Language (VCL) and the OpenCL backend.
88

99
## Running the example
1010

src/fun.v

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,13 @@ pub fn (t &Tensor[T]) transpose[T](order []int) !&Tensor[T] {
167167
return ret
168168
}
169169

170-
// t returns a ful transpose of an tensor, with the axes
171-
// reversed
170+
// t returns a full transpose of a tensor, with the axes reversed
172171
pub fn (t &Tensor[T]) t[T]() !&Tensor[T] {
173172
order := irange(0, t.rank())
174173
return t.transpose(order.reverse())
175174
}
176175

177-
// swapaxes returns a view of an tensor with two axes
178-
// swapped.
176+
// swapaxes returns a view of an tensor with two axes swapped
179177
pub fn (t &Tensor[T]) swapaxes[T](a1 int, a2 int) !&Tensor[T] {
180178
mut order := irange(0, t.rank())
181179
tmp := order[a1]

stats/stats.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn prod_axis_with_dims[T](t &vtl.Tensor[T], data AxisData) T {
7979
return acc
8080
}
8181

82-
// Measure of Occurance
82+
// Measure of Occurrence
8383
// Frequency of a given number
8484
// Based on
8585
// https://www.mathsisfun.com/data/frequency-distribution.html
@@ -99,7 +99,7 @@ pub fn freq[T](t &vtl.Tensor[T], val T) int {
9999
return count
100100
}
101101

102-
// Measure of Central Tendancy
102+
// Measure of Central Tendency
103103
// Mean of the given input array
104104
// Based on
105105
// https://www.mathsisfun.com/data/central-measures.html
@@ -113,7 +113,7 @@ pub fn mean[T](t &vtl.Tensor[T]) T {
113113
}) / vtl.cast[T](t.size)
114114
}
115115

116-
// Measure of Central Tendancy
116+
// Measure of Central Tendency
117117
// Geometric Mean of the given input array
118118
// Based on
119119
// https://www.mathsisfun.com/numbers/geometric-mean.html
@@ -128,7 +128,7 @@ pub fn geometric_mean[T](t &vtl.Tensor[T]) T {
128128
return math.pow(prod, vtl.cast[T](1) / vtl.cast[T](t.size))
129129
}
130130

131-
// Measure of Central Tendancy
131+
// Measure of Central Tendency
132132
// Harmonic Mean of the given input array
133133
// Based on
134134
// https://www.mathsisfun.com/numbers/harmonic-mean.html
@@ -142,7 +142,7 @@ pub fn harmonic_mean[T](t &vtl.Tensor[T]) T {
142142
})
143143
}
144144

145-
// Measure of Central Tendancy
145+
// Measure of Central Tendency
146146
// Median of the given input array ( input array is assumed to be sorted )
147147
// Based on
148148
// https://www.mathsisfun.com/data/central-measures.html
@@ -158,7 +158,7 @@ pub fn median[T](t &vtl.Tensor[T]) T {
158158
}
159159
}
160160

161-
// Measure of Central Tendancy
161+
// Measure of Central Tendency
162162
// Mode of the given input array
163163
// Based on
164164
// https://www.mathsisfun.com/data/central-measures.html

storage/cpu.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ pub fn from_array[T](arr []T) &CpuStorage[T] {
2525
}
2626
}
2727

28-
// Private function. Used to implement Storage operator
28+
// Private function. Used to implement the Storage operator
2929
@[inline]
3030
pub fn (s &CpuStorage[T]) get[T](i int) T {
3131
return s.data[i]
3232
}
3333

34-
// Private function. Used to implement assigment to the Storage element
34+
// Private function. Used to implement assignments to the Storage element
3535
@[inline]
3636
pub fn (mut s CpuStorage[T]) set[T](i int, val T) {
3737
s.data[i] = val

0 commit comments

Comments
 (0)