Skip to content

Commit

Permalink
fix: minor formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 18, 2024
1 parent 8016e80 commit 2a988c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 8 additions & 5 deletions examples/Basics/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ W = randn(5, 10)
x = rand(10)
W * x

# Julia's arrays are very powerful, and you can learn more about what they can do [here](https://docs.julialang.org/en/v1/manual/arrays/).
# Julia's arrays are very powerful, and you can learn more about what they can do
# [here](https://docs.julialang.org/en/v1/manual/arrays/).

# ### CUDA Arrays

Expand Down Expand Up @@ -206,18 +207,20 @@ println("Computed Gradient via Forward Mode AD (ForwardDiff): ", ForwardDiff.gra
# ### Jacobian-Vector Product

# I will defer the discussion on forward-mode AD to
# [https://book.sciml.ai/notes/08-Forward-Mode_Automatic_Differentiation_(AD)_via_High_Dimensional_Algebras/](https://book.sciml.ai/notes/08-Forward-Mode_Automatic_Differentiation_(AD)_via_High_Dimensional_Algebras/). Here let us just look
# at a mini example on how to use it.
# [https://book.sciml.ai/notes/08-Forward-Mode_Automatic_Differentiation_(AD)_via_High_Dimensional_Algebras/](https://book.sciml.ai/notes/08-Forward-Mode_Automatic_Differentiation_(AD)_via_High_Dimensional_Algebras/).
# Here let us just look at a mini example on how to use it.

f(x) = x .* x ./ 2
x = randn(rng, Float32, 5)
v = ones(Float32, 5)

# Construct the pushforward function. We will write out the function here but in
# practice we recommend using [SparseDiffTools.auto_jacvec](https://docs.sciml.ai/SparseDiffTools/stable/#Jacobian-Vector-and-Hessian-Vector-Products)!
# practice we recommend using
# [SparseDiffTools.auto_jacvec](https://docs.sciml.ai/SparseDiffTools/stable/#Jacobian-Vector-and-Hessian-Vector-Products)!

# First we need to create a Tag for ForwardDiff. It is enough to know that this is something
# that you must do. For more details, see the [ForwardDiff Documentation](https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Custom-tags-and-tag-checking)!
# that you must do. For more details, see the
# [ForwardDiff Documentation](https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Custom-tags-and-tag-checking)!
struct TestTag end

# Going in the details of what is function is doing is beyond the scope of this tutorial.
Expand Down
4 changes: 3 additions & 1 deletion examples/BayesianNN/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Turing.setprogress!(true);

# ## Generating data

# Our goal here is to use a Bayesian neural network to classify points in an artificial dataset. The code below generates data points arranged in a box-like pattern and displays a graph of the dataset we'll be working with.
# Our goal here is to use a Bayesian neural network to classify points in an artificial
# dataset. The code below generates data points arranged in a box-like pattern and displays
# a graph of the dataset we'll be working with.

## Number of points to generate
N = 80
Expand Down

0 comments on commit 2a988c3

Please sign in to comment.