Sunday, December 27, 2020

Hands-On Machine Learning with Scikit-Learn and TensorFlowHands-On Machine Learning with Scikit-Learn and TensorFlow by Aurélien Géron
My rating: 5 of 5 stars

"Machine Learning is the science (and art) of programming computers so they can learn from data."

It is December 27th, four days until the end of the year, and I am four books short of my Goodreads 2020 Reading Challenge goal of 60 books. Never abandon hope! I will review two computer science books that were tremendously important to me and my students in 2020, books that helped me return to the field of neural networks and machine learning in general and helped my outstanding research student complete her challenging and advanced research project with extraordinary success.

I worked with neural networks (NN) in the late 1980s and early 1990s and even co-taught a psychology/computer science course on neural network learning. However, in the 1990s it had become clear that the limits of what the then traditional NN architecture can achieve had been reached and the scientific community basically abandoned NNs as the preferred approach to machine learning. Yet beginning in the first decade of the 21st century we witnessed the rebirth of the NN idea, primarily via various multi-level NN models, such as convolutional neural networks (CNNs) developed by Le Cun, Hinton, and others. Currently, CNNs achieve truly spectacular (without exaggeration one can say 'superhuman') results in various areas of artificial intelligence (AI) and machine learning (ML).

The recent explosion of research and commercial interest in ML resulted in an avalanche of books published on the topic, particularly "popular" books (ones that can serve as tutorials of sorts), addressed to computer science practitioners of various level of preparation, from complete novices to advanced. The range of quality of the books is even more vast. I worked with, read, or at least scanned thoroughly over 20 ML books and to me Hands-On Machine Learning is by far the best text, one that can serve for a wide variety of purposes: on one hand, it can serve as an ML textbook, on the other it can be used as a tutorial for particular methods of ML. (I will review the other great ML book, one that focuses purely on NN, the day after tomorrow. By the way, I was amazed how many bad, totally useless ML books have been published. Christmas spirit prevents me from listing their titles.)

Aurélien Géron, the author of Hands-On Machine Learning, comes with impressive industry credentials. He served as the Product Manager of YouTube video classification at Google, and held several senior positions in artificial intelligence engineering in various companies.

The first two chapters of the book, which belong to the first part entitledThe Fundamentals of Machine Learning, are an absolute must read for anyone interested in studying ML. The author presents the 'landscape of machine learning' and shows a typical ML project 'end-to-end', including data preparation and preprocessing as well as selecting, training, and fine-tuning the model.

The next six chapters of Part I focus on specific ML approaches and their mathematical background. We read about the methods of classification, the Support Vector Machines approach, including the 'kernel trick,' decision trees, ensemble learning and random forests. I love the solid yet very accessible presentation of the math background in the chapter on gradient descent, various types of regression, and regularization. Part I closes with a nice chapter about dimensionality reduction, which focuses on the method of Principal Component Analysis.

Part II of the book, titled Neural Networks and Deep Learning, gives a great overview of the so-called 'deep learning' approach: the reader will learn about the 'classical' NN approach, and then will be gradually introduced to the multi-level NN architecture, CNNs, recurrent NNs, and autoencoders.

The author's reliance on the production-ready Scikit-Learn and TensorFlow Python frameworks rather than on developing own toy versions of various algorithms is commendable. Scikit-Learn, a free software library of machine learning tools, is one of the best things developed in computer science in the last 50 years. It is a splendid manifestation of the power of open-source software.

From a teacher's point of view, the book is excellent! I believe Hands-On Machine Learning is great for the students too. It comes with a lot of interesting Python code samples, in the form of Jupyter notebooks. And the code works! The students can learn a lot by rewriting and extending the sample code.

Very, very highly recommended book! And I am going to round up my extremely high rating of

Four-and-a-half stars.

View all my reviews

Wednesday, May 6, 2020

Bad BloodBad Blood by Lorna Sage
My rating: 5 of 5 stars

"Gail had a gift for intentness. She could caress shapeless moments [...] as if she was stroking a puppy, until they wriggled into life and sucked your fingers."

[This review is dedicated to EVK, my outstanding student, who gave me this book.]

Lorna Sage's Bad Blood (2000) is an extraordinary literary work! I could not believe that it is non-fiction. I felt everything was so real as if it were a work of fiction by a great writer. Non-fiction books almost never feel real to me because they do not transcend the particular, the specific, the individual. Their meaning and reach are constrained by the connection to concrete facts, like a balloon that wants to soar high in the sky but is tied to a child's hand. Fiction books are able to much better convey the truth since they allow the reader to focus more on the humanness in general rather than on particular people or concrete events.

Ms. Sage's prose is fabulous! She is an extraordinarily accomplished writer with a wonderful turn of the phrase. Just take this "caressing shapeless moments until they wriggle into life" phrase from the epigraph. Reading this I instantaneously recalled people who had this gift. How many of us, though, would have the talent to describe them in this apparently frivolous yet extremely precise way? A metaphor like that carries more meaning than a faithful and detailed account of real-life behavior.

