Skip to content

Commit

Permalink
Improve fit_mesh tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmal-suthar committed Oct 7, 2020
1 parent 71a42d7 commit a81c652
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/src/tutorials/fit_mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ end
```julia
lr = 1.0
opt = Flux.Optimise.Momentum(lr, 0.9)
_offset = zeros(Float32, size(get_verts_packed(src))...)
```

## Using GPU for fast training [**Optional**]
Expand All @@ -108,7 +109,7 @@ function which is exactly the same syntax as Flux.
```julia
tgt = tgt |> gpu
src = src |> gpu
_offset = zeros(Float32, size(get_verts_packed(src))...) |> gpu
_offset = _offset |> gpu
```

## Optimizing the offset array
Expand Down Expand Up @@ -179,4 +180,3 @@ metrics.
---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

3 changes: 2 additions & 1 deletion examples/fit_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ end

lr = 1.0
opt = Flux.Optimise.Momentum(lr, 0.9)
_offset = zeros(Float32, size(get_verts_packed(src))...)

# ## Using GPU for fast training [**Optional**]
# We can convert the TriMesh structure to GPU or CPU using`gpu` and `cpu`
# function which is exactly the same syntax as Flux.

tgt = tgt |> gpu
src = src |> gpu
_offset = zeros(Float32, size(get_verts_packed(src))...) |> gpu
_offset = _offset |> gpu

# ## Optimizing the offset array
# We first initialize offset array as zeros, hence deformed mesh is equivalent to
Expand Down

2 comments on commit a81c652

@nirmal-suthar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: "Tag with name v0.1.2 already exists and points to a different commit"

Please sign in to comment.