Skip to content

Commit 15c00f8

Browse files
Fix typos in the documentation strings of the tfjs-layers directory (#8411)
1 parent 636c616 commit 15c00f8

File tree

11 files changed

+18
-18
lines changed

11 files changed

+18
-18
lines changed

tfjs-layers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const ys = tf.tensor2d([[1], [3], [5], [7]], [4, 1]);
5252
// Train the model.
5353
await model.fit(xs, ys, {epochs: 500});
5454

55-
// Ater the training, perform inference.
55+
// After the training, perform inference.
5656
const output = model.predict(tf.tensor2d([[5]], [1, 1]));
5757
output.print();
5858
```

tfjs-layers/demos/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Once the development environment is prepared, execute the build script from the
1616
```
1717

1818
The script will construct a number of Keras models in Python and benchmark their training using the TensorFlow backend. When it is complete, it will bring up a
19-
local HTTP server. Navigate to the local URL spcecified in stdout to bring up
19+
local HTTP server. Navigate to the local URL specified in stdout to bring up
2020
the benchmarks page UI. There will be a button to begin the JS side of the
2121
benchmarks. Clicking the button will run through and time the same models, now
2222
running in the browser.

tfjs-layers/src/layers/nlp/modeling/transformer_decoder_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('TransformerDecoder', () => {
106106
const config = testLayer.getConfig();
107107
const restored = TransformerDecoder.fromConfig(TransformerDecoder, config);
108108

109-
// Initializers don't get serailized with customObjects.
109+
// Initializers don't get serialized with customObjects.
110110
delete ((config['kernelInitializer'] as serialization.ConfigDict
111111
)['config'] as serialization.ConfigDict)['customObjects'];
112112
delete ((config['biasInitializer'] as serialization.ConfigDict
@@ -167,5 +167,5 @@ describe('TransformerDecoder', () => {
167167
expectTensorsClose(outputCache, noLoopCache);
168168
});
169169

170-
// TODO(pforderique): Test mask propogation once supported.
170+
// TODO(pforderique): Test mask propagation once supported.
171171
});

tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export declare interface GPT2CausalLMArgs extends PipelineModelArgs {
7070
}
7171

7272
/**
73-
* An end-to-end GPT2 model for causal langauge modeling.
73+
* An end-to-end GPT2 model for causal language modeling.
7474
*
7575
* A causal language model (LM) predicts the next token based on previous
7676
* tokens. This task setup can be used to train the model unsupervised on

tfjs-layers/src/layers/nlp/multihead_attention.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ export class MultiHeadAttention extends Layer {
703703

704704
newInputs = [inputs, kwargs['value']].concat(kwargs['key'] ?? []);
705705

706-
// TODO(pforderique): Support mask propogation.
706+
// TODO(pforderique): Support mask propagation.
707707
return super.apply(newInputs, kwargs);
708708
}
709709

tfjs-layers/src/layers/normalization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ export interface LayerNormalizationLayerArgs extends LayerArgs {
430430
axis?: number|number[];
431431

432432
/**
433-
* A small positive float added to variance to avoid divison by zero.
433+
* A small positive float added to variance to avoid division by zero.
434434
* Defaults to 1e-3.
435435
*/
436436
epsilon?: number;

tfjs-layers/src/layers/normalization_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ describeMathCPUAndWebGL2('BatchNormalization Layers: Tensor', () => {
353353
const x = tensor2d([[1, 2], [3, 4]], [2, 2]);
354354
expectTensorsClose(layer.apply(x) as Tensor, x, 0.01);
355355
expect(layer.getWeights().length).toEqual(3);
356-
// Firt weight is gamma.
356+
// First weight is gamma.
357357
expectTensorsClose(layer.getWeights()[0], onesLike(layer.getWeights()[0]));
358358
// Second weight is moving mean.
359359
expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1]));
@@ -366,7 +366,7 @@ describeMathCPUAndWebGL2('BatchNormalization Layers: Tensor', () => {
366366
const x = tensor2d([[1, 2], [3, 4]], [2, 2]);
367367
expectTensorsClose(layer.apply(x) as Tensor, x, 0.01);
368368
expect(layer.getWeights().length).toEqual(3);
369-
// Firt weight is beta.
369+
// First weight is beta.
370370
expectTensorsClose(layer.getWeights()[0], zerosLike(layer.getWeights()[0]));
371371
// Second weight is moving mean.
372372
expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1]));

tfjs-layers/src/layers/preprocessing/image_resizing_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describeMathCPUAndGPU('Resizing Layer', () => {
8888
});
8989

9090
it('Returns a tensor of the correct dtype', () => {
91-
// do a same resizing operation, cheeck tensors dtypes and content
91+
// do a same resizing operation, check tensors dtypes and content
9292
const height = 40;
9393
const width = 60;
9494
const numChannels = 3;

tfjs-layers/src/layers/preprocessing/random_height.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type InterpolationType = typeof INTERPOLATION_KEYS[number];
3535
*
3636
* The input should be a 3D (unbatched) or
3737
* 4D (batched) tensor in the `"channels_last"` image data format. Input pixel
38-
* values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of interger
38+
* values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of integer
3939
* or floating point dtype. By default, the layer will output floats.
4040
*
4141
* tf methods implemented in tfjs: 'bilinear', 'nearest',
@@ -48,7 +48,7 @@ export class RandomHeight extends BaseRandomLayer {
4848
/** @nocollapse */
4949
static override className = 'RandomHeight';
5050
private readonly factor: number | [number, number];
51-
private readonly interpolation?: InterpolationType; // defualt = 'bilinear
51+
private readonly interpolation?: InterpolationType; // default = 'bilinear
5252
private heightLower: number;
5353
private heightUpper: number;
5454
private imgWidth: number;

tfjs-layers/src/layers/preprocessing/random_width.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type InterpolationType = typeof INTERPOLATION_KEYS[number];
3535
*
3636
* The input should be a 3D (unbatched) or
3737
* 4D (batched) tensor in the `"channels_last"` image data format. Input pixel
38-
* values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of interger
38+
* values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of integer
3939
* or floating point dtype. By default, the layer will output floats.
4040
*
4141
* tf methods implemented in tfjs: 'bilinear', 'nearest',
@@ -48,7 +48,7 @@ export class RandomWidth extends BaseRandomLayer {
4848
/** @nocollapse */
4949
static override className = 'RandomWidth';
5050
private readonly factor: number | [number, number];
51-
private readonly interpolation?: InterpolationType; // defualt = 'bilinear
51+
private readonly interpolation?: InterpolationType; // default = 'bilinear
5252
private widthLower: number;
5353
private widthUpper: number;
5454
private imgHeight: number;

0 commit comments

Comments
 (0)