100% found this document useful (4 votes)
139 views

Download full MLOps Engineering at Scale 1st Edition Carl Osipov ebook all chapters

The document promotes various ebooks available for download on ebookmeta.com, including titles on MLOps, data management, and machine learning. It highlights the importance of serverless machine learning and MLOps for effective AI project delivery. Additionally, it provides links to other recommended digital products and emphasizes the significance of practical applications in learning and implementing machine learning concepts.

Uploaded by

kruftnavoaxc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
139 views

Download full MLOps Engineering at Scale 1st Edition Carl Osipov ebook all chapters

The document promotes various ebooks available for download on ebookmeta.com, including titles on MLOps, data management, and machine learning. It highlights the importance of serverless machine learning and MLOps for effective AI project delivery. Additionally, it provides links to other recommended digital products and emphasizes the significance of practical applications in learning and implementing machine learning concepts.

Uploaded by

kruftnavoaxc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

MLOps Engineering at Scale 1st Edition Carl Osipov

https://ebookmeta.com/product/mlops-engineering-at-
scale-1st-edition-carl-osipov/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Analytics Engineering with SQL and dbt: Building


Meaningful Data Models at Scale Rui Pedro Machado

https://ebookmeta.com/product/analytics-engineering-with-sql-and-dbt-
building-meaningful-data-models-at-scale-rui-pedro-machado/

ebookmeta.com

Data Management at Scale Piethein Strengholt

https://ebookmeta.com/product/data-management-at-scale-piethein-
strengholt/

ebookmeta.com

Data Management at Scale, Second Edition Piethein


Strengholt

https://ebookmeta.com/product/data-management-at-scale-second-edition-
piethein-strengholt/

ebookmeta.com

Fundamentals of Applied Electromagnetics (8th Edition)


Fawwaz T. Ulaby

https://ebookmeta.com/product/fundamentals-of-applied-
electromagnetics-8th-edition-fawwaz-t-ulaby/

ebookmeta.com
The Human Imperative Power Freedom and Democracy in the
age of Artificial Intelligence 1st Edition Paul Nemitz

https://ebookmeta.com/product/the-human-imperative-power-freedom-and-
democracy-in-the-age-of-artificial-intelligence-1st-edition-paul-
nemitz/
ebookmeta.com

Noah His Dog Curvy Girl and Firefighter Romance 1st


Edition Scarlett Woods

https://ebookmeta.com/product/noah-his-dog-curvy-girl-and-firefighter-
romance-1st-edition-scarlett-woods/

ebookmeta.com

Coronavirus (COVID-19) Infection in Pregnancy: Version 16


Published December 2022 Multidisciplinary Group Of Authors

https://ebookmeta.com/product/coronavirus-covid-19-infection-in-
pregnancy-version-16-published-december-2022-multidisciplinary-group-
of-authors/
ebookmeta.com

International Natural Resources Law Investment and


Sustainability 1st Edition Shawkat Alam (Editor)

https://ebookmeta.com/product/international-natural-resources-law-
investment-and-sustainability-1st-edition-shawkat-alam-editor/

ebookmeta.com

Engineering Economics of Life Cycle Cost Analysis: 2nd


Edition John Vail Farr

https://ebookmeta.com/product/engineering-economics-of-life-cycle-
cost-analysis-2nd-edition-john-vail-farr/

ebookmeta.com
Design User Experience and Usability Design for Diversity
Well being and Social Development 10th International
Conference DUXU 2021 Held as Part of the 23rd HCI
International Conference HCII 2021 Virtual Event July 24
https://ebookmeta.com/product/design-user-experience-and-usability-
29 2021 Part II 1st Edition Marcelo M. Soares
design-for-diversity-well-being-and-social-development-10th-
international-conference-duxu-2021-held-as-part-of-the-23rd-hci-
international-conference-hcii-2021-virt/
ebookmeta.com
MLOps Engineering at Scale
CARL OSIPOV
To comment go to liveBook

Manning

Shelter Island
For more information on this and other Manning titles go to
www.manning.com
Copyright

For online information and ordering of these and other


Manning books, please visit www.manning.com. The
publisher offers discounts on these books when ordered in
quantity.

For more information, please contact

Special Sales Department


Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com

©2022 by Manning Publications Co. All rights


reserved.

No part of this publication may be reproduced, stored in a


retrieval system, or transmitted, in any form or by means
electronic, mechanical, photocopying, or otherwise, without
prior written permission of the publisher.

Many of the designations used by manufacturers and sellers


to distinguish their products are claimed as trademarks.
Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the
designations have been printed in initial caps or all caps.

♾ Recognizing the importance of preserving what has been


