Skip to content

Commit

Permalink
Fix typos and add codespell GitHub action (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
kianmeng authored Sep 3, 2023
1 parent ed52a53 commit 16d7cc2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ env:
XLA_CACHE_DIR: ${{ github.workspace }}/cache/xla
LIBTORCH_DIR: ${{ github.workspace }}/cache/torch
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: codespell-project/actions-codespell@v2
with:
skip: deps
ignore_words_list: whn,ehr
main:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion guides/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Axon is a library for creating and training neural networks in Elixir. The Axon

* [Your first training loop](training_and_evaluation/your_first_training_loop.livemd)
* [Instrumenting loops with metrics](training_and_evaluation/instrumenting_loops_with_metrics.livemd)
* [Your first evalutaion loop](training_and_evaluation/your_first_evaluation_loop.livemd)
* [Your first evaluation loop](training_and_evaluation/your_first_evaluation_loop.livemd)
* [Using loop event handlers](training_and_evaluation/using_loop_event_handlers.livemd)
* [Custom models, loss functions, and optimizers](training_and_evaluation/custom_models_loss_optimizers.livemd)
* [Writing custom metrics](training_and_evaluation/writing_custom_metrics.livemd)
Expand Down
2 changes: 1 addition & 1 deletion lib/axon/loop.ex
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ defmodule Axon.Loop do
only: N # Trigger on `N` event
**Warning: If you modify the step state in an event handler, it will trigger
potentially excessive recompilation and result in significant additinal overhead
potentially excessive recompilation and result in significant additional overhead
during loop execution.**
"""
def handle_event(%Loop{handlers: handle_fns} = loop, event, handler, filter \\ :always) do
Expand Down
4 changes: 2 additions & 2 deletions lib/axon/losses.ex
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ defmodule Axon.Losses do
$$l_i = -\sum_i^C \hat{y_i} \cdot \log(y_i)$$
Categorical cross-entropy is typically used for multi-class classifcation problems.
Categorical cross-entropy is typically used for multi-class classification problems.
By default, it expects `y_pred` to encode a probability distribution along the last
axis. You can specify `from_logits: true` to indicate `y_pred` is a logits tensor.
Expand Down Expand Up @@ -962,7 +962,7 @@ defmodule Axon.Losses do
@doc """
Huber loss.
## Argumet Shapes
## Argument Shapes
* `y_true` - $(d_0, d_1, ..., d_n)$
* `y_pred` - $(d_0, d_1, ..., d_n)$
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ defmodule Axon.MixProject do
groups_for_extras: [
"Guides: Model Creation": Path.wildcard("guides/model_creation/*.livemd"),
"Guides: Model Execution": Path.wildcard("guides/model_execution/*.livemd"),
"Guides: Training and Evalutaion":
"Guides: Training and Evaluation":
Path.wildcard("guides/training_and_evaluation/*.livemd"),
"Guides: Serialization": Path.wildcard("guides/serialization/*.livemd"),
"Examples: Basics": Path.wildcard("notebooks/basics/*.livemd"),
Expand Down Expand Up @@ -156,7 +156,7 @@ defmodule Axon.MixProject do
Axon.MixedPrecision,
Axon.None,
Axon.StatefulOutput,
Axon.Initalizers
Axon.Initializers
],
Summary: [
Axon.Display
Expand Down
2 changes: 1 addition & 1 deletion test/axon/compiler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4901,7 +4901,7 @@ defmodule CompilerTest do
assert Nx.type(b) == {:f, 32}
end

test "initializes correclty with single namespace no params" do
test "initializes correctly with single namespace no params" do
model = Axon.input("input_0", shape: {nil, 1}) |> Axon.namespace("model")

{init_fn, _} = Axon.build(model)
Expand Down
2 changes: 1 addition & 1 deletion test/axon/loop_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ defmodule Axon.LoopTest do
end) =~ "Batch"
end

test "eval_step/1 evalutes model on a single batch" do
test "eval_step/1 evaluates model on a single batch" do
inp = Nx.tensor([0, 1, 0, 1, 0, 1]) |> Nx.new_axis(-1)
tar = Nx.tensor([1, 0, 1, 0, 1, 0]) |> Nx.new_axis(-1)

Expand Down

0 comments on commit 16d7cc2

Please sign in to comment.