Skip to content

Commit

Permalink
add char-rnn example
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Feb 28, 2017
1 parent 2de6b06 commit aa17017
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/src/examples/char-rnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,30 @@ sample(model[1:end-1], 100)
```

`sample` then produces a string of Shakespeare-like text. This won't produce great results after only a single epoch (though they will be recognisably different from the untrained model). Going for 30 epochs or so produces good results.

Trained on [a dataset from base Julia](https://gist.githubusercontent.com/MikeInnes/c2d11b57a58d7f2466b8013b88df1f1c/raw/4423f7cb07c71c80bd6458bb94f7bf5338403284/julia.jl), the network can produce code like:

```julia
function show(io::IO, md::Githompty)
Buffer(jowerTriangular(inals[i], initabs_indices), characters, side, nextfloat(typeof(x)))
isnull(r) && return
start::I!
for j = 1:length(b,1)
a = s->cosvect(code)
return
end
indsERenv | maximum(func,lsg))
for i = 1:last(Abjelar) && fname (=== nothing)
throw(ArgumentError("read is declave non-fast-a/remaining of not descride method names"))
end
if e.ht === Int
# update file to a stroducative, but is decould.
# xna i -GB =# [unsafe_color <c *has may num 20<11E 16/s
tuple | Expr(:(UnitLowerTriangular(transpose,(repl.ptr)))
dims = pipe_read(s,Int(a)...)
ex,0 + y.uilid_func & find_finwprevend(msg,:2)
ex = stage(c)
# uvvalue begin
end
end
```

0 comments on commit aa17017

Please sign in to comment.