written, it is Manning’s policy to have the books we publish
printed on acid-free paper, and we exert our best efforts to
that end. Recognizing also our responsibility to conserve the
resources of our planet, Manning books are printed on
paper that is at least 15 percent recycled and processed
without the use of elemental chlorine.

Manning Publications Co.

20 Baldwin Road Technical

PO Box 761

Shelter Island, NY 11964

Development editor: Marina Michaels

Technical development editor: Frances Buontempo


Review editor: Mihaela Batinić

Production editor: Deirdre S. Hiam

Copy editor: Michele Mitchell

Proofreader: Keri Hales

Technical proofreader: Karsten Strøbaek

Typesetter: Dennis Dalinnik


Cover designer: Marija Tudor

ISBN: 9781617297762
contents
preface
acknowledgments
about this book
about the author
about the cover illustration

Part 1 Mastering the data set


1 Introduction to serverless machine learning
1.1 What is a machine learning platform?
1.2 Challenges when designing a machine learning
platform
1.3 Public clouds for machine learning platforms
1.4 What is serverless machine learning?
1.5 Why serverless machine learning?
Serverless vs. IaaS and PaaS
Serverless machine learning life cycle
1.6 Who is this book for?
What you can get out of this book
1.7 How does this book teach?
1.8 When is this book not for you?
1.9 Conclusions
2 Getting started with the data set
2.1 Introducing the Washington, DC taxi rides data set
What is the business use case?
What are the business rules?
What is the schema for the business service?
What are the options for implementing the business service?
What data assets are available for the business service?
Downloading and unzipping the data set
2.2 Starting with object storage for the data set
Understanding object storage vs. filesystems
Authenticating with Amazon Web Services
Creating a serverless object storage bucket

2.3 Discovering the schema for the data set


Introducing AWS Glue
Authorizing the crawler to access your objects
Using a crawler to discover the data schema

2.4 Migrating to columnar storage for more efficient


analytics
Introducing column-oriented data formats for analytics
Migrating to a column-oriented data format

3 Exploring and preparing the data set


3.1 Getting started with interactive querying
Choosing the right use case for interactive querying
Introducing AWS Athena
Preparing a sample data set
Interactive querying using Athena from a browser
Interactive querying using a sample data set
Querying the DC taxi data set
3.2 Getting started with data quality
From “garbage in, garbage out” to data quality
Before starting with data quality
Normative principles for data quality

3.3 Applying VACUUM to the DC taxi data


Enforcing the schema to ensure valid values
Cleaning up invalid fare amounts
Improving the accuracy

3.4 Implementing VACUUM in a PySpark job


4 More exploratory data analysis and data preparation
4.1 Getting started with data sampling
Exploring the summary statistics of the cleaned-up data set
Choosing the right sample size for the test data set
Exploring the statistics of alternative sample sizes
Using a PySpark job to sample the test set

Part 2 PyTorch for serverless machine learning


5 Introducing PyTorch: Tensor basics
5.1 Getting started with tensors
5.2 Getting started with PyTorch tensor creation
operations
5.3 Creating PyTorch tensors of pseudorandom and
interval values
5.4 PyTorch tensor operations and broadcasting
5.5 PyTorch tensors vs. native Python lists
6 Core PyTorch: Autograd, optimizers, and utilities
6.1 Understanding the basics of autodiff
6.2 Linear regression using PyTorch automatic
differentiation
6.3 Transitioning to PyTorch optimizers for gradient
descent
6.4 Getting started with data set batches for gradient
descent
6.5 Data set batches with PyTorch Dataset and
DataLoader
6.6 Dataset and DataLoader classes for gradient descent
with batches
7 Serverless machine learning at scale
7.1 What if a single node is enough for my machine
learning model?
7.2 Using IterableDataset and ObjectStorageDataset
7.3 Gradient descent with out-of-memory data sets
7.4 Faster PyTorch tensor operations with GPUs
7.5 Scaling up to use GPU cores
8 Scaling out with distributed training
8.1 What if the training data set does not fit in memory?
Illustrating gradient accumulation
Preparing a sample model and data set
Understanding gradient descent using out-of-memory data
shards
8.2 Parameter server approach to gradient accumulation
8.3 Introducing logical ring-based gradient descent
8.4 Understanding ring-based distributed gradient
descent
8.5 Phase 1: Reduce-scatter
8.6 Phase 2: All-gather

Part 3 Serverless machine learning pipeline


9 Feature selection
9.1 Guiding principles for feature selection
Related to the label
Recorded before inference time
Supported by abundant examples
Expressed as a number with a meaningful scale
Based on expert insights about the project

9.2 Feature selection case studies