But wait, there is more: Ms. Sage has written one of three best accounts of childhood and adolescence that I have ever read, along with J. Joyce's and J.M. Coetzee's (which are perhaps more universal and realistic as they are at least in part fictional). Playing doctor in the bushes, the horror of braces, schooling torture and malevolent teachers, like the one in the following, unforgettable passage:
"One day he lined up his class and went down the line saying with gloomy satisfaction 'You'll be a muck-shoveller, you'll be a muck-shoveller...' and so on and on [...]"
Still more: the magnificent account of the first school dance, a momentous event in a schoolchild's life. For me, also the mention of Paul Anka's song Diana! The event must have taken place about 1962. Well, I had my first school dance around that time too, and I also remember the horrors of worrying who, if anyone, I would dance with; and I also counted one, two, three, under my breath while "dancing." And, yes, Paul Anka's Diana was there too! A sort of disclaimer is needed: maybe I like the memoir so much because the author belongs to my generation?

The author's grandparents on her mother's side are the main focus of the memoir. Their hatred towards each other is the dominating motif:
"So married were Grandpa and Grandma that they offended each other by existing and he must have hated the prospect of gratifying her by going first. On the other hand she truly feared death, thus he could score points by hailing it as a deliverance and embracing his fate."
The entire thread of the grandfather's diary is stunningly well constructed and presented. The diary itself and the author's commentary seamlessly move from one to the other.

I could keep enumerating the literary values of the memoir, but the review is already too long. Let me only mention that we get an evocative account of life in deeply provincial Great Britain in the 1950s and 1960s. Oh, and my three favorite sentences:
"[...] it's a good idea to settle for a few loose ends [in a story], because even if everything in your life is connected to everything else, that way madness lies."
And what about
"He too was only fifteen, but he smoked and drank, and was fed up with being so young."
And let's end with the best quote about the ending:
"It's the sense of an ending that's timeless.
Four-and-a-half stars, and I am rounding up. Yay! First maximum rating since February.

View all my reviews

Monday, February 24, 2020

Seven Brief Lessons on PhysicsSeven Brief Lessons on Physics by Carlo Rovelli
My rating: 5 of 5 stars

"Ever since we discovered that Earth is round and turns like a mad spinning-top, we have understood that reality is not as it appears to us: every time we glimpse a new aspect of it, it is a deeply emotional experience. Another veil has fallen."

In Preface, the author of Seven Brief Lessons on Physics, Carlo Rovelli, a renowned theoretical physicist and a philosopher of science, addresses his book to "those who know little or nothing about modern science." Although I am an applied mathematician, an engineer, and have even taught a course on mechanics (a classical part of physics), I know very little - really next to nothing - about modern physics. I have learned a lot from that tiny book (total of 81 pages!) and I absolutely love Dr. Rovelli's amazing way of making some basic tenets of contemporary physics almost understandable by amateurs like myself. This is the best popular science writing I have ever read!

The first lesson deals with "the most beautiful of theories" - Einstein's general theory of relativity. We read wonderful passages like
"[...] the gravitational field is not diffused through space; the gravitational field is that spaceitself."
We then read about curvature of space and that "it isn't only space that curves; time does too." The second lesson focuses on quantum mechanics, which in layman's terms posits that energy is discrete rather than continuous. And it is here that to my delight (and likely to screams of horror of many people) randomness and probability appear! Dr. Rovelli states at the end of the chapter that the equations of quantum mechanics and their consequences "remain mysterious," and suggests an idea that "reality [of the physical world] is only interaction." So cool!

I am omitting two next chapters in my summary, Architecture of the Cosmos and Particles (with its Standard Model, confirmed experimentally in 2013 yet still considered unsatisfactory). The Fifth Lesson focuses on the contradictions between the current form of the two main theories of physics - general relativity and quantum mechanics - and on the current efforts of physicists to combine the two theories. One such effort is the loop quantum gravity theory and Dr. Rovelli, in extreme modesty, neglects to write that he is one of the founders (if not the main founder - that I do not know) of the theory.

Naturally, the lesson titled Probability, Time, and the Heat of Black Holes, is my favorite! Even a mention of the word "probability" makes my heart beat faster and here it becomes a central mechanism of physics. Dr. Rovelli writes
"This bringing of probability to the heart of physics, and using it to explain the bases of the dynamics of heat, was initially considered to be absurd."
And what about the following stunning passage:
"[...] the intimate connection between time and heat. There is a detectable difference between the past and the future only when there is the flow of heat. Heat is linked to probability; and probability in turn is linked to the fact that our interactions with the rest of the world do not register the fine details of reality."
Finally, in the lesson called In Closing, the author writes about "ourselves" - us, the humans. He dwells on the nature of consciousness and the issue of free will. In a passage that unfortunately becomes more and more relevant with each passing year he points out the "incomprehension and distrust of science shown by a significant part of our contemporary culture." He also offers a sobering prediction that "our species will not last long" and alludes to the damage that the species keeps doing.

A beautifully written book about Very Difficult Things.

Five stars.


View all my reviews