# Machine Learning in Elixir: Chapter 10/11 Code fixes that worked for me (Page 226-260)

**URL:** <https://forum.devtalk.com/t/machine-learning-in-elixir-chapter-10-11-code-fixes-that-worked-for-me-page-226-260/137573>\
**Category:** PragProg Customers\
**Tags:** book-machine-learning-in-elixir, errata\
**Created:** [28 December 2023 18:11 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-chapter-10-11-code-fixes-that-worked-for-me-page-226-260/137573 "2023-12-28T18:11:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simple](https://forum.devtalk.com/user_avatar/forum.devtalk.com/simple/32/5636_2.png) [@simple](https://forum.devtalk.com/u/simple)\
**Post date:** [28 December 2023 18:11 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-chapter-10-11-code-fixes-that-worked-for-me-page-226-260/137573/1 "2023-12-28T18:11:41Z")

</div>

**Page 226**  
Mix install uses older versins of exla, should 0.6 to work with cuda120

**Page 230**  
targets pipeline in Data module misses |\> Nx.tensor()

**Page 231**  
chunk\_every misses :discard?

**Page 232**  
uses non existing variable prices  
Also windows\_size in code is 30, text says 5

**Page 234**  
Model seems off, I get an error about empty tensor resulting from conv.  
This worked for me but doesn’t match the image of the model

```auto
cnn_model =
Axon.input("stock_price")
|> Axon.nx(&Nx.new_axis(&1, -1))
|> Axon.conv(32, kernel_size: {window_size, 1}, activation: :relu)
|> Axon.dense(32, activation: :relu)
|> Axon.dense(1)
template = Nx.template({32, 10, 1}, :f32)
Axon.Display.as_graph(cnn_model, template)

```

**Page 236**  
Eval form is cut of in pdf

**Chapter 11**  
**Page 257**

With current bumblebee version should be

```auto
{:ok, generation_config} = Bumblebee.load_generation_config({:hf, "microsoft/DialoGPT-medium"})

serving =
  Bumblebee.Text.conversation(model, tokenizer,
   generation_config,
   compile: [batch_size: 1, sequence_length: 1000],
   defn_options: [compiler: EXLA]
  )

```

**Page 260**  
should be image instead of image.data

---

<div class="post-metadata">

**Author:** ![seanmor5](https://forum.devtalk.com/user_avatar/forum.devtalk.com/seanmor5/32/1169_2.png) [@seanmor5](https://forum.devtalk.com/u/seanmor5)\
**Post date:** [21 February 2024 19:05 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-chapter-10-11-code-fixes-that-worked-for-me-page-226-260/137573/2 "2024-02-21T19:05:56Z")

</div>

Thanks for pointing these out! I’ve addressed them