9.3 Feature selection using guiding principles
Related to the label
Recorded before inference time
Supported by abundant examples
Numeric with meaningful magnitude
Bring expert insight to the problem
9.4 Selecting features for the DC taxi data set
10 Adopting PyTorch Lightning
10.1 Understanding PyTorch Lightning
Converting PyTorch model training to PyTorch Lightning
Enabling test and reporting for a trained model
Enabling validation during model training

11 Hyperparameter optimization
11.1 Hyperparameter optimization with Optuna
Understanding loguniform hyperparameters
Using categorical and log-uniform hyperparameters

11.2 Neural network layers configuration as a


hyperparameter
11.3 Experimenting with the batch normalization
hyperparameter
Using Optuna study for hyperparameter optimization
Visualizing an HPO study in Optuna

12 Machine learning pipeline


12.1 Describing the machine learning pipeline
12.2 Enabling PyTorch-distributed training support with
Kaen
Understanding PyTorch-distributed training settings

12.3 Unit testing model training in a local Kaen container


12.4 Hyperparameter optimization with Optuna
Enabling MLFlow support
Using HPO for DcTaxiModel in a local Kaen provider
Training with the Kaen AWS provider

Appendix A Introduction to machine learning


Appendix B Getting started with Docker
index
front matter

preface
A useful piece of feedback that I got from a reviewer of this
book was that it became a “cheat code” for them to scale
the steep MLOps learning curve. I hope that the content of
this book will help you become a better informed
practitioner of machine learning engineering and data
science, as well as a more productive contributor to your
projects, your team, and your organization.

In 2021, major technology companies are vocal about their


efforts to “democratize” artificial intelligence (AI) by making
technologies like deep learning more accessible to a broader
population of scientists and engineers. Regrettably, the
democratization approach taken by the corporations focuses
too much on core technologies and not enough on the
practice of delivering AI systems to end users. As a result,
machine learning (ML) engineers and data scientists are
well prepared to create experimental, proof-of-concept AI
prototypes but fall short in successfully delivering these
prototypes to production. This is evident from a wide
spectrum of issues: from unacceptably high failure rates of
AI projects to ethical controversies about AI systems that
make it to end users. I believe that, to become successful,
the effort to democratize AI must progress beyond the
myopic focus on core, enabling technologies like Keras,
PyTorch, and TensorFlow. MLOps emerged as a unifying
term for the practice of taking experimental ML code and
running it effectively in production. Serverless ML is the
leading cloud-native software development model for ML
and MLOps, abstracting away infrastructure and improving
productivity of the practitioners.

I also encourage you to make use of the Jupyter notebooks


that accompany this book. The DC taxi fare project used in
the notebook code is designed to give you the practice you
need to grow as a practitioner. Happy reading and happy
coding!

acknowledgments
I am forever grateful to my daughter, Sophia. You are my
eternal source of happiness and inspiration. My wife, Alla,
was boundlessly patient with me while I wrote my first
book. You were always there to support me and to cheer me
along. To my father, Mikhael, I wouldn’t be who I am
without you.

I also want to thank the people at Manning who made this


