Skip to Content
基于scikit-learn和PyTorch的实践机器学习
book

基于scikit-learn和PyTorch的实践机器学习

by Aurélien Géron
October 2025
Intermediate to advanced
878 pages
12h 53m
Chinese
O'Reilly Media, Inc.
Content preview from 基于scikit-learn和PyTorch的实践机器学习

第 9 章 人工神经网络简介 人工神经网络简介

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

鸟类 激发了我们飞行的灵感,牛蒡植物激发了尼龙搭扣的灵感,大自然还激发了无数发明的灵感。因此,从大脑结构中寻找如何制造智能机器的灵感似乎是顺理成章的。这就是人工神经网络(ANN)的诞生逻辑,它是受我们大脑中生物神经元网络启发的机器学习模型。不过,虽然飞机的灵感来自鸟类,但它们并不一定要扇动翅膀才能飞行。同样,ANN 也逐渐变得与其生物表亲大相径庭。一些研究人员甚至认为,我们应该完全放弃生物类比(例如,说 "单元 "而不是 "神经元"),以免我们的创造力局限于生物上看似合理的系统。1

ANN 是 Deep Learning 的核心。它们用途广泛、功能强大、可扩展性强,是处理大型、高度复杂的机器学习任务的理想选择,例如对数十亿张图片进行分类(如谷歌图片)、为语音识别服务(如苹果的 Siri 或谷歌助手)和聊天机器人(如 ChatGPT 或 Claude)提供动力、每天向数亿用户推荐最佳观看视频(如 YouTube)或学习蛋白质如何折叠(DeepMind 的 AlphaFold)。

本章将介绍人工神经网络,从快速浏览最早的人工神经网络架构开始,一直到今天大量使用的多层感知器(MLP)(后续章节还将探讨许多其他架构)。在本章中,我们将使用 Scikit-Learn 来实现简单的 MLP,以打好基础。在下一章中,我们将改用 PyTorch,因为它是一个更加灵活和高效的神经网络库。

现在,让我们回到人工神经网络的起源。

从生物神经元到人工神经元

令人惊讶的是 ,ANN 已经存在了相当长的一段时间:早在 1943 年,神经生理学家沃伦-麦卡洛克(Warren McCulloch)和数学家沃尔特-皮茨(Walter Pitts)就首次提出了 ANN。在他们具有里程碑意义的论文2"A Logical Calculus of Ideas Immanent in Nervous Activity "一文中,McCulloch 和 Pitts 提出了一个简化的计算模型,说明生物神经元如何在动物大脑中协同工作,利用命题逻辑进行复杂的计算。 这是第一个人工神经网络架构。从那时起,人们又发明了许多其他架构。

人工神经网络的早期成功让人们普遍相信,我们很快就能与真正的智能机器对话。20 世纪 60 年代,当人们意识到这一承诺将无法实现时(至少在相当长的一段时间内),资金流向了别处,ANN 进入了漫长的寒冬。20 世纪 80 年代初,新的体系结构被发明出来,更好的训练技术也被开发出来,从而引发了人们对连接主义的兴趣复苏, 神经网络的研究。但进展缓慢,到了 20 世纪 90 年代,又发明了其他强大的机器学习技术,如支持向量机。与神经网络相比,这些技术似乎能提供更好的结果和更坚实的理论基础,因此神经网络的研究再次被搁置。

现在,我们又迎来了一波对神经网络的兴趣浪潮。这波浪潮会像前几波浪潮一样消亡吗?那么,这里有几个很好的理由让我们相信,这一次是不同的,对神经网络的新兴趣将对我们的生活产生更深远的影响:

  • 现在有大量数据可以用来训练神经网络,而且在处理大型复杂问题时,ANN 的表现经常优于其他 ML 技术。

  • 自 20 世纪 90 年代以来,计算能力的巨大提升使得在合理的时间内训练大型神经网络成为可能。这部分归功于摩尔定律(在过去 50 年中,集成电路中的元件数量大约每两年翻一番),但也要归功于游戏产业,它刺激了数以百万计的强大 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

编写整洁的Python代码(第2版)

编写整洁的Python代码(第2版)

Posts & Telecom Press, Mariano Anaya
生成式人工智能可视化

生成式人工智能可视化

Priyanka Vergadia, Valliappa Lakshmanan
AI工程

AI工程

Chip Huyen

Publisher Resources

ISBN: 0642572270117