jermwatt / machine_learning_refined Goto Github PK
View Code? Open in Web Editor NEWNotes, examples, and Python demos for the 2nd edition of the textbook "Machine Learning Refined" (published by Cambridge University Press).
License: Other
Notes, examples, and Python demos for the 2nd edition of the textbook "Machine Learning Refined" (published by Cambridge University Press).
License: Other
Automatic Differentiation Section (chapter 2) is not available on the below website anymore. In what order should the website be read now. https://jermwatt.github.io/mlrefined/index.html
When opening the jupyter file ,it does not render in the github viewer correctly. It's very difficult to read.
The tags show instead:
For ex: <img src= '../../mlrefined_images/math_optimization_images/minibatch_functions.png' width="80%" height="auto"/>
https://jermwatt.github.io/mlrefined/blog_posts/3_First_order_methods/3_10_Minibatch.html
Not sure whether the text just needs to be explicitly referred to as an image. Seems a quick fix
Two major issues with the electronic version of the book on Amazon.
The electronic version is a PDF file, not MOBI. In other words, it has not been adapted to Amazon Kindle.
In particular, links in the text don't work, from Kindle. And the contents menu is static, not hypertext.
Some of the materials on the HTML pages / notebooks just don't exist in the Amazon PDF version. The opposite of what I expected! (because each of your HTML pages / notebooks contains this insert: "The following is part of an early draft of the second edition of Machine Learning Refined. The published text (with revised material) is now available on Amazon"). For example, sections 6.2 and 6.3 in the HTML pages contain appendixes with proofs. These appendixes do not exist in the Amazon PDF version.
Can these problems be fixed? TIA
Hi,
I hope this is the right place to post a question about the HTML materials! I was reviewing this and am having some trouble understanding why a decision tree or regression tree would be a universal function approximator. Would you be able to provide some clarification for why a regression tree would be a universal function approximator? If there is a pointer to a chapter within Machine Learning Refined that goes deeply into this, I would greatly appreciate a reference!
Thanks,
There is an error in the number of runs to reach the minimum using the coordinate descent algorithm
for this equation:
g(w1, w2) = 2w1² + 2w² + 2w1w2
The minimum is not reached in just two iterations.
The problem is that you call the algorithm with integer values for the initial estimate of the w vector.
But if you use float values instead:
w = np.array([3.0,4.0])
max_its = 5
weight_history,cost_history = coordinate_descent_for_quadratic(g,w,max_its,a,b,C)
You get the correct values:
[array([3., 4.]), array([-2., 4.]), array([-2., 1.]), array([-0.5, 1. ]), array([-0.5 , 0.25]), array([-0.125, 0.25 ]), array([-0.125 , 0.0625]), array([-0.03125, 0.0625 ]), array([-0.03125 , 0.015625]), array([-0.0078125, 0.015625 ]), array([-0.0078125 , 0.00390625])]```
Looks like it jumps from Figure 5 right to Figure 7
Hello sir,
i was trying to solve Exercice 3.4: Reproduce Galileo's Example, which meant reproducing the graph of Example 3.3, and got w=0.0196, which should be the earth gravity: g=9.81 m/s^2. Since i was able reproduce the requested graphs, i suppose that w is correct, but was wondering why it doesn't match g. What are the units of the input values?
Thank you.
I have enjoyed working through the 2nd edition of the book, and I commend you for creating a machine learning book with such a good balance of intuition and rigor. I wondered if it would be viable down the road to include supplementary videos of the sections of the book? Something alongside the excellent videos by Caltech, which I will link below. Thanks again for the hard work!
I followed the instructions from readme.md and tried to install required packages as follows:
git clone https://github.com/jermwatt/mlrefined
cd mlrefined
pip install -r requirements.txt
and Error showed saying that
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
And I couldn't find requirements.txt using search as well.
Hey Professors,
The Chapter 3 Section 0 link on the index.html
file leads to a page titled "6.0 Introduction". However, the contents of that page make sense for the introduction of Chapter 3. I think it could be that the title is incorrect whereas the contents are correct
Dear authors,
Thanks for a very nice book, which we are adopting for a new class starting in Feb'21. It seems the Solutions at the Instructor Resources on the Cambridge Higher Education site are missing. There is a directory with zip files, but they contain the jpg images of the book (duplicate of the Figures directory).
Some suspected errors/typos to report:
p.131. In example 6.3, "Here a of run normalized gradient descent ..." should be "Here a run of normalized gradient descent ...".
p.136. Equation 6.18 is not consistent with how tanh is usually defined. The consistent one should be "tanh(x) = 2 sigma(2x) - 1".
p.145. The inequality "exp(-yxCw) = exp(-C)exp(-yxw) < exp(-yxw)" is incorrect. It should be "exp(-yxCw) = (exp(-yxw))^C < exp(-yxw)"
p.158. The encoding in equation 6.62 does not make equation 6.66 and equation 6.67 equivalent to each other. Instead, the encoding should be done reversely: encode the label 1 into the vector [1 0]. (If consistency with section 7.5.4 is intended, then some other contents, instead of the encoding, need modification.)
p.168. "Section 6.24" is mentioned, but there is no such section.
I'm not confident that these are all errors/typos indeed. Hope they help.
Besides, this is a great machine learning book for beginners. I do understand what's going on in the text. Deep appreciation for the effort.
Hello there! This is a really great book! However I am not able to find the solution to the mathematical exercises... Where are they?
Thanks!
I couldn't find any reference in the errata, hence may be it is not an error - but how does someone sample
The link to code at
https://jermwatt.github.io/mlrefined/blog_posts/Linear_Supervised_Learning/Part_5_One_versus_all.html
is note working.
Unable to open following link
https://github.com/jermwatt/mlrefined/blob/gh-pages/blog_posts/Linear_Supervised_Learning/Part_5_One_versus_all.ipynb
the conda build method did not work using the requirements.txt file
conda create python=3.8 --name mlr2 --file requirements.txt
The latest version of matplotlib is 3.5.2.
v3.1.0 is obsolete has a dependency on some outdated package.
Is there some reason that matplotlib is pinned to 3.1.0 and all the other package dependencies are allowed to float to the latest versions?
Below is my conda output. Initially I tried it using the command on the githut package, but conda failed with a lot of incompatiblity conflicts.
Then I tried conda install for all packages EXCEPT the pinned matplotlib=3.1.0 and everything worked. Next, I tried to install matplotlib=3.1.0 and got the output below.
(mlr2) C:\Users\richadmin\Desktop\00_PythonWIP_2022\02-Borhani-ML-Refined-2021>conda install matplotlib==3.1.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- matplotlib==3.1.0 -> python[version='>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.
I just installed into the conda environment with everything the latest version (Python 3.8 and all other packages in the requirements.txt file) and then matplotlib (floating to the LATEST VERSION) and it worked. I will try running the code examples and see if there are any bugs or errors due to the later version of matplotlib.
I will report back after I have gone through many of the notebooks.
In the MATLAB wrapper for Exercise 6.5, the parameters b
, w
, c
, and V
used in the tanh_softmax
function are not initialized. The code will not successfully run then even if grad_b
, grad_w
, grad_c
, and grad_V
are written correctly.
I run this code at the terminal: pip install autograd
but when I run the the below cell:
import sys
sys.path.append('../../')
import matplotlib.pyplot as plt
from mlrefined_libraries import basics_library as baslib
from mlrefined_libraries import linear_algebra_library as linlib
ModuleNotFoundError Traceback (most recent call last)
in ()
4 sys.path.append('../../')
5 import matplotlib.pyplot as plt
----> 6 from mlrefined_libraries import basics_library as baslib
7 from mlrefined_libraries import linear_algebra_library as linlib
/Volumes/DATA/projects/private/ml/mlrefined/mlrefined_libraries/init.py in ()
7 prefix=name+'.',
8 onerror=(lambda x: None)):
----> 9 import(modname)
10
/Volumes/DATA/projects/private/ml/mlrefined/mlrefined_libraries/convnets_library/convnet_lib/optimizers.py in ()
2 from autograd import value_and_grad
3 from autograd import hessian
----> 4 from autograd.misc.flatten import flatten_func
5 from IPython.display import clear_output
6 from timeit import default_timer as timer
ModuleNotFoundError: No module named 'autograd.misc'
I am using Anaconda with Python 3.6, I have no idea how to fix this issue. Can you check?
Hello
After today's update, the folder "https://github.com/jermwatt/machine_learning_refined/tree/gh-pages/sample_chapters" files are not downloaded correctly by downloading the repository in the form of zip.
Your work build a bridge between machine learning and math, and provide a good intuition for machine learning. So when will your second book come out?
Seeing a broken image here: https://jermwatt.github.io/mlrefined/blog_posts/Vital_Elements_of_Calculus/All_about_derivatives_part_2.html
Hello!
I have just started to read the book and wanted to try out some exercises. But there is only information about execrises starting from chapter 5 in here. So, I just wanted to ask, if they were supposed to be there originally, or not.
Nice book and repo. I was running through some of the examples in the 2_5_Random.ipynb
. Some of the plots render OK, but then others don't (e.g., static_plotter.two_input_surface_contour_plot
) and for those I get a long series of the following errors/warnings (matplotlib: 3.5.1).
*c* argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with *x* & *y*. Please use the *color* keyword-argument or provide a 2D array with a single row if you intend to specify the same RGB or RGBA value for all points.
I was wondering whether you had a requirements.txt
that specified the version of the libraries used for creating the notebooks.
It might be something else than what the message says. I would have thought that warnings wouldn’t stop the plot from being run. But a requirements.txt
might help identify the culprit.
When I try git lfs pull
, I get:
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
error: failed to fetch some objects from 'https://github.com/jermwatt/machine_learning_refined.git/info/lfs'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.