book possible: Marina Michaels, my development editor;
Frances Buontempo, my technical development editor;
Karsten Strøbaek, my technical proofreader; Deirdre Hiam,
my project editor; Michele Mitchell, my copyeditor; and Keri
Hales, my proofreader.
Another Random Document on
Scribd Without Any Related Topics
The Mechanics of Reason
Aristotle fathered the syllogism, or at least was first to investigate it
rigorously. He defined it as a formal argument in which the
conclusion follows logically from the premises. There are four
common statements of this type:
All S (for subject) is P (for
predicate)
No S (for subject) is P
Some S (for is P
subject)
Some S (for is not P
subject)
Thus, Aristotle might say “All men are mortal” or “No men are
immortal” as his subject. Adding an M (middle term), “Aristotle is a
man,” as a minor premise, he could logically go on and conclude
“Aristotle, being a man, is thus mortal.” Of course the syllogism
unwisely used, as it often is, can lead to some ridiculously silly
answers. “All tables have four legs. Two men have four legs. Thus,
two men equal a table.”
Despite the weaknesses of the syllogism, nevertheless it led
eventually to the science of symbolic logic. The pathway was
circuitous, even devious at times, but slowly the idea of putting
thought down as letters or numbers to be logically manipulated to
reach proper conclusions gained force and credence. While the
Greeks did not have the final say, they did have words for the subject
as they did for nearly everything else.
Let us leave the subject of pure logic for a moment and talk of
another kind of computing machine, that of the mechanical doer of
work. In the Iliad, Homer has Hephaestus, the god of natural fire and
metalworking, construct twenty three-wheeled chariots which propel
themselves to and fro bringing back messages and instructions from
the councils of the gods. These early automatons boasted pure gold
wheels, and handles of “curious cunning.”
Man has apparently been a lazy cuss from the start and began
straightway to dream of mechanical servants to do his chores. In an
age of magic and fear of the supernatural his dreams were fraught
with such machines that turned into evil monsters. The Hebrew
“golem” was made in the shape of man, but without a soul, and often
got out of hand. Literature has perpetuated the idea of machines
running amok, as the broom in “The Sorcerer’s Apprentice,” but
there have been benevolent machines too. Tik-Tok, a latter-day
windup man in The Road to Oz, could think and talk and do many
other things men could do. He was not alive, of course, but he had
the saving grace of always doing just what he “was wound up to do.”
Having touched on the subject of mechanical men, let us now
return to mechanical logic. Since the Greeks, many men have
traveled the road of reason, but some stand out more brightly, more
colorfully, than others. Such a standout was the Spanish monk
Ramón Lull. Lull was born in 1232. A court page, he rose in
influence, married young, and had two children, but did not settle
down to married domesticity. A wildly reckless romantic, he was
given to such stunts as galloping his horse into church in pursuit of
some lady who caught his eye. One such escapade led to a
remorseful re-examination of himself, and dramatic conversion to
Christianity.
He began to write books in conventional praise of Christ, but early
in his writings a preoccupation with numbers appears. His Book of
Contemplation, for example, actually contains five books for the five
wounds of the Saviour, and forty subdivisions for the days He spent
in the wilderness. There are 365 chapters for daily reading, plus one
for reading only in leap years! Each chapter has ten paragraphs,
symbolizing the ten commandments, and three parts to each
chapter. These multiplied give thirty, for the pieces of silver. Beside
religious and mystical connotations, geometric terms are also used,
and one interesting device is the symbolizing of words and even
phrases by letters. This ties in neatly with syllogism. A sample
follows:
… diversity is shown in the demonstration that the D makes of the E and the F
and the G with the I and the K, therefore the H has certain scientific knowledge of
Thy holy and glorious Trinity.

This was only prologue to the Ars Magna, the “Great Art” of
Ramón Lull. In 1274, the devout pilgrim climbed Mount Palma in
search of divine help in his writings. The result was the first recorded
attempt to use diagrams to discover and to prove non-mathematical
truths. Specifically, Lull determined that he could construct
mechanical devices that would perform logic to prove the validity of
God’s word. Where force, in the shape of the Crusades, had failed,
Lull was convinced that logical argument would win over the infidels,
and he devoted his life to the task.
Renouncing his estate, including his wife and children, Lull
devoted himself thenceforth solely to his Great Art. As a result of
dreams he had on Mount Palma, the basis for this work was the
assumption of simple premises or principles that are unquestionable.
Lull arranged these premises on rotating concentric circles. The first
of these wheels of logic was called A, standing for God. Arranged
about the circumference of the wheel were sixteen other letters
symbolizing attributes of God. The outer wheel also contained these
letters. Rotating them produced 240 two-term combinations telling
many things about God and His good. Other wheels prepared
sermons, advised physicians and scientists, and even tackled such
stumpers as “Where does the flame go when the candle is put out?”
From the Enciclopedia universal
illustrada,
Barcelona, 1923

Lull’s wheel.

