sabiwara
Machine Learning in Elixir: Chapter 13 code errors
Hello @seanmor5! Thanks a lot for the amazing book and new chapter ![]()
I got a couple of errors when trying to run the examples in Chap. 13 and they don’t seem to have been reported yet:
- p.313 The
:sequence_lengthand:batch_sizekeys oftext_embeddinghad to be popped and nested in a:compilekey:
opts = Keyword.validate!(opts, [
:defn_options, sequence_length: 64, batch_size: 16 ])
{model_info, tokenizer} = load()
Bumblebee.Text.TextEmbedding.text_embedding(model_info, tokenizer, opts)
- p.316
predict/1returns an%{embedding: Nx.Tensor.t()}, should return aNx.Tensor.t()to work when adding it to the changeset later:
def predict(text) do
- Nx.Serving.batched_run(BookSearchModel, text)
+ Nx.Serving.batched_run(BookSearchModel, text).embedding
end
- p.320 needs to assign
:query
def mount(_params, _session, socket) do
- {:ok, assign(socket, :results, [])}
+ {:ok, assign(socket, results: [], query: nil)}
end
- p.321 Typo in HTML template
<a
- href{~p"/book/#{result.id}"}
+ href={~p"/book/#{result.id}"}
Most Liked
sabiwara
@pieteeken I changed it as follows, fixed it for me:
opts = Keyword.validate!(opts, [:defn_options, sequence_length: 64, batch_size: 16])
{defn_opts, compile_opts} = Keyword.pop!(opts, :defn_options)
opts = [defn_options: defn_opts, compile: compile_opts]
1
pieteeken
OK. It’s working.
And I also got the results. But that was because of one forgotten change from the book.
1
Popular Pragmatic Bookshelf topics
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
Working through the steps (checking that the Info,plist matches exactly), run the demo game and what appears is grey but does not fill th...
New
When I try the command to create a pair of migration files I get an error.
user=> (create-migration "guestbook")
Execution error (Ill...
New
This is as much a suggestion as a question, as a note for others.
Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
When running tox for the first time, I got the following error:
ERROR: InterpreterNotFound: python3.10
I realised that I was running ...
New
On page 78 the following code appears:
<%= link_to ‘Destroy’, product,
class: ‘hover:underline’,
method: :delete,
data: { confirm...
New
AWDWR 7, page 152, page 153:
Hello everyone,
I’m a little bit lost on the hotwire part. I didn’t fully understand it.
On page 152 @rub...
New
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
@parrt
In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1:
programming_ML/code/03_...
New
Other popular topics
New
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
Do the test and post your score :nerd_face:
:keyboard:
If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first:
asdf plugin-upd...
New
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Create efficient, elegant software tests in pytest, Python's most powerful testing framework.
Brian Okken @brianokken
Edited by Kat...
New
API 4
Path:
/user/following/
Method:
GET
Description:
Returns the list of all names of people whom the user follows
Response
[
{ ...
New
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
Author Spotlight
Mike Riley
@mriley
This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
If you’re getting errors like this:
psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /rails
- /python
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /deepseek
- /zig
- /scala
- /textmate
- /sublime-text
- /lisp
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /revery
- /ubuntu
- /spring
- /manjaro
- /deno
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c






