课程列表
计算知识
关于我们
# 《人工智能的数学基础》课程计算
自然科学研究院与数学科学学院 许志钦
研究生课程
简介:
本课程旨在为计算机科学与人工智能相关课程提供重要的数学基础。人工智能涉及对机器学习、模式识别、计算机视觉、语音识别、自然语言处理等多个领域的研究,其中最优化、统计模型、随机过程、微分几何、博弈论等数学原理对关于人工智能的深入研究和学习至关重要。本课程包含人工智能所必需的数学基础:第一部分介绍了随机过程的相关内容,特别是从机器学习的对象特性出发,并从时间序列和事件序列两个层面去理解平稳序列、泊松过程、时序点过程等知识。第二部分介绍了统计模型的相关内容,从频率学派和贝叶斯学派的两种视角理解常见统计方法背后的数学原理。第三部分介绍了三维空间中曲线和曲面的基本几何概念、局部性质和全局性质。第四部分介绍了最优化理论的基本概念、经典问题和典型算法,以及面向深度神经网络的应用。第五部分介绍了博弈论的相关内容,并针对多智能体系统中效用优化问题的关键知识做出了诠释,包括正则形式博弈、纳什均衡、扩展形式博弈、非完全信息博弈与重复博弈等。
课程通过对人工智能相关的数理基础的学习,要求学生理解并掌握最优化、统计模型、随机过程、微分几何、博弈论中与人工智能技术密切相关的原理与方法;特别是结合智能感知和智能决策两个方面的技术加深对人工智能中的(非)监督学习、强化学习、逆问题求解、组合优化等具体问题的理解和认知,并利用这些方法去分析甚至解决一些工程和经济管理等领域中的实际问题。
人工智能的数学基础这一课程旨在从应用数学的角度深入理解人工智能的相关问题和解决方法,使学生掌握人工智能研究中所需的基本数学思想和方法,并培养学生运用数学知识进行建模和利用人工智能相关技术分析和解决实际问题的能力,为后续学习人工智能具体技术和进一步深造奠定基础。
This course aims to provide an important mathematical foundation for computer science and artificial intelligence-related courses. Artificial intelligence involves the study of various fields including machine learning, pattern recognition, computer vision, speech recognition, and natural language processing. Therefore, the related mathematical principles, such as optimization, statistical model, stochastic process, differential geometry, game theory, and so on, are crucial to the in-depth study and further research of artificial intelligence. This course consists of the fundamental mathematical knowledge of artificial intelligence: Part 1 introduces the relevant concepts of the stochastic process from the perspective of object characteristics of machine learning, especially to understand the knowledge of stationary series, Poisson process, and time series point process from both the time series and the event sequence levels. Part 2 introduces the relevant concepts in statistical models and discusses the mathematical principles behind some common statistical methods, from both frequentist and Bayesian views. Part 3 introduces the basic concepts, local properties, and global properties of curves and surfaces in 3D space. Part 4 introduces the basic concepts, classic problems, algorithms, and applications of the optimization theory. Part 5 introduces the game theory, where the key concepts and formulations of utility optimization in multi-agent system will be provided, including normal-form game, Nash equilibrium, extensive-form game, imperfect-information game, repeated game, and etc. Through studying the mathematical principles related to artificial intelligence technology, the course requires students to understand and master the knowledge of optimization, statistical model, stochastic process, differential geometry, and game theory. In particular, students should utilize the techniques of intelligent perception and intelligent decision to acquire a better understanding of some specific problems in artificial intelligence, such as (non-)supervised learning, reinforcement learning, inverse problem solving, and combinatorial optimization. We expect the students to use the learned knowledge to analyze and even solve some practical problems in engineering or economic management. This course of the mathematical basis of artificial intelligence aims to give students an in-depth understanding of artificial intelligence-related problems from the perspective of applied mathematics. The students will gain the ability to master the mathematical principles relevant to AI techniques, and to use this knowledge to construct the problem model and further come up with solutions. The course lays the foundation for the research of artificial intelligence technology and prepares the students for advanced study.
内容:
1) Hands-on #1 编程小作业:拟合任意函数的神经网络模型
2) Hands-on #2 编程大作业:实验探索神经网络的性质
目的:
1) 通过修改一份可运行但较冗余及不完善的神经网络代码引导学生入门神经网络的编程;
2) 熟悉神经网络的性质,掌握基本的调参技巧;
3) 学会设计实验探索神经网络的特点并在大规模数据上验证猜想;
硬件:
AI 平台 CPU&GPU
软件:
Python, Tensorflow, PyTorch
[TOC] ## 计算账号 上海交通大学校级计算平台面向全校师生提供科研与教学支持。 交大 AI 平台由 8 台 DGX- 2组成,每台 DGX-2 配备 16 块 NVIDIA Tesla V100,深度学习张量计算能力 16PFLOPS;通过搭载 NVIDIA NVSwitch 创新技术,GPU 间带宽高达 2.4 TB/s 教学账号 stu 限课程实验使用,每人可使用 1 块 Nvidia Tesla V100/32G GPU,配合 6 核 CPU,作业时长最多 6 小时,若需延长计算时间,请将作业号发送至 hpc@sjtu.edu.cn ## 登录集群 ### 方法一: 浏览器中访问超算 Studio 可视化平台 https://studio.hpc.sjtu.edu.cn/ 顶上 Shell -> CPU Cluster Shell Access ![](https://notes.sjtu.edu.cn/uploads/upload_91cbc65fa4f92509c2f599f17ca34eeb.png) ### 方法二: 使用 SSH 连接(macOS 或 Linux 上使用终端,Windows 上安装 SSH 客户端),登录超算: ```shell= ssh stuXXX@login.hpc.sjtu.edu.cn ``` 登录方法具体请见 HPC 文档:https://docs.hpc.sjtu.edu.cn/login/ ## 安装软件 ### 1. 申请 GPU 资源,登录 GPU 节点 ```shell= srun -p dgx2 --gres=gpu:1 -N 1 --cpus-per-task=6 --ntasks-per-node=1 --pty /bin/bash ``` ### 2. 在该 GPU 节点上使用 conda 安装软件 新建一个名为 `math` 的 conda 环境,安装 numba, julie 扥软件 ```shell= module purge module load miniconda3 conda create -n math python=3.8 source activate math conda install -y -c numba numba conda install -y -c conda-forge julia ``` 软件安装成功之后,后续使用,通过以下命令激活环境即可: ```shell= module purge module load miniconda3 conda deactivate source activate math ``` ## 课程计算 选用下方两种方式之一计算。方式一的交互模式适合调试,方式二的作业模式适合正式运行长时间的作业 ### 方式一:交互模式 申请 GPU 资源,并登录到该 GPU 计算节点。 (若已按上文登录到了 GPU 节点,则无需重新输入下方命令): ```shell= srun -p dgx2 --gres=gpu:1 -N 1 --cpus-per-task=6 --ntasks-per-node=1 --pty /bin/bash ``` 接下来在这张 GPU 卡上进行交互模式的软件测试或计算 (以下是激活已安装的 conda 环境命令) ```shell= module purge module load miniconda3 source activate math ``` 也可以直接调用集群上全局部署的镜像版 Pytorch 或 TensorFlow,计算性能更优,但不支持再添加其它软件包 下方是调用镜像版 Pytorch: ```shell= module load pytorch/1.6.0 python -c 'import torch; print(torch.__version__); print(torch.zeros(10,10).cuda().shape)' ``` 下方是调用镜像版 TensorFlow: ```shell= module load tensorflow/2.2.0 python -c 'import tensorflow as tf; \ print(tf.__version__); \ print(tf.test.is_gpu_available());' ``` ### 方式二:sbatch 脚本提交模式 调试完成后,推荐使用 sbatch 方式提交作业脚本进行计算 作业脚本示例(假设作业脚本名为 `test.slurm`): ```shell= #!/bin/bash #SBATCH --job-name=stu #SBATCH --partition=dgx2 #SBATCH -N 1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=6 #SBATCH --gres=gpu:1 #SBATCH --output=%j.out #SBATCH --error=%j.err module purge module load miniconda3 conda deactivate source activate math module load gcc cuda python... ``` 作业提交: ```shell= sbatch test.slurm ``` 查看正在排队或运行的作业: ```shell= squeue ``` 取消作业,若 job ID 为 `12345`: ```shell= scancel 12345 ``` 查看作业,若 job ID 为 `12345`: ```shell= sacct -j 12345 ``` 查看已完成的作业效率,若 job ID 为 `12345`: ```shell= seff 12345 ``` 作业相关命令文档:https://docs.hpc.sjtu.edu.cn/job/slurm.html ## 注意事项 * 教学账号仅限教学使用;一人一账号,请注意保管 * 使用中遇到问题,欢迎邮件联系我们: hpc@sjtu.edu.cn ## 参考资料 * 超算使用文档: https://docs.hpc.sjtu.edu.cn/ * Matlab 使用:https://docs.hpc.sjtu.edu.cn/studio/matlab.html * π 实时利用率:https://account.hpc.sjtu.edu.cn/top * HPC 网站:https://hpc.sjtu.edu.cn * 公众号:交我算 * 视频号:交我算 * 简短版使用手册(Cheat Sheet):https://hpc.sjtu.edu.cn/Item/docs/Pi_GetStarted.pdf
"交我算”HPC&AI
“交我算”云计算
正版软件
水源文档
loading......