Unfortunately for Lull, even divine help did not guarantee him
success. He was stoned to death by infidels in Bugia, Africa, at the
age of eighty-three. All his wheelspinning logic was to no avail in
advancing the cause of Christianity there, and most mathematicians
since have scoffed at his naïve devices as having no real merit. Far
from accepting the Ars Magna, most scholars have been “Lulled into
a secure sense of falsity,” finding it as specious as indiscriminate
syllogism.
Yet Lull did leave his mark, and many copies of his wheels have
been made and found useful. Where various permutations of
numbers or other symbols are required, such a mechanical tool is
often the fastest way of pairing them up. Even in the field of writing, a
Lullian device was popular a few decades ago in the form of the “Plot
Genii.” With this gadget the would-be author merely spun the wheels
to match up various characters with interesting situations to arrive at
story ideas. Other versions use cards to do the same job, and one
called Plotto was used by its inventor William Wallace Cook to plot
countless stories. Although these were perhaps not ideas for great
literature, eager writers paid as much as $75 for the plot boiler.
Not all serious thinkers relegated Lull to the position of fanatic
dreamer and gadgeteer. No less a mind that Gottfried Wilhelm von
Leibnitz found much to laud in Lull’s works. The Ars Magna might
well lead to a universal “algebra” of all knowledge, thought Leibnitz.
“If controversies were to arise,” he then mused, “there would be no
more reason for philosophers to dispute than there would for
accountants!”
Leibnitz applied Lull’s work to formal logic, constructed tables of
syllogisms from which he eliminated the false, and carried the work
of the “gifted crank” at bit nearer to true symbolic logic. Leibnitz also
extended the circle idea to that of overlapping them in early attempts
at logical manipulation that foreshadowed the work that John Venn
would do later. Leibnitz also saw in numbers a powerful argument for
the existence of God. God, he saw as the numeral 1, and 0 was the
nothingness from which He created the world. There are those,
including Voltaire whose Candide satirized the notion, who question
that it is the best of all possible worlds, but none can question that in
the seventeenth century Leibnitz foresaw the coming power of the
binary system. He also built arithmetical computers that could add
and subtract, multiply and divide.
A few years earlier than Leibnitz, Blaise Pascal was also
interested in computing machines. As a teen-ager working in his
father’s tax office, Pascal wearied of adding the tedious figures so he
built himself a gear-driven computer that would add eight columns of
numbers. A tall figure in the scientific world, Pascal had fathered
projective geometry at age sixteen and later established
hydrodynamics as a science. To assist a gambler friend, he also
developed the theory of probability which led to statistical science.
Another mathematical innovation of the century was that of placing
logarithms on a stick by the Scot, John Napier. What he had done, of
course, was to make an analog, or scale model of the arithmetical
numbers. “Napier’s bones” quickly became what we now call slide
rules, forerunners of a whole class of analog computers that solve
problems by being actual models of size or quantity. Newton joined
Leibnitz in contributing another valuable tool that would be used in
the computer, that of the calculus.
The Computer in Literature
Even as Plato had viewed with suspicion the infringement of
mechanical devices on man’s domain of higher thought, other men
have continued to eye the growth of “mechanisms” with mounting
alarm. The scientist and inventor battled not merely technical
difficulties, but the scornful satire and righteous condemnation of
some of their fellow men. Jonathan Swift, the Irish satirist who took a
swipe at many things that did not set well with his views, lambasted
the computing machine as a substitute for the brain. In Chapter V,
Book Three, of Gulliver’s Travels, the good dean runs up against a
scheming scientist in Laputa:
The first Professor I saw was in a very large Room, with Forty
Pupils about him. After Salutation, observing me to look earnestly
upon a Frame, which took up the greatest part of both the Length
and Breadth of the Room; he said, perhaps I might wonder to see
him employed in a Project for improving speculative knowledge by
practical and mechanical Operations. But the World would soon be
sensible of its Usefulness; and he flattered himself, that a more
noble exalted Thought never sprang in any other Man’s Head. Every
one knew how laborious the usual Method is of attaining to Arts and
Sciences; whereas by his Contrivance, the most ignorant Person at
a reasonable Charge, and with a little bodily Labour, may write
Books in Philosophy, Poetry, Politicks, Law, Mathematicks, and
Theology, without the least Assistance from Genius or Study. He
then led me to the Frame, about the Sides whereof all his Pupils
stood in Ranks. It was a Twenty Foot Square, placed in the Middle of
the Room. The Superfices was composed of several Bits of Wood,
about the Bigness of a Dye, but some larger than others. They were
all linked together by slender Wires. These Bits of Wood were
covered on every Square with Papers pasted on them; and on these
Papers were written all the Words of their Language in their several
Moods, Tenses, and Declensions, but without any Order. The
Professor then desired me to observe, for he was going to set his
Engine to work. The Pupils at his Command took each the hold of an
Iron Handle, whereof there were Forty fixed round the Edges of the
Frame; and giving them a sudden Turn, the whole Disposition of the
Words was entirely changed. He then commanded Six and Thirty of
the Lads to read the several Lines softly as they appeared upon the
Frame; and where they found three or four Words together that
might make Part of a Sentence, they dictated to the four remaining
Boys who were Scribes. This work was repeated three or four Times,
and at every Turn the Engine was so contrived, that the Words
shifted into new Places, as the square Bits of Wood moved upside
down.
Six hours a-day the young Students were employed in this Labour;
and the Professor showed me several Volumes in large Folio already
collected, of broken Sentences, which he intended to piece together,
and out of those rich Materials to give the World a compleat Body of
Art and Sciences; which however might be still improved, and much
expedited, if the Publick would raise a Fund for making and
employing five Hundred such Frames in Lagado....
Fortunately for Swift, who would have been horrified by it, he
never heard Russell Maloney’s classic story, “Inflexible Logic,” about
six monkeys pounding away at typewriters and re-creating the world
great literature. Gulliver’s Travels is not listed in their
accomplishments.
The French Revolution prompted no less an orator than Edmund
Burke to deliver in 1790 an address titled “Reflections on the French
Revolution,” in which he extols the virtues of the dying feudal order in
Europe. It galled Burke that “The Age of Chivalry is gone. That of
sophists, economists, and calculators has succeeded, and the glory
of Europe is extinguished forever.”
Seventy years later another eminent Englishman named Darwin
published a book called On the Origin of Species that in the eyes of
many readers did little to glorify man himself. Samuel Butler, better
known for his novel, The Way of All Flesh, wrote too of the
mechanical being, and was one of the first to point out just what sort
of future Darwin was suggesting. In the satirical Erewhon, he
described the machines of this mysterious land in some of the most
prophetic writing that has been done on the subject. It was almost a
hundred years ago that Butler wrote the first version, called “Darwin
Among the Machines,” but the words ring like those of a 1962 worrier
over the electronic brain. Butler’s character warns:
There is no security against the ultimate development of mechanical
consciousness in the fact of machines possessing little consciousness now.
Reflect upon the extraordinary advance which machines have made during the last
few hundred years, and note how slowly the animal and vegetable kingdoms are
advancing. The more highly organized machines are creatures not so much of
yesterday, as of the last five minutes, so to speak, in comparison with past time.
Do not let me be misunderstood as living in fear of any actually existing
machine; there is probably no known machine which is more than a prototype of
future mechanical life. The present machines are to the future as the early
Saurians to man ... what I fear is the extraordinary rapidity with which they are
becoming something very different to what they are at present.

