2026-01-19 11:25:10 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="discriminative-vs-generative-demo">
|
2026-02-01 23:42:12 +08:00
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<h4>🎯 判别式 vs 生成式 AI</h4>
|
|
|
|
|
<p class="subtitle">理解两种不同的 AI 范式</p>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
2026-02-01 23:42:12 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<div class="comparison-container">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!-- Discriminative AI -->
|
|
|
|
|
<el-col :xs="24" :sm="12">
|
|
|
|
|
<el-card
|
|
|
|
|
shadow="always"
|
|
|
|
|
class="ai-panel discriminative"
|
|
|
|
|
:class="{ active: mode === 'discriminative' }"
|
|
|
|
|
@click="mode = 'discriminative'"
|
|
|
|
|
>
|
|
|
|
|
<div class="panel-header">
|
|
|
|
|
<div class="icon">🔍</div>
|
|
|
|
|
<h5>判别式 AI</h5>
|
|
|
|
|
<el-tag size="small" type="success">分类/识别</el-tag>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
<div class="panel-content">
|
|
|
|
|
<div class="input-output">
|
|
|
|
|
<div class="io-box input">
|
|
|
|
|
<div class="io-label">输入</div>
|
|
|
|
|
<div class="io-content">
|
|
|
|
|
<div class="svg-placeholder green">
|
|
|
|
|
<span class="svg-text">猫图</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="arrow">
|
|
|
|
|
<el-icon><Bottom /></el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="io-box output">
|
|
|
|
|
<div class="io-label">输出</div>
|
|
|
|
|
<div class="io-content">
|
|
|
|
|
<el-tag effect="dark" type="success">这是猫</el-tag>
|
|
|
|
|
<div class="probability">置信度: 98%</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="examples">
|
|
|
|
|
<h6>典型应用:</h6>
|
|
|
|
|
<div class="example-tags">
|
|
|
|
|
<el-tag
|
|
|
|
|
size="small"
|
|
|
|
|
effect="plain"
|
|
|
|
|
v-for="tag in [
|
|
|
|
|
'图像分类',
|
|
|
|
|
'垃圾邮件过滤',
|
|
|
|
|
'疾病诊断',
|
|
|
|
|
'人脸识别'
|
|
|
|
|
]"
|
|
|
|
|
:key="tag"
|
|
|
|
|
>{{ tag }}</el-tag
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
2026-02-01 23:42:12 +08:00
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<!-- Generative AI -->
|
|
|
|
|
<el-col :xs="24" :sm="12">
|
|
|
|
|
<el-card
|
|
|
|
|
shadow="always"
|
|
|
|
|
class="ai-panel generative"
|
|
|
|
|
:class="{ active: mode === 'generative' }"
|
|
|
|
|
@click="mode = 'generative'"
|
|
|
|
|
>
|
|
|
|
|
<div class="panel-header">
|
|
|
|
|
<div class="icon">✨</div>
|
|
|
|
|
<h5>生成式 AI</h5>
|
|
|
|
|
<el-tag size="small" type="primary">创造/生成</el-tag>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
<div class="panel-content">
|
|
|
|
|
<div class="input-output">
|
|
|
|
|
<div class="io-box input">
|
|
|
|
|
<div class="io-label">输入</div>
|
|
|
|
|
<div class="io-content">
|
|
|
|
|
<div class="prompt-text">"一只戴墨镜的猫"</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="arrow">
|
|
|
|
|
<el-icon><Bottom /></el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="io-box output">
|
|
|
|
|
<div class="io-label">输出</div>
|
|
|
|
|
<div class="io-content">
|
|
|
|
|
<div class="svg-placeholder blue">
|
|
|
|
|
<span class="svg-text">生成图像 ✓</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="examples">
|
|
|
|
|
<h6>典型应用:</h6>
|
|
|
|
|
<div class="example-tags">
|
|
|
|
|
<el-tag
|
|
|
|
|
size="small"
|
|
|
|
|
effect="plain"
|
|
|
|
|
type="primary"
|
|
|
|
|
v-for="tag in [
|
|
|
|
|
'ChatGPT',
|
|
|
|
|
'Midjourney',
|
|
|
|
|
'代码生成',
|
|
|
|
|
'音乐创作'
|
|
|
|
|
]"
|
|
|
|
|
:key="tag"
|
|
|
|
|
>{{ tag }}</el-tag
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
2026-02-01 23:42:12 +08:00
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
2026-02-01 23:42:12 +08:00
|
|
|
</el-card>
|
2026-01-19 11:25:10 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref } from 'vue'
|
2026-02-01 23:42:12 +08:00
|
|
|
import { Bottom } from '@element-plus/icons-vue'
|
2026-01-19 11:25:10 +08:00
|
|
|
|
|
|
|
|
const mode = ref('discriminative')
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.discriminative-vs-generative-demo {
|
2026-02-01 23:42:12 +08:00
|
|
|
margin: 20px 0;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.card-header h4 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.subtitle {
|
|
|
|
|
font-size: 13px;
|
2026-01-19 11:25:10 +08:00
|
|
|
color: var(--vp-c-text-2);
|
2026-02-01 23:42:12 +08:00
|
|
|
margin: 4px 0 0;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.comparison-container {
|
2026-02-01 23:42:12 +08:00
|
|
|
padding: 10px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ai-panel {
|
|
|
|
|
cursor: pointer;
|
2026-02-01 23:42:12 +08:00
|
|
|
transition: all 0.3s;
|
|
|
|
|
border: 2px solid transparent;
|
|
|
|
|
height: 100%;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ai-panel:hover {
|
2026-02-01 23:42:12 +08:00
|
|
|
transform: translateY(-2px);
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ai-panel.active {
|
2026-02-01 23:42:12 +08:00
|
|
|
border-color: var(--el-color-primary);
|
|
|
|
|
background-color: var(--el-color-primary-light-9);
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.panel-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-02-01 23:42:12 +08:00
|
|
|
gap: 10px;
|
|
|
|
|
margin-bottom: 16px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.icon {
|
2026-02-01 23:42:12 +08:00
|
|
|
font-size: 24px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.panel-header h5 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
flex: 1;
|
2026-02-01 23:42:12 +08:00
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.panel-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 20px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-output {
|
2026-02-01 23:42:12 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
background-color: var(--vp-c-bg);
|
|
|
|
|
padding: 16px;
|
2026-02-14 20:23:34 +08:00
|
|
|
border-radius: 6px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.io-box {
|
2026-02-01 23:42:12 +08:00
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 5px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.io-label {
|
2026-02-01 23:42:12 +08:00
|
|
|
font-size: 12px;
|
2026-01-19 11:25:10 +08:00
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.io-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-02-01 23:42:12 +08:00
|
|
|
align-items: center;
|
|
|
|
|
gap: 5px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.svg-placeholder {
|
|
|
|
|
width: 60px;
|
|
|
|
|
height: 60px;
|
2026-01-19 11:25:10 +08:00
|
|
|
display: flex;
|
2026-02-01 23:42:12 +08:00
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border-radius: 4px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.svg-placeholder.green {
|
|
|
|
|
background-color: #48bb78;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.svg-placeholder.blue {
|
|
|
|
|
background-color: #667eea;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.svg-text {
|
|
|
|
|
color: white;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: bold;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.prompt-text {
|
|
|
|
|
background-color: var(--vp-c-bg-alt);
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-family: monospace;
|
|
|
|
|
font-size: 12px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.arrow {
|
2026-01-19 11:25:10 +08:00
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.probability {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.examples h6 {
|
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
|
font-size: 13px;
|
2026-01-19 11:25:10 +08:00
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-01 23:42:12 +08:00
|
|
|
.example-tags {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 8px;
|
2026-01-19 11:25:10 +08:00
|
|
|
}
|
|
|
|
|
</style>
|