-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
131 lines (130 loc) · 45.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!doctype html>
<html lang="zh"><head><meta charset="utf-8"><meta name="generator" content="Hexo 4.2.0"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta><title>Digital Shiyu</title><meta description="Trying to be everything about me"><meta property="og:type" content="blog"><meta property="og:title" content="Digital Shiyu"><meta property="og:url" content="http://yoursite.com/"><meta property="og:site_name" content="Digital Shiyu"><meta property="og:description" content="Trying to be everything about me"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="http://yoursite.com/img/og_image.png"><meta property="article:author" content="shiyu AllRightsReserved"><meta property="article:tag" content="work"><meta property="article:tag" content=" life"><meta property="article:tag" content=" thoughts"><meta property="twitter:card" content="summary"><meta property="twitter:image" content="/img/og_image.png"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"http://yoursite.com"},"headline":"Digital Shiyu","image":["http://yoursite.com/img/og_image.png"],"author":{"@type":"Person","name":"shiyu AllRightsReserved"},"description":"Trying to be everything about me"}</script><link rel="icon" href="/img/digitalpre.png"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-light.css"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;600&family=Source+Code+Pro"><link rel="stylesheet" href="/css/default.css"><!--!--><!--!--><script src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" defer></script><!--!--><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css"><script src="https://www.googletagmanager.com/gtag/js?id=UA-165282104-1" async></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-165282104-1');</script><!--!--><!--!--><script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script></head><body class="is-2-column"><nav class="navbar navbar-main"><div class="container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/"><img src="/img/Digital.png" alt="Digital Shiyu" height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item is-active" href="/">主页</a><a class="navbar-item" href="/archives">存档</a><a class="navbar-item" href="/categories">分类</a><a class="navbar-item" href="/tags">标签</a><a class="navbar-item" href="/about">关于</a></div><div class="navbar-end"><a class="navbar-item search" title="搜索" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-8-widescreen"><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/10/13/CPP/%E5%BE%AA%E7%8E%AF%E5%92%8C%E8%AE%A1%E6%95%B0/"><img class="thumbnail" src="/gallery/cpp.png" alt="循环和计数"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-10-13T08:45:21.000Z" title="2020-10-13T08:45:21.000Z">2020-10-13</time><span class="level-item"><a class="link-muted" href="/categories/cpp/">cpp</a></span><span class="level-item">8 分钟 读完 (大约 1222 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/10/13/CPP/%E5%BE%AA%E7%8E%AF%E5%92%8C%E8%AE%A1%E6%95%B0/">循环和计数</a></h1><div class="content"><p>学习要点:</p>
<ol>
<li>针对之前的打印框架进行改进,从而减少存储并把输出结构的变化更加灵活</li>
<li>掌握 while 循环的循环不变式</li>
<li>三种精简程序的方法: 预定义 std 变量,for 循环精简,逻辑压缩精简</li>
<li>从零开始和从1开始计数的差异</li>
<li>其他:使用类中的类型来作为变量的类型</li>
</ol>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 打印形如</span></span><br><span class="line"><span class="comment">****************</span></span><br><span class="line"><span class="comment">* *</span></span><br><span class="line"><span class="comment">* Hello, daisy *</span></span><br><span class="line"><span class="comment">* *</span></span><br><span class="line"><span class="comment">****************</span></span><br><span class="line"><span class="comment">的greetings */</span> </span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string"><iostream></span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string"><string></span></span></span><br><span class="line"></span><br><span class="line"><span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">cin</span>; <span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">endl</span>;</span><br><span class="line"><span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">cout</span>;<span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">string</span>;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>{</span><br><span class="line"> <span class="built_in">cout</span> << <span class="string">"please input your name"</span>;</span><br><span class="line"></span><br><span class="line"> <span class="built_in">string</span> name;</span><br><span class="line"> <span class="built_in">cin</span> >> name;</span><br><span class="line"></span><br><span class="line"> <span class="built_in">cout</span> << <span class="string">"please input the pad size you want"</span>;</span><br><span class="line"></span><br><span class="line"> <span class="keyword">int</span> pad = <span class="number">0</span>;</span><br><span class="line"> <span class="built_in">cin</span> >> pad;</span><br><span class="line"></span><br><span class="line"> <span class="keyword">const</span> <span class="built_in">string</span> greetings = <span class="string">"Hello, "</span> + name + <span class="string">"!"</span>;</span><br><span class="line"> <span class="keyword">const</span> <span class="keyword">int</span> rows = pad*<span class="number">2</span> + <span class="number">3</span>;</span><br><span class="line"> <span class="keyword">const</span> <span class="built_in">string</span>::size_type cols = greetings.<span class="built_in">size</span>() + pad*<span class="number">2</span> + <span class="number">2</span>;</span><br><span class="line"></span><br><span class="line"> <span class="built_in">cout</span> << <span class="built_in">endl</span>;</span><br><span class="line"></span><br><span class="line"> <span class="comment">// 循环不变式:已经打印了r行</span></span><br><span class="line"> <span class="keyword">for</span>(<span class="keyword">int</span> r = <span class="number">0</span>; r!=rows; ++r){</span><br><span class="line"> <span class="built_in">string</span>::size_type c = <span class="number">0</span>;</span><br><span class="line"> <span class="keyword">while</span> (c!=cols){</span><br><span class="line"> <span class="keyword">if</span>(r==pad+<span class="number">1</span> && c == pad+<span class="number">1</span>){</span><br><span class="line"> <span class="built_in">cout</span> << greetings;</span><br><span class="line"> c += greetings.<span class="built_in">size</span>();</span><br><span class="line"> }<span class="keyword">else</span>{</span><br><span class="line"> <span class="keyword">if</span>(c == <span class="number">0</span> || c == cols<span class="number">-1</span> || r == <span class="number">0</span> || r == rows <span class="number">-1</span>)</span><br><span class="line"> <span class="built_in">cout</span> << <span class="string">"*"</span>;</span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> <span class="built_in">cout</span> << <span class="string">" "</span>;</span><br><span class="line"> ++c;</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> <span class="built_in">cout</span> << <span class="built_in">endl</span>;</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h2 id="1-更加灵活的打印框架"><a href="#1-更加灵活的打印框架" class="headerlink" title="1. 更加灵活的打印框架"></a>1. 更加灵活的打印框架</h2><p>由于我们使用的打印框架有固定格式—在周围包‘*’号,中间打印greetings, 并在之间用空格包围, 我们可以直接通过行和列的位置计算出打印的符号。<br>通过这样的思想我们可以相较于之前:</p>
<ol>
<li>节省对于每一行结果的保存</li>
<li>灵活调节空格</li>
</ol>
<h2 id="2-使用-while-语句"><a href="#2-使用-while-语句" class="headerlink" title="2. 使用 while 语句"></a>2. 使用 while 语句</h2><ol>
<li><p>形式:</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">while</span> (condition)</span><br><span class="line"> statement <span class="comment">//statement 可以是由{}框起来的块语句,也可以是一个普通的语句</span></span><br></pre></td></tr></table></figure>
<p>由于循环的概念相对熟悉,我们仅仅讲述如何设计 while 语句,也就是确保循环不变式的成立</p>
</li>
<li><p>循环不变式:<br><strong>循环不变式是在每次 while 语句测试条件的时候,这个条件一定为真,从而这样能确定程序的运行和我们的意图相符</strong><br>在示例程序中,循环不变式是已经打印了 r 行。也就是通过初始化和循环体的执行,我们循环不变式成立,因此循环结束,就打印了rows行</p>
</li>
</ol>
<h2 id="3-精简程序"><a href="#3-精简程序" class="headerlink" title="3. 精简程序"></a>3. 精简程序</h2><ol>
<li>预先定义namespace: 在程序中,我们有很多使用 std::name 的场景,我们可以对其进行一定的精简,即: <figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"> <span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">cout</span>; <span class="comment">//声明我们的cout 是std 中的,这个声明随着我们使用位置的不同,也会有不同的定义域</span></span><br><span class="line"> <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>; <span class="comment">// 引入std 中所有的命名,这个和 import * 类似,一次引入了太多的变量,并有可能带来模糊(不同定义的同样名称变量)</span></span><br><span class="line"> ``` </span><br><span class="line"><span class="number">2.</span> 使用 <span class="keyword">for</span> 循环代替初始化和累加操作:每次使用<span class="keyword">while</span> 循环,一般都需要初始化控制变量,并每次累加,我们使用精简的 <span class="keyword">for</span> 循环也可以实现</span><br><span class="line"> ```c++</span><br><span class="line"> <span class="keyword">for</span>(init_statement condition; expression) <span class="comment">// init_statement 只会执行一次,并且退出for 循环之后,这个变量不再存在</span></span><br><span class="line"> statment</span><br><span class="line"> </span><br><span class="line"> <span class="comment">//等效于下面</span></span><br><span class="line"> {</span><br><span class="line"> init_statement</span><br><span class="line"> <span class="keyword">while</span> (condition){</span><br><span class="line"> statement</span><br><span class="line"> expression </span><br><span class="line"> }</span><br><span class="line"> }</span><br></pre></td></tr></table></figure></li>
<li>压缩检测: 程序中多次出现的语句,有时可以通过逻辑进行优化</li>
</ol>
<h2 id="4-从零开始和从1开始计数的差异"><a href="#4-从零开始和从1开始计数的差异" class="headerlink" title="4. 从零开始和从1开始计数的差异"></a>4. 从零开始和从1开始计数的差异</h2><ol>
<li>从零开始计数可以直接计算出 [m,n) 区间中包含n-m个元素;</li>
<li>表示空区间时更方便:从 0 开始是 [n,n), 而从 1 开始是 [n,n-1],末尾比开头小可能会有很多麻烦</li>
<li>循环表达式更加好表达和理解:<ul>
<li>从零开始: 已经输出 r 行</li>
<li>从1开始:已经输出 r-1 行</li>
</ul>
</li>
<li>程序状态更好理解:从零开始能保证输出了 row 行,而从 1 开始的r<=row 只能保证 r >row,因此不确定最终输出了多少行。</li>
</ol>
<h2 id="5-其他:"><a href="#5-其他:" class="headerlink" title="5. 其他:"></a>5. 其他:</h2><ol>
<li><p>使用类中的类型来作为变量的类型: 因为对于输入字符长度的不确定性,我们可以使用string 中的类型来定义变量。</p>
<blockquote>
<blockquote>
<p>当我们需要定义一个变量来保存特定数据结构的大小,就应该养成使用库位特殊用途而定义的类型的好习惯</p>
</blockquote>
</blockquote>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">using</span> <span class="built_in">std</span>::<span class="built_in">string</span>;</span><br><span class="line"><span class="built_in">string</span>::size_type cols = greetings.<span class="built_in">size</span>() + <span class="number">2</span>; <span class="comment">// greetings 是输入的字符,可能很长,这个长度 int 不一定可以包容</span></span><br></pre></td></tr></table></figure></li>
<li>累加符号:++r; 由于变成后续数值和重新计算任意数值的概念形成鲜明对比,因此这个概念时很有意义的 </li>
<li><p>运算符的优先级:在书写表达式时,其结果会随运算符的结合性和优先级产生不同的结果,其中只有赋值运算符和单运算符时右结合的。这里,运算符的优先级和 python 相差不大</p>
<p> 只需注意,++x 返回 x + 1, x++ 返回 x即可 </p>
</li>
</ol>
</div></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/27/Music/%E5%BC%B9%E7%90%B4/"><img class="thumbnail" src="/gallery/pianosit.png" alt="弹琴姿势"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-27T11:30:15.000Z" title="2020-09-27T11:30:15.000Z">2020-09-27</time><span class="level-item"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></span><span class="level-item">2 分钟 读完 (大约 240 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/27/Music/%E5%BC%B9%E7%90%B4/">弹琴姿势</a></h1><div class="content"><h2 id="坐姿:"><a href="#坐姿:" class="headerlink" title="坐姿:"></a>坐姿:</h2><p>坐下弹琴时,上身直立,坐琴凳三分之一,坐在琴键的正中间位置。方便自己可以更好的使用到钢琴所有琴键</p>
<h2 id="手部姿势"><a href="#手部姿势" class="headerlink" title="手部姿势"></a>手部姿势</h2><ol>
<li><strong>不要晃压手腕</strong>:手掌不要下压,也不要过度抬起,正常平放</li>
<li><strong>抬手和收手</strong>:开始时,手轻轻抬起,远离键面;结束时,手正常收回</li>
<li><strong>连续按键</strong>:按下一个键时,其他手指可以抬起;在按下下一个键之后,再松开之前的键,从而形成连续而不松散的发音 </li>
<li><strong>指型</strong>:手指直立按键,不要折指,也不要过于内扣,大拇指使用指尖进行弹奏</li>
<li><strong>手臂</strong>:在固定键位弹奏时,注意手部不要晃动。<br>只有在真正放松的状态下才能演奏出优美的音色。</li>
</ol>
</div></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/27/Music/%E4%BA%94%E7%BA%BF%E8%B0%B1/"><img class="thumbnail" src="/gallery/beat.png" alt="五线谱"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-27T06:31:29.000Z" title="2020-09-27T06:31:29.000Z">2020-09-27</time><span class="level-item"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></span><span class="level-item">9 分钟 读完 (大约 1322 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/27/Music/%E4%BA%94%E7%BA%BF%E8%B0%B1/">五线谱</a></h1><div class="content"><p>根据 <a href="https://www.youtube.com/watch?v=R_4MThtf49E">doyoudo</a>的教程整理的笔记</p>
<h2 id="第一节:识谱"><a href="#第一节:识谱" class="headerlink" title="第一节:识谱"></a>第一节:识谱</h2><ol>
<li><strong>乐符</strong>:五线谱中的基本组成元素为乐符,其中符号由下往上分为符头,符干和符尾,这三者用来区分不同的音符时值,只有一个空心符头则称为全音符,下面是各种不同时值音符的表示方式<br><img src="/Pics/staff1.png" alt="乐符"></div><a class="article-more button is-small size-small" href="/2020/09/27/Music/%E4%BA%94%E7%BA%BF%E8%B0%B1/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/27/Music/%E4%B9%90%E7%90%86/"><img class="thumbnail" src="/gallery/beat.png" alt="乐理知识"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-27T01:27:56.000Z" title="2020-09-27T01:27:56.000Z">2020-09-27</time><span class="level-item"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></span><span class="level-item">12 分钟 读完 (大约 1830 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/27/Music/%E4%B9%90%E7%90%86/">乐理知识</a></h1><div class="content"><p>根据 <a href="https://www.youtube.com/watch?v=H8564udAw7c&list=PLt6xeHPISLq6DlI7LkEnq9kzu9YGik8s4">doyoudo</a> 的教程整理的笔记</p>
<h2 id="第一节:节拍"><a href="#第一节:节拍" class="headerlink" title="第一节:节拍"></a>第一节:节拍</h2><ol>
<li>拍:描述音乐节奏的基本单位,一拍就是一次击打</li>
<li>速度:beat per minute 每分钟有多少拍</li>
<li>小节: 根据一定数量的拍就能确定一个小节</li>
<li>音符时值:每个音符占据一个小节的长度,占据全部长度的是全音符,占据1/2长度的是半音符,其他四分音符,八分音符则以此类推</li>
<li>4/4 节拍描述:分子表示,每小节拍的数量(四拍),分母表示每一拍的音符时值——以四分音符为一拍(为什么感觉上下描述的是一个意思/捂脸)<br><img src="/Pics/beat44.png" alt="4/4拍"></div><a class="article-more button is-small size-small" href="/2020/09/27/Music/%E4%B9%90%E7%90%86/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/16/CPP/%E4%BD%BF%E7%94%A8%E5%AD%97%E7%AC%A6%E4%B8%B2/"><img class="thumbnail" src="/gallery/cpp.png" alt="使用字符串"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-16T02:37:31.000Z" title="2020-09-16T02:37:31.000Z">2020-09-16</time><span class="level-item"><a class="link-muted" href="/categories/cpp/">cpp</a></span><span class="level-item">7 分钟 读完 (大约 1109 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/16/CPP/%E4%BD%BF%E7%94%A8%E5%AD%97%E7%AC%A6%E4%B8%B2/">使用字符串</a></h1><div class="content"><p>这一节,利用字符串读取和输出的程序,了解字符串的相关操作,常量,和变量的声明以及初始化等概念。</p>
<p>学习要点:</p>
<ol>
<li>变量和对象的区分</li>
<li>字符的基本操作和其他操作</li>
<li>缓存区刷新,运算符重载等</li>
</ol></div><a class="article-more button is-small size-small" href="/2020/09/16/CPP/%E4%BD%BF%E7%94%A8%E5%AD%97%E7%AC%A6%E4%B8%B2/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/BDL/"><img class="thumbnail" src="/gallery/BDL_TEASOR.png" alt="Bidirectional Learning for Domain Adaptation of Semantic Segmentation"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-15T07:27:42.000Z" title="2020-09-15T07:27:42.000Z">2020-09-15</time><span class="level-item"><a class="link-muted" href="/categories/%E9%A2%86%E5%9F%9F%E8%87%AA%E9%80%82%E5%BA%94/">领域自适应</a></span><span class="level-item">6 分钟 读完 (大约 909 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/BDL/">Bidirectional Learning for Domain Adaptation of Semantic Segmentation</a></h1><div class="content"><h2 id="主要思想"><a href="#主要思想" class="headerlink" title="主要思想"></a>主要思想</h2><p>在图像变换和分割网络中融入perception loss 来减少不同特征对分割网络的影响,随后使用双向学习和自监督学习提升网络的泛化能力,并使得两阶段网络不断互相促进。<br>其中双向学习使得图像变换网络和分割网络不断迭代更新,相互促进优化,自监督学习使用分类器输出结果给目标域图片分配伪标签来约束分割网络</p>
<p><img src="/Pics/BDL_net.png" alt="网络结构"><br></div><a class="article-more button is-small size-small" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/BDL/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/CAG_UDA/"><img class="thumbnail" src="/gallery/CAG_TEASOR.png" alt="CAG_UDA"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-15T01:34:11.000Z" title="2020-09-15T01:34:11.000Z">2020-09-15</time><span class="level-item"><a class="link-muted" href="/categories/%E9%A2%86%E5%9F%9F%E8%87%AA%E9%80%82%E5%BA%94/">领域自适应</a></span><span class="level-item">10 分钟 读完 (大约 1565 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/CAG_UDA/">CAG_UDA</a></h1><div class="content"><h2 id="Category-Anchor-Guided-Unsupervised-Domain-Adaptation-for-Semantic-Segmentation"><a href="#Category-Anchor-Guided-Unsupervised-Domain-Adaptation-for-Semantic-Segmentation" class="headerlink" title="Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation"></a>Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation</h2><h3 id="中心思想:"><a href="#中心思想:" class="headerlink" title="中心思想:"></a>中心思想:</h3><p>核心思想为基于源域类别 Anchor 的分布对齐,实现两个域之间类内距离减小,类间距离增大的目的,更加利于生成分界面,同时使用对目标与分配伪标签的方式促使分界面不从数据中心穿过,也减少分类器对源域的偏爱。</p>
<ol>
<li>类别层次的特征对齐:基于源域和目标域相同类别的特征向量在特征空间中距离较近的假设,把源域的每个类别上计算类别的平均值当成是类别中心,并促使源域的同一类别特征向量和目标域的激活特征向量向类别中心靠拢。</li>
<li>提升模型泛化能力:基于源域 Anchor 给激活的目标域特征分配伪标签,分类器使用伪标签进行训练,促使分类边界也根据目标域的标签进行相应的调整。</div><a class="article-more button is-small size-small" href="/2020/09/15/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/CAG_UDA/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/12/CPP/%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0cpp/"><img class="thumbnail" src="/gallery/cpp.png" alt="开始学习C++"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-12T08:15:01.000Z" title="2020-09-12T08:15:01.000Z">2020-09-12</time><span class="level-item"><a class="link-muted" href="/categories/cpp/">cpp</a></span><span class="level-item">5 分钟 读完 (大约 761 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/12/CPP/%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0cpp/">开始学习C++</a></h1><div class="content"><p>本章开始,通过阅读《Accelerated C++》开始记录笔记并学习<br>学习要点:</p>
<ol>
<li>标准库和其代表的名字空间</li>
<li>表达式:被操作数和运算符组成了一个表达式,其中运算符有左结合/右结合的性质,被操作数则是由其类型决定表达式的结果</li>
<li>作用域:学习了两种作用域的生成方式,分别是花括号和名字空间</li>
</ol>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string"><iostream></span></span></span><br><span class="line"></span><br><span class="line"><span class="comment">//这是一个简单的cpp程序</span></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>{</span><br><span class="line"> <span class="built_in">std</span>::<span class="built_in">cout</span> << <span class="string">"Hello, World!"</span> <<<span class="built_in">std</span>::<span class="built_in">endl</span>;</span><br><span class="line"> <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<p>在这个简单的程序中,我们将学习到表达式,作用域,运算符,作用数等一系列的概念</p>
<h2 id="1-注释:"><a href="#1-注释:" class="headerlink" title="1. 注释:"></a>1. 注释:</h2><p>可以使用 // 进行单行注释,也可以使用/<em> </em>/ 来进行多行注释(每次跨行需要行首加上 * ),当使用// 时,其优先级会高于多行注释</p>
<h2 id="2-include:"><a href="#2-include:" class="headerlink" title="2. include:"></a>2. include:</h2><p>使用 include 语句来包含不属于<strong>语言核心</strong>的<strong>标准库</strong>来增加对额外的指出<br></div><a class="article-more button is-small size-small" href="/2020/09/12/CPP/%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0cpp/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/09/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/"><img class="thumbnail" src="/gallery/senet.png" alt="注意力机制"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-09T09:29:55.000Z" title="2020-09-09T09:29:55.000Z">2020-09-09</time><span class="level-item"><a class="link-muted" href="/categories/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/">深度学习</a></span><span class="level-item">6 分钟 读完 (大约 877 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/09/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/">注意力机制</a></h1><div class="content"><h2 id="1-简介"><a href="#1-简介" class="headerlink" title="1. 简介"></a>1. 简介</h2><h2 id="2-SEnet-Squeeze-excitation-network"><a href="#2-SEnet-Squeeze-excitation-network" class="headerlink" title="2. SEnet (Squeeze-excitation network)"></a>2. SEnet (Squeeze-excitation network)</h2><h2 id="3-SKNET-CBAM-等"><a href="#3-SKNET-CBAM-等" class="headerlink" title="3. SKNET, CBAM 等"></a>3. SKNET, CBAM 等</h2><h2 id="1-简介-1"><a href="#1-简介-1" class="headerlink" title="1. 简介"></a>1. 简介</h2><p>定义:通过一定方式使得学习过程中仅仅关注部分信息的的手段都可以称作注意力机制,其可以让网络仅仅关注某些有用的信息,获取了关键信息就可以使用更加少的参数获得更加好的效果。</p></div><a class="article-more button is-small size-small" href="/2020/09/09/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/#more">阅读更多</a></article></div><div class="card"><div class="card-image"><a class="image is-7by3" href="/2020/09/09/%E6%89%80%E8%A7%81%E6%89%80%E9%97%BB/post/"><img class="thumbnail" src="/gallery/test.png" alt="见闻"></a></div><article class="card-content article" role="article"><div class="article-meta size-small is-uppercase level is-mobile"><div class="level-left"><time class="level-item" dateTime="2020-09-09T08:33:24.000Z" title="2020-09-09T08:33:24.000Z">2020-09-09</time><span class="level-item"><a class="link-muted" href="/categories/%E8%A7%81%E9%97%BB/">见闻</a></span><span class="level-item">几秒 读完 (大约 0 个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2020/09/09/%E6%89%80%E8%A7%81%E6%89%80%E9%97%BB/post/">见闻</a></h1><div class="content"></div></article></div><nav class="pagination is-centered mt-4" role="navigation" aria-label="pagination"><div class="pagination-previous is-invisible is-hidden-mobile"><a href="/page/0/">上一页</a></div><div class="pagination-next"><a href="/page/2/">下一页</a></div><ul class="pagination-list is-hidden-mobile"><li><a class="pagination-link is-current" href="/">1</a></li><li><a class="pagination-link" href="/page/2/">2</a></li></ul></nav></div><div class="column column-left is-4-tablet is-4-desktop is-4-widescreen order-1"><div class="card widget"><div class="card-content"><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div><figure class="image is-128x128 mx-auto mb-2"><img class="is-rounded" src="/img/avatar_new.jpg" alt="Daisy"></figure><p class="title is-size-4 is-block line-height-inherit">Daisy</p><p class="is-size-6 is-block">计算机视觉研究</p><p class="is-size-6 is-flex justify-content-center"><i class="fas fa-map-marker-alt mr-1"></i><span>地球, 银河系</span></p></div></div></nav><nav class="level is-mobile"><div class="level-item has-text-centered is-marginless"><div><p class="heading">文章</p><a href="/archives"><p class="title">13</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">分类</p><a href="/categories"><p class="title">7</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">标签</p><a href="/tags"><p class="title">10</p></a></div></div></nav><div class="level"><a class="level-item button is-primary is-rounded" href="https://github.com/shiyutang" target="_blank" rel="noopener">关注我</a></div><div class="level is-mobile"><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="Email" href="/shiyu00daisy@gmail.com"><i class="fab fa-envelope-square"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="Notion" href="https://www.notion.so/shiyu00daisy/20b9186805954f9fb5c7560b73147c74"><i class="fab book"></i></a></div></div></div><!--!--><div class="card widget"><div class="card-content"><div class="menu"><h3 class="menu-label">分类</h3><ul class="menu-list"><li><a class="level is-mobile is-marginless" href="/categories/cpp/"><span class="level-start"><span class="level-item">cpp</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E6%80%9D%E8%80%83/"><span class="level-start"><span class="level-item">思考</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"><span class="level-start"><span class="level-item">机器学习</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/"><span class="level-start"><span class="level-item">深度学习</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E8%A7%81%E9%97%BB/"><span class="level-start"><span class="level-item">见闻</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E9%9F%B3%E4%B9%90/"><span class="level-start"><span class="level-item">音乐</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li><li><a class="level is-mobile is-marginless" href="/categories/%E9%A2%86%E5%9F%9F%E8%87%AA%E9%80%82%E5%BA%94/"><span class="level-start"><span class="level-item">领域自适应</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li></ul></div></div></div><div class="card widget"><div class="card-content"><h3 class="menu-label">最新文章</h3><article class="media"><a class="media-left" href="/2020/10/13/CPP/%E5%BE%AA%E7%8E%AF%E5%92%8C%E8%AE%A1%E6%95%B0/"><p class="image is-64x64"><img class="thumbnail" src="/gallery/cpp.png" alt="循环和计数"></p></a><div class="media-content size-small"><p><time dateTime="2020-10-13T08:45:21.000Z">2020-10-13</time></p><p class="title is-6"><a class="link-muted" href="/2020/10/13/CPP/%E5%BE%AA%E7%8E%AF%E5%92%8C%E8%AE%A1%E6%95%B0/">循环和计数</a></p><p class="is-uppercase"><a class="link-muted" href="/categories/cpp/">cpp</a></p></div></article><article class="media"><a class="media-left" href="/2020/09/27/Music/%E5%BC%B9%E7%90%B4/"><p class="image is-64x64"><img class="thumbnail" src="/gallery/pianosit.png" alt="弹琴姿势"></p></a><div class="media-content size-small"><p><time dateTime="2020-09-27T11:30:15.000Z">2020-09-27</time></p><p class="title is-6"><a class="link-muted" href="/2020/09/27/Music/%E5%BC%B9%E7%90%B4/">弹琴姿势</a></p><p class="is-uppercase"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></p></div></article><article class="media"><a class="media-left" href="/2020/09/27/Music/%E4%BA%94%E7%BA%BF%E8%B0%B1/"><p class="image is-64x64"><img class="thumbnail" src="/gallery/beat.png" alt="五线谱"></p></a><div class="media-content size-small"><p><time dateTime="2020-09-27T06:31:29.000Z">2020-09-27</time></p><p class="title is-6"><a class="link-muted" href="/2020/09/27/Music/%E4%BA%94%E7%BA%BF%E8%B0%B1/">五线谱</a></p><p class="is-uppercase"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></p></div></article><article class="media"><a class="media-left" href="/2020/09/27/Music/%E4%B9%90%E7%90%86/"><p class="image is-64x64"><img class="thumbnail" src="/gallery/beat.png" alt="乐理知识"></p></a><div class="media-content size-small"><p><time dateTime="2020-09-27T01:27:56.000Z">2020-09-27</time></p><p class="title is-6"><a class="link-muted" href="/2020/09/27/Music/%E4%B9%90%E7%90%86/">乐理知识</a></p><p class="is-uppercase"><a class="link-muted" href="/categories/%E9%9F%B3%E4%B9%90/">音乐</a></p></div></article><article class="media"><a class="media-left" href="/2020/09/16/CPP/%E4%BD%BF%E7%94%A8%E5%AD%97%E7%AC%A6%E4%B8%B2/"><p class="image is-64x64"><img class="thumbnail" src="/gallery/cpp.png" alt="使用字符串"></p></a><div class="media-content size-small"><p><time dateTime="2020-09-16T02:37:31.000Z">2020-09-16</time></p><p class="title is-6"><a class="link-muted" href="/2020/09/16/CPP/%E4%BD%BF%E7%94%A8%E5%AD%97%E7%AC%A6%E4%B8%B2/">使用字符串</a></p><p class="is-uppercase"><a class="link-muted" href="/categories/cpp/">cpp</a></p></div></article></div></div><div class="card widget"><div class="card-content"><div class="menu"><h3 class="menu-label">标签</h3><div class="field is-grouped is-grouped-multiline"><div class="control"><a class="tags has-addons" href="/tags/%E4%B9%90%E7%90%86/"><span class="tag">乐理</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E4%BA%94%E7%BA%BF%E8%B0%B1/"><span class="tag">五线谱</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E5%AD%97%E7%AC%A6%E4%B8%B2/"><span class="tag">字符串</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E5%BE%AA%E7%8E%AF%E5%92%8C%E8%AE%A1%E6%95%B0/"><span class="tag">循环和计数</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%98%E6%B3%95/"><span class="tag">最小二乘法</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/"><span class="tag">注意力机制</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E7%BB%BC%E8%BF%B0/"><span class="tag">综述</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E8%A1%A8%E8%BE%BE%E5%BC%8F/"><span class="tag">表达式</span><span class="tag is-grey-lightest">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E8%AE%BA%E6%96%87%E9%98%85%E8%AF%BB/"><span class="tag">论文阅读</span><span class="tag is-grey-lightest">2</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E9%94%AE%E7%9B%98/"><span class="tag">键盘</span><span class="tag is-grey-lightest">1</span></a></div></div></div></div></div></div><!--!--></div></div></section><footer class="footer"><div class="container"><div class="level"><div class="level-start"><a class="footer-logo is-block mb-2" href="/"><img src="/img/Digital.png" alt="Digital Shiyu" height="28"></a><p class="size-small"><span>© 2020 shiyu AllRightsReserved</span> Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a><br><span id="busuanzi_container_site_uv">共<span id="busuanzi_value_site_uv">0</span>个访客</span></p></div><div class="level-end"></div></div></div></footer><script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script><script>moment.locale("zh-CN");</script><script>var IcarusThemeSettings = {
site: {
url: 'http://yoursite.com',
external_link: {"enable":true,"exclude":[]}
},
article: {
highlight: {
clipboard: true,
fold: 'unfolded'
}
}
};</script><script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script><a id="back-to-top" title="回到顶端" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script src="/js/back_to_top.js" defer></script><!--!--><!--!--><!--!--><script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script><script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load", () => {
if (typeof $.fn.lightGallery === 'function') {
$('.article').lightGallery({ selector: '.gallery-item' });
}
if (typeof $.fn.justifiedGallery === 'function') {
if ($('.justified-gallery > p > .gallery-item').length) {
$('.justified-gallery > p > .gallery-item').unwrap();
}
$('.justified-gallery').justifiedGallery();
}
});</script><!--!--><!--!--><script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script><script>window.addEventListener("load", function () {
MathJax.Hub.Config({
'HTML-CSS': {
matchFontHeight: false
},
SVG: {
matchFontHeight: false
},
CommonHTML: {
matchFontHeight: false
},
tex2jax: {
inlineMath: [
['$','$'],
['\\(','\\)']
]
}
});
});</script><!--!--><script src="/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="想要查找什么..."></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script src="/js/insight.js" defer></script><script>document.addEventListener('DOMContentLoaded', function () {
loadInsight({"contentUrl":"/content.json"}, {"hint":"想要查找什么...","untitled":"(无标题)","posts":"文章","pages":"页面","categories":"分类","tags":"标签"});
});</script></body></html>