
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_length
and:batch_size
keys oftext_embedding
had to be popped and nested in a:compile
key:
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/1
returns 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 Prag Prog topics

This test is broken right out of the box…
— FAIL: TestAgent (7.82s)
agent_test.go:77:
Error Trace: agent_test.go:77
agent_test.go:...
New

As per the title, thanks.
New

Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks”
While running the smoke tests in Chapter 2, I get these...
New

The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New

Hi everyone!
There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New

Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display)
It looks like
.with_simple_console_no_bg(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New

I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here.
...
New

I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New

Title: Agile Web Development with Rails 7: (page 70)
I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
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

I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New

Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it.
Does your monitor have eye p...
New

Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face:
Perhaps if there’s enough peop...
New

Think Again 50% Off Sale »
The theme of this sale is new perspectives on familiar topics.
Enter coupon code ThinkAgain2021 at checkout t...
New

Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
New

Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New

Saw this on TikTok of all places! :lol:
Anyone heard of them before?
Lite:
New

The File System Access API with Origin Private File System.
WebKit supports new API that makes it possible for web apps to create, open,...
New

The overengineered Solution to my Pigeon Problem.
TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New

Author Spotlight:
Karl Stolley
@karlstolley
Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /django
- /spring
- /diversity
- /nodejs
- /lua
- /julia
- /slackware
- /c
- /neovim