Butler envisioned the day when the present rude cries with which
machines call out to one another will have been developed to a
speech as intricate as our own. After all, “... take man’s vaunted
power of calculation. Have we not engines which can do all manner
of sums more quickly and correctly than we can? What prizeman in
Hypothetics at any of our Colleges of Unreason can compare with
some of these machines in their own line?”
Noting another difference in man and his creation, Butler says,
... Our sum-engines never drop a figure, nor our looms a stitch; the machine is
brisk and active, when the man is weary, it is clear-headed and collected, when the
man is stupid and dull, it needs no slumber.... May not man himself become a sort
of parasite upon the machines? An affectionate machine-tickling aphid?
It can be answered that even though machines should hear never so well and
speak never so wisely, they will still always do the one or the other for our
advantage, not their own; that man will be the ruling spirit and the machine the
servant.... This is all very well. But the servant glides by imperceptible approaches
into the master, and we have come to such a pass that, even now, man must
suffer terribly on ceasing to benefit the machines. If all machines were to be
annihilated ... man should be left as it were naked upon a desert island, we should
become extinct in six weeks.
Is it not plain that the machines are gaining ground upon us, when we reflect on
the increasing number of those who are bound down to them as slaves, and of
those who devote their whole souls to the advancement of the mechanical
kingdom?

Butler considers the argument that machines at least cannot


