书生浦语大模型实战营第四期-玩转书生「多模态对话」与「AI搜索」产品
- 教程链接:https://github.com/InternLM/Tutorial/tree/camp4/docs/L1/InternIntro
- 视频链接:https://www.bilibili.com/video/BV1ExDQYyEAA/
- 任务链接:https://github.com/InternLM/Tutorial/blob/camp4/docs/L1/InternIntro/tasks.md
- 提交链接:https://aicarrier.feishu.cn/share/base/form/shrcnUqshYPt7MdtYRTRpkiOFJd
任务说明
基础任务 (完成此任务即完成闯关)
相关产品 | 任务描述 |
---|---|
MindSearch 开源的 AI 搜索引擎 | 使用 MindSearch 在以下三个问题中选择一个你感兴趣的进行提问 1. 目前生成式AI在学术和工业界有什么最新进展? 2. 2024 年诺贝尔物理学奖为何会颁发给人工智能领域的科学家 Geoffrey E. Hinton,这一举动对这两个领域的从业人员会有什么影响? 3. 最近大火的中国 3A 大作《黑神话·悟空》里有什么让你难忘的精彩故事情节? 任务要求:将模型回复截图保存提交到飞书问卷。 |
书生·浦语 InternLM 开源模型官方的对话类产品 | 选择逻代码编程、文章创作、灵感创意、角色扮演、语言翻译、逻辑推理以上任意一个场景或者你自己感兴趣的话题与浦语进行对话 (轮次不限)。 任务要求:截图保存对话内容并提交到飞书问卷。 |
书生·万象 InternVL 开源的视觉语言模型官方的对话产品 | 体验书生·万象模型多模态能力,从图片 OCR、图片内容理解等方面与书生·万象展开一次包含图片内容的对话 任务要求:截图保存对话内容并提交到飞书问卷。 |
进阶任务 (优秀学员需要完成)
- MindSearch 话题挑战
浦语小助手将基础任务中的三个问题在知乎上进行了提问。
- 目前生成式AI在学术和工业界有什么最新进展?
- 2024 年诺贝尔物理学奖为何会颁发给人工智能领域,这一举动对这两个领域的从业人员会有什么影响?
- 最近大火的中国 3A 大作《黑神话·悟空》里有什么让你难忘的精彩故事情节?
请以 MindSearch 的回复作为参考 (推荐) 或者直接粘贴 MindSearch 的回复内容在知乎上回答 3 个问题的任意一个。
- 达标要求
- 注明回答中使用了 AI 搜索引擎 MindSearch (任何方式注明均可,比如“以下答案参考 AI 搜索引擎 MindSearch”)
- 将你在知乎回复的答案链接提交到飞书问卷
基础任务1
打开MindSearch主页:MindSearch HomePage
开始提问吧,
模型还给出了思考的过程,和信息来源,感觉很不错的样子,试试其他的问题:
基础任务2
打开书生浦语主页:https://internlm-chat.intern-ai.org.cn/
让模型生成龙格库塔方法的求解过程,对话如下:
模型生成的代码如下:
import numpy as np
def f(x, y):
return np.sin(x)
def runge_kutta4(f, x0, y0, h, n):
x = x0
y = y0
for i in range(n):
k1 = h * f(x, y)
k2 = h * f(x + h/2, y + k1/2)
k3 = h * f(x + h/2, y + k2/2)
k4 = h * f(x + h, y + k3)
y += (k1 + 2*k2 + 2*k3 + k4) / 6
x += h
return y
x0 = 0
y0 = 1
h = 0.01
n = int((1 - x0) / h)
y = runge_kutta4(f, x0, y0, h, n)
print(y)
公式貌似是对的,不过代码逻辑不太对,生成的结果应该是一个向量,这给出的就是一个值,迭代过程也是错的,运行一下就知道了:
看下文小言的结果:
import numpy as np
import matplotlib.pyplot as plt
def runge_kutta_4(f, t0, y0, t_end, n):
"""
四阶龙格库塔方法求解常微分方程
参数:
f -- 函数句柄,表示 dy/dt = f(t, y)
t0 -- 初始时间
y0 -- 初始条件
t_end -- 结束时间
n -- 时间区间内分割的点数(不包括 t0 和 t_end)
返回:
t_vals -- 时间点数组
y_vals -- y 值数组
"""
# 时间步长
h = (t_end - t0) / n
# 初始化时间点和 y 值数组
t_vals = np.linspace(t0, t_end, n+1)
y_vals = np.zeros(n+1)
y_vals[0] = y0
# 使用RK4方法进行迭代
for i in range(n):
t = t_vals[i]
y = y_vals[i]
# 计算k1, k2, k3, k4
k1 = h * f(t, y)
k2 = h * f(t + h/2, y + k1/2)
k3 = h * f(t + h/2, y + k2/2)
k4 = h * f(t + h, y + k3)
# 更新y值
y_vals[i+1] = y + (k1 + 2*k2 + 2*k3 + k4) / 6
return t_vals, y_vals
# 定义微分方程 dy/dt = f(t, y)
def f(t, y):
return -2 * t * y # 示例:dy/dt = -2ty
# 初始条件和时间范围
t0 = 0.0
y0 = 1.0
t_end = 2.0
n = 100 # 时间区间内分割的点数
# 使用RK4方法求解
t_vals, y_vals = runge_kutta_4(f, t0, y0, t_end, n)
# 绘制结果
plt.plot(t_vals, y_vals, label='RK4 Solution')
plt.xlabel('t')
plt.ylabel('y')
plt.title('Runge-Kutta 4th Order Method')
plt.legend()
plt.grid(True)
plt.show()
看着基本上没啥问题,还给出了可视化代码,运行结果如下:
感觉这方面还是有很大的优化空间的,因为浦语回答的文字逻辑是对的,但是代码对不上。
基础任务3
打开书生万象主页:https://internvl.opengvlab.com/
给出的代码如下:
import cv2
import numpy as np
# 读取图像
image = cv2.imread('sunspots.jpg')
# 加载YOLO模型
net = cv2.dnn.readNetFromDarknet('yolov3.cfg', 'yolov3.weights')
layer_names = net.getLayerNames()
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
# 预处理图像
blob = cv2.dnn.blobFromImage(image, scalefactor=0.00392, size=(416, 416), mean=(0, 0, 0), swapRB=True, crop=False)
net.setInput(blob)
# 进行预测
outs = net.forward(output_layers)
# 处理检测结果
class_ids = []
confidences = []
boxes = []
for out in outs:
for detection in out:
scores = detection[5:]
class_id = np.argmax(scores)
confidence = scores[class_id]
if confidence > 0.5:
# 获取边界框坐标
center_x = int(detection[0] * image.shape[1])
center_y = int(detection[1] * image.shape[0])
width = int(detection[2] * image.shape[1])
height = int(detection[3] * image.shape[0])
# 计算边界框的左上角和右下角坐标
x = center_x - width // 2
y = center_y - height // 2
boxes.append([x, y, width, height])
confidences.append(float(confidence))
class_ids.append(class_id)
# 非极大值抑制
indexes = cv2.dnn.NMSBoxes(boxes, confidences, 0.5, 0.4)
font = cv2.FONT_HERSHEY_PLAIN
# 绘制检测结果
for i in range(len(boxes)):
if i in indexes:
x, y, w, h = boxes[i]
label = str(class_ids[i])
color = (0, 255, 0)
cv2.rectangle(image, (x, y), (x + w, y + h), color, 2)
cv2.putText(image, label, (x, y + 30), font, 3, color, 3)
# 显示结果
cv2.imshow("Sunspots Detection", image)
cv2.waitKey(0)
cv2.destroyAllWindows()
进阶任务
问题1
目前生成式AI在学术和工业界有什么最新进展? - 林胜联府的回答 - 知乎
https://www.zhihu.com/question/1841339763/answer/30049868418
问题2
2024 年诺贝尔物理学奖为何会颁发给人工智能领域,这一举动对这两个领域的从业人员会有什么影响? - 林胜联府的回答 - 知乎
https://www.zhihu.com/question/1915470960/answer/30047649662
问题3
最近大火的中国 3A 大作《黑神话·悟空》里有什么让你难忘的精彩故事情节? - 林胜联府的回答 - 知乎
https://www.zhihu.com/question/1915582405/answer/30043909222