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}"}
Popular Pragprog topics

Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this b...
New

Hi @Margaret ,
On page VII the book tells us the example and snippets will be all using Elixir version 1.11
But on page 3 almost the en...
New

Hi,
build fails on:
bracket-lib = “~0.8.1”
when running on Mac Mini M1 Rust version 1.5.0:
Compiling winit v0.22.2
error[E0308]: mi...
New

In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions:
In Gemfile, change
gem 'rails...
New

I ran this command after installing the sample application:
$ cards add do something --owner Brian
And got a file not found error:
Fil...
New

I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint.
As entered, the SwitchCompat changes color to hol...
New

The allprojects block listed on page 245 produces the following error when syncing gradle:
“org.gradle.api.GradleScriptException: A prob...
New

Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New

Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

@mfazio23
Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New
Other popular topics

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

Why, if your answer is yes?
New

I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New

“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin
Even when you’re ultimately right about what the future ho...
New

Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalabilit...
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

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

Author Spotlight: Rebecca Skinner (@RebeccaSkinner)
Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, a...
New

Author Spotlight: Peter Ullrich (@PJUllrich)
Data is at the core of every business, but it is useless if nobody can access and analyz...
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
Latest in Pragprog
Latest (all)
Categories:
My Saved Portals
-
None saved yet
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /preact
- /flutter
- /c-plus-plus
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /vuejs
- /nim
- /emacs
- /nerves
- /elm