copulate, since they have no reproductive system. “If this be taken to
mean that they cannot marry, and that we are never likely to see a
fertile union between two vapor-engines with the young ones playing
about the door of the shed, however greatly we might desire to do
so, I will readily grant it. [But] surely if a machine is able to reproduce
another machine systematically, we may say that it has a
reproductive system.”
Butler repeats his main theme. “... his [man’s] organization never
advanced with anything like the rapidity with which that of the
machine is advancing. This is the most alarming feature of the case,
and I must be pardoned for insisting on it so frequently.”
Then there is a startlingly clear vision of the machines “regarded
as a part of man’s own physical nature, being really nothing but
extra-corporeal limbs. Man ... as a machinate mammal.” This was
feared as leading to eventual weakness of man until we finally found
“man himself being nothing but soul and mechanism, an intelligent
but passionless principle of mechanical action.” And so the
Erewhonians in self-defense destroyed all inventions discovered in
the preceding 271 years!
Early Mechanical Devices
During the nineteenth century, weaving was one of the most
competitive industries in Europe, and new inventions were often
closely guarded secrets. Just such an idea was that of Frenchman
Joseph M. Jacquard, an idea that automated the loom and would
later become the basis for the first modern computers. A big problem
in weaving was how to control a multiplicity of flying needles to
create the desired pattern in the material. There were ways of doing
this, of course, but all of them were unwieldy and costly. Then
Jacquard hit on a clever scheme. If he took a card and punched
holes in it where he wanted the needles to be actuated, it was simple
to make the needles do his bidding. To change the pattern took only
another card, and cards were cheap. Patented in 1801, there were
soon thousands of Jacquard looms in operation, doing beautiful and
accurate designs at a reasonable price.
To show off the scope of his wonderful punched cards, Jacquard
had one of his looms weave a portrait of him in silk. The job took
20,000 cards, but it was a beautiful and effective testimonial. And
fatefully a copy of the silk portrait would later find its way into the
hands of a man who would do much more with the oddly punched
cards.
At about this same time, a Hungarian named Wolfgang von
Kempelen decided that machines could play games as well as work
in factories. So von Kempelen built himself a chess-playing machine
called the Maelzel Chess Automaton with which he toured Europe.
The inventor and his machine played a great game, but they didn’t
play fair. Hidden in the innards of the Maelzel Automaton was a
second human player, but this disillusioning truth was not known for
some time. Thus von Kempelen doubtless spurred other inventors to
the task, and in a short while machines would actually begin to play
the royal game. For instance, a Spaniard named L. Torres y
Quevedo built a chess-playing machine in 1914. This device played
a fair “end game” using several pieces, and its inventor predicted
future work in this direction using more advanced machines.
Charles Babbage was an English scientist with a burning desire
for accuracy. When some mathematical tables prepared for the
Astronomical Society proved to be full of errors, he angrily
determined to build a machine that would do the job with no
mistakes. Of course calculating machines had been built before; but
the machine Babbage had in mind was different. In fact, he called it
a “difference engine” because it was based on the difference tables
of the squares of numbers. The first of the “giant computers,” it was
to have hundreds of gears and shafts, ratchets and counters. Any
arithmetic problem could be set into it, and when the proper cranks
were turned, out would come an answer—the right answer because
the machine could not make a mistake. After doing some preliminary
work on his difference engine, Babbage interested the government in
his project since even though he was fairly well-to-do he realized it
would cost more money than he could afford to sink into the project.
Babbage was a respected scientist, Lucasian Professor of
Mathematics at Cambridge, and because of his reputation and the
promise of the machine, the Chancellor of the Exchequer promised
to underwrite the project.
For four years Babbage and his mechanics toiled. Instead of
completing his original idea, the scientist had succeeded only in
designing a far more complicated machine, one which would when
finished weigh about two tons. Because the parts he needed were
advanced beyond the state of the art of metalworking, Babbage was
forced to design and build them himself. In the process he decided
that industry was being run all wrong, and took time out to write a
book. It was an excellent book, a sort of forerunner to the modern
science of operations research, and Babbage’s machine shop was
doing wonders for the metalworking art.
Undaunted by the lack of progress toward a concrete result,
Babbage was thinking bigger and bigger. He was going to scrap the
difference engine, or rather put it in a museum, and build a far better
computer—an “analytical engine.” If Jacquard’s punched cards could
control the needles on a loom, they could also operate the gears and
other parts of a calculating machine. This new engine would be one
that could not only add, subtract, multiply, and divide; it would be
designed to control itself. And as the answers started to come out,
they would be fed back to do more complex problems with no further
work on the operator’s part. “Having the machine eat its own tail!”
Babbage called this sophisticated bit of programming. This
mechanical cannibalism was the root of the “feedback” principle
widely used in machines today. Echoing Watt’s steam governor, it
prophesied the coming control of machines by the machines
themselves. Besides this innovation, the machine would have a
“store,” or memory, of one thousand fifty-digit numbers that it could
draw on, and it would actually exercise judgment in selection of the
proper numbers. And as if that weren’t enough, it would print out the
correct answers automatically on specially engraved copper plates!
Space Technology Laboratories

“As soon as an Analytical Engine exists, it will


necessarily guide the future course of science.
Whenever any result is sought by its aid, the question
will then arise—by what course of calculation can
these results be arrived at by the machine in the
shortest time?” Charles Babbage—The Life of a
Philosopher, 1861.

It was a wonderful dream; a dream that might have become an


actuality in Babbage’s own time if machine technology had been as
advanced as his ideas. But for Babbage it remained only a dream, a
dream that never did work successfully. The government spent
£17,000, a huge sum for that day and time, and bowed out. Babbage
fumed and then put his own money into the machine. His mechanics
left him and became leaders in the machine-tool field, having trained
in Babbage’s workshops. In despair, he gave up on the analytical
engine and designed another difference engine. An early model of
this one would work to five accurate places, but Babbage had his
eyes on a much better goal—twenty-place accuracy. A lesser man
would have aimed more realistically and perhaps delivered workable
computers to the mathematicians and businessmen of the day.
There is a legend that his son did finish one of the simpler machines
and that it was used in actuarial accounting for many years. But
Babbage himself died in 1871 unaware of how much he had done for
the computer technology that would begin to flower a few short
decades later.
Singlehandedly he had given the computer art the idea of
programming and of sequential control, a memory in addition to the
arithmetic unit he called a “mill,” and even an automatic readout such
as is now standard on modern computers. Truly, the modern
computer was “Babbage’s dream come true.”
Symbolic Logic
Concurrently with the great strides being made with mechanical
computers that could handle mathematics, much work was also
being done with the formalizing of the logic. As hinted vaguely in the
syllogisms of the early philosophers, thinking did seem amenable to
being diagrammed, much like grammar. Augustus De Morgan
devised numerical logic systems, and George Boole set up the logic
system that has come to be known as Boolean algebra in which
reasoning becomes positive or negative terms that can be
manipulated algebraically to give valid answers.
John Venn put the idea of logic into pictures, and simple pictures
at that. His symbology looks for all the world like the three
interlocking rings of a well-known ale. These rings stand for the
subject, midterm, and predicate of the older Aristotelian syllogism.
By shading the various circles according to the major and minor
premises, the user of Venn circles can see the logical result by
inspection. Implicit in the scheme is the possibility of a mechanical or
electrical analogy to this visual method, and it was not long until
mathematicians began at least on the mechanical kind. Among these
early logic mechanizers, surprisingly, was Lewis Carroll who of
course was mathematician Charles L. Dodgson before he became a
writer.
Carroll, who was a far busier man than most of us ever guess,
marketed a “Game of Logic,” with a board and colored cardboard
counters that handled problems like the following:

