Machine Learning
1. Basic Packages
1.1. Numpy
NumPy是Python语言的一个扩展程序库。支持高阶大规模的多维数组与矩阵运算, 此外也针对数组运算提供大量的数学函数库。 NumPy的前身Numeric最早是由Jim Hugunin与其它协作者共同开发, 2005年,Travis Oliphant在Numeric中结合了另一个同性质的程序库Numarray的特色, 并加入了其它扩展而开发了NumPy。 NumPy为开放源代码并且由许多协作者共同维护开发。
1.2. Matplotlib
Matplotlib是Python语言及其数值计算库NumPy的绘图库。 它提供了一个面向对象的API,可以将绘图嵌入到使用通用GUI工具包 (如Tkinter、wxPython、Qt或GTK)的程序中。 它还有一个基于状态机(如OpenGL)的过程式编程“pylab”接口,其设计与MATLAB非常类似, 但由于命名空间的问题,因此建议改用matplotlib.pyplot取代。
2. AI Packages
2.1. Pytorch
2.2. Fastai
2.3. Transformers
为 Jax、PyTorch 和 TensorFlow 打造的先进的自然语言处理
3. AI Products
3.1. Stable Diffusion
Stable Diffusion是2022年发布的深度学习文本到图像生成模型。 它主要用于根据文本的描述产生详细图像,尽管它也可以应用于其他任务,如内补绘制、外补绘制, 以及在提示词指导下产生图生图的翻译。
它是一种潜在扩散模型,由慕尼黑大学的CompVis研究团体开发的各种生成性人工神經网络。 它是由初创公司StabilityAI,CompVis与Runway合作开发的, 并得到EleutherAI和LAION的支持。截至2022年10月,StabilityAI筹集了1.01亿美元的资金。
Stable Diffusion的代码和模型权重已公开发布, 可以在大多数配备有适度GPU的电脑硬件上运行。 而以前的专有文生图模型(如DALL-E和Midjourney)只能通过云计算服务访问。
3.2. Whisper
By OpenAI
Whisper is a general-purpose speech recognition model. It is trained on a large dataset of diverse audio and is also a multitasking model that can perform multilingual speech recognition, speech translation, and language identification.
4. Modules
5. Deep Learning
深度学习(英语:deep learning)是机器学习的分支,是一种以人工神经网络为架构, 对资料进行表征学习的算法。深度学习中的形容词“深度”是指在网络中使用多层。 早期的工作表明,线性感知器不能成为通用分类器, 但具有非多项式激活函数和一个无限宽度隐藏层的网络可以成为通用分类器。
深度学习是机器学习中一种基于对数据进行表征学习的算法。 观测值(例如一幅图像)可以使用多种方式来表示,如每个像素强度值的向量, 或者更抽象地表示成一系列边、特定形状的区域等。 而使用某些特定的表示方法更容易从实例中学习任务(例如,人脸识别或面部表情识别)。 深度学习的好处是用非监督式或半监督式的特征学习和分层特征提取高效算法来替代手工获取特征。
表征学习的目标是寻求更好的表示方法并创建更好的模型来从大规模未标记数据中学习这些表示方法。 表示方法来自神经科学,并松散地创建在类似神经系统中的信息处理和对通信模式的理解上, 如神经编码,试图定义拉动神经元的反应之间的关系以及大脑中的神经元的电活动之间的关系。
至今已有数种深度学习框架,如深度神经网络、卷积神经网络和深度置信网络和循环神经网络 已被应用在计算机视觉、语音识别、自然语言处理、音频识别与生物信息学等领域并获取了极好的效果。
5.1. Convolutional Neural Network, CNN
卷积神经网络(英语:Convolutional Neural Network,缩写:CNN)是一种前馈神经网络, 它的人工神经元可以响应一部分覆盖范围内的周围单元,对于大型图像处理有出色表现。
卷积神经网络由一个或多个卷积层和顶端的全连通层(对应经典的神经网络)组成, 同时也包括关联权重和池化层(pooling layer)。 这一结构使得卷积神经网络能够利用输入数据的二维结构。与其他深度学习结构相比, 卷积神经网络在图像和语音识别方面能够给出更好的结果。这一模型也可以使用反向传播算法进行训练。 相比较其他深度、前馈神经网络,卷积神经网络需要考量的参数更少, 使之成为一种颇具吸引力的深度学习结构。
卷积神经网络的灵感来自于动物视觉皮层组织的神经连接方式。 单个神经元只对有限区域内的刺激作出反应,不同神经元的感知区域相互重叠从而覆盖整个视野。
卷积神经网络是人工神经网络的一种特殊类型, 在其至少一层中使用称为卷积的数学运算代替通用矩阵乘法。 它们专门设计用于处理像素数据,并用于图像识别和处理。
5.2. U-Net
U-Net是弗赖堡大学计算机科学系为生物医学图像分割开发的卷积神经网络。 其基于完全卷积网络,并在结构上加以修改与扩展,使得它可以用更少的训练图像产生更精确的分割。 在现代GPU上,分割一张512×512的图像需要的时间不到一秒。
5.3. Residual neural network (残差神经网络, ResNet)
A residual neural network (ResNet) is an artificial neural network (ANN, 人工神经网络). It is a gateless or open-gated variant of the HighwayNet, the first working very deep feedforward neural network with hundreds of layers, much deeper than previous neural networks. Skip connections or shortcuts are used to jump over some layers (HighwayNets may also learn the skip weights themselves through an additional weight matrix for their gates). Typical ResNet models are implemented with double- or triple- layer skips that contain nonlinearities (ReLU, 修正线性单元) and batch normalization in between. Models with several parallel skips are referred to as DenseNets. In the context of residual neural networks, a non-residual network may be described as a plain network.
Like in the case of Long Short-Term Memory recurrent neural networks there are two main reasons to add skip connections: to avoid the problem of vanishing gradients, thus leading to easier optimization of neural networks, where the gating mechanisms facilitate information flow across many layers ("information highways"), or to mitigate the Degradation (accuracy saturation) problem; where adding more layers to a suitably deep model leads to higher training error. During training, the weights adapt to mute the upstream layer[clarification needed], and amplify the previously-skipped layer. In the simplest case, only the weights for the adjacent layer's connection are adapted, with no explicit weights for the upstream layer. This works best when a single nonlinear layer is stepped over, or when the intermediate layers are all linear. If not, then an explicit weight matrix should be learned for the skipped connection (a HighwayNet should be used).
Skipping effectively simplifies the network, using fewer layers in the initial training stages[clarification needed]. This speeds learning by reducing the impact of vanishing gradients,[5] as there are fewer layers to propagate through. The network then gradually restores the skipped layers as it learns the feature space. Towards the end of training, when all layers are expanded, it stays closer to the manifold[clarification needed] and thus learns faster. A neural network without residual parts explores more of the feature space. This makes it more vulnerable to perturbations that cause it to leave the manifold, and necessitates extra training data to recover.
A residual neural network was used to win the ImageNet 2015 competition, and has become the most cited neural network of the 21st century.
5.4. Generative Adversarial Network (生成对抗网络, GAN)
生成对抗网络(英语:Generative Adversarial Network,简称GAN)是非监督式学习的一种方法, 透过两个神经网络相互博弈的方式进行学习。该方法由伊恩·古德费洛等人于2014年提出。 生成对抗网络由一个生成网络与一个判别网络组成。生成网络从潜在空间(latent space) 中随机取样作为输入,其输出结果需要尽量模仿训练集中的真实样本。 判别网络的输入则为真实样本或生成网络的输出,其目的是将生成网络的输出从真实样本中尽可能分辨出来。 而生成网络则要尽可能地欺骗判别网络。两个网络相互对抗、不断调整参数, 最终目的是使判别网络无法判断生成网络的输出结果是否真实。
生成对抗网络常用于生成以假乱真的图片。此外,该方法还被用于生成视频、三维物体模型等。
生成对抗网络虽然最开始提出是为了无监督学习,但经证明对半监督学习、完全监督学习 、 强化学习也有效。
生成对抗网络的应用范围正在大幅增加,比如ChatGPT等