All teetotalers like sugar.


No nightingale drinks wine.

By arranging the counters on Carroll’s game board so that: All M are


X, and No Y is not-M, we learn that No Y is not-X! This tells the
initiate logician that no nightingale dislikes sugar; a handy piece of
information for bird-fancier and sugar-broker alike.
Lewis Carroll’s “Symbolic Logic.”

Charles, the third Earl Stanhope, was only slightly less


controversial than his prime minister, William Pitt. Scientifically he
was far out too, writing books on electrical theory, inventing
steamboats, microscopes, and printing presses among an odd
variety of projects; he also became interested in mechanical logic
and designed the “Stanhope Demonstrator,” a contrivance like a
checkerboard with sliding panels. By properly manipulating the
demonstrator he could solve such problems as:

Eight of ten children are bright.


Four of these children are boys.

What are the minimum and maximum number of bright boys? A


simple sliding of scales on the Stanhope Demonstrator shows that
two must be boys and as many as four may be. This clever device
could also work out probability problems such as how many heads
and tails will come up in so many tosses of a coin.
In 1869 William S. Jevons, an English economist and expert
logician, built a logic machine. His was not the first, of course, but it
had a unique distinction in that it solved problems faster than the
human brain could! Using Boolean algebra principles, he built a
“logical abacus” and then even a “logical piano.” By simply pressing
the keys of this machine, the user could make the answer appear on
its face. It is of interest that Jevons thought his machine of no
practical use, since complex logical questions seldom arose in
everyday life! Life, it seems, was simpler in 1869 than it is today, and
we should be grateful that Jevons pursued his work through sheer
scientific interest.
More sophisticated than the Jevons piano, the logic machine
invented in America by Allan Marquand could handle four terms and
do problems like the following:
There are four schoolgirls, Anna, Bertha, Cora, and Dora.
When Anna or Bertha, or both, remain home, Cora is at home.
When Bertha is out, Anna is out.
Whenever Cora is at home, Anna is too.
What can we tell about Dora?

The machine is smart enough to tell us that when Dora is at home


the other three girls are all at home or out. The same thing is true
when Dora is out.
The Census Taker
Moving from the sophistication of such logic devices, we find a
tremendous advance in mechanical computers spurred by such a
mundane chore as the census. The 1880 United States census
required seven years for compiling; and that with only 50 million
heads to reckon. It was plain to see that shortly a ten-year census
would be impossible of completion unless something were done to
cut the birth rate or speed the counting. Dr. Herman Hollerith was the
man who did something about it, and as a result the 1890 census,
with 62 million people counted, took only one-third the time of the
previous tally.
Hollerith, a statistician living in Buffalo, New York, may or may not
have heard the old saw about statistics being able to support
anything—including the statisticians, but there was a challenge in the
rapid growth of population that appealed to the inventor in him and
he set to work. He came up with a card punched with coded holes, a
card much like that used by Jacquard on his looms, and by Babbage
on the dream computer that became a nightmare. But Hollerith did
not meet the fate of his predecessors. Not stoned, or doomed to die
a failure, Hollerith built his card machines and contracted with the
government to do the census work. “It was a good paying business,”
he said. It was indeed, and his early census cards would some day
be known generically as “IBM cards.”
While Jacquard and Babbage of necessity used mechanical
devices with their punched cards, Hollerith added the magic of
electricity to his card machine, building in essence the first electrical
computing machine. The punched cards were floated across a pool
of mercury, and telescoping pins in the reading head dropped
through the holes. As they contacted the mercury, an electrical circuit
was made and another American counted. Hollerith did not stop with
census work. Sagely he felt there must be commercial applications
for his machines and sold two of the leading railroads on a punched-
card accounting system. His firm merged with others to become the
Computing-Tabulating-Recording Company, and finally International
Business Machines. The term “Hollerith Coding” is still familiar today.

You might also like