<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>✨shining_arrow🏹.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Sat, 16 Jul 2022 17:10:44 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>✨shining_arrow🏹.log</title>
            <url>https://images.velog.io/images/shining_arrow/profile/8ad45dd6-9480-4910-8617-469dc7328649/미모티콘.jpg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. ✨shining_arrow🏹.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/shining_arrow" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[YOLOv5 모델 사용하기]]></title>
            <link>https://velog.io/@shining_arrow/YOLOv5-%EB%AA%A8%EB%8D%B8-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@shining_arrow/YOLOv5-%EB%AA%A8%EB%8D%B8-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0</guid>
            <pubDate>Sat, 16 Jul 2022 17:10:44 GMT</pubDate>
            <description><![CDATA[<p>Google Colab에서 YOLOv5모델을 실행해보겠습니다.</p>
<h3 id="준비-사항">준비 사항</h3>
<p>먼저 조건에 맞는 pytorch 버전을 설치합니다.</p>
<pre><code class="language-python">!pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113</code></pre>
<p>그리고 git clone을 해줍니다. 레포지토리 및 YOLOv5모델에 대한 설명은 [파이토치허브] (<a href="https://pytorch.kr/hub/ultralytics_yolov5/)%EC%97%90%EC%84%9C">https://pytorch.kr/hub/ultralytics_yolov5/)에서</a> 확인할 수 있습니다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/4860629c-9335-4016-bdc4-17c7bc0f05b9/image.png" alt=""></p>
<pre><code>!git clone https://github.com/ultralytics/yolov5</code></pre><p>requirements를 깔아줍니다.</p>
<pre><code class="language-python">!cd yolov5
!pip install -r requirements.txt</code></pre>
<p>dependency를 설치합니다.</p>
<pre><code class="language-python">#install dependencies
import torch 
from matplotlib import pyplot as plt
import numpy as np
import cv2</code></pre>
<h3 id="모델-불러오기">모델 불러오기</h3>
<p>이제 파이토치 허브에 있는 YOLOv5모델을 불러옵니다.</p>
<pre><code class="language-python">model = torch.hub.load(&#39;ultralytics/yolov5&#39;, &#39;yolov5s&#39;)</code></pre>
<p>다음과 같이 입력하면 모델 안의 layer의 구성을 확인할 수 있습니다.</p>
<pre><code class="language-python">model</code></pre>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/0f492a07-3e60-416e-a4af-0721378c1cf2/image.png" alt=""></p>
<h3 id="모델-적용하기">모델 적용하기</h3>
<p>먼저 공식 문서에 있는 사진(img)을 모델에 적용해보겠습니다. </p>
<pre><code class="language-python">img = &quot;https://ultralytics.com/images/zidane.jpg&quot;
results = model(img)
results.print()</code></pre>
<p>실행한 결과 다음과 같이 이미지의 크기, 인식한 객체의 종류와 개수 등이 출력된 것을 확인할 수 있습니다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/8f6f38af-2a73-4868-801d-9c6b13907a8b/image.png" alt="">
이제 이미지를 랜더링한 후 출력합니다. 출력된 이미지 결과를 보면 위에 results.print()에서 출력된 것처럼 사람 2명, 넥타이 2개가 인식된 것을 확인할 수 있습니다.</p>
<pre><code class="language-python">%matplotlib inline
plt.imshow(np.squeeze(results.render()))  
plt.show()</code></pre>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/ed0ac4cd-4242-488e-a0bc-6a0d83c0d18e/image.png" alt=""></p>
<p>이제 로컬 파일에 있는 이미지를 모델에 적용해보겠습니다.</p>
<pre><code class="language-python">from google.colab import files
uploaded = files.upload()</code></pre>
<p>업로드한 사진을 이전과 동일한 방법으로 모델에 적용한 후 결과를 출력하면 인식된 객체의 종류와 개수를 확인할 수 있습니다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/28b31371-aa87-4b33-9776-11c32df76b94/image.png" alt="">
인식할 사물이 많은 사진을 찾다가 이 사진을 적용해봤는데, 포크와 나이프가 여러 각도로 배치되었고 맨 앞 사람은 얼굴의 반만 나왔는데도 대부분 맞게 인식되었습니다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/3660461e-58d1-4b83-8296-cfd06d5b2b2d/image.png" width=70%></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[8. Data Management]]></title>
            <link>https://velog.io/@shining_arrow/8.-Data-Management</link>
            <guid>https://velog.io/@shining_arrow/8.-Data-Management</guid>
            <pubDate>Tue, 28 Jun 2022 14:59:23 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/shining_arrow/post/b81b1224-6103-46b0-85f3-fc6728bd6b1c/image.png" alt=""></p>
<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h3 id="common-data-management-path-for-deep-learning">Common Data Management Path for Deep Learning</h3>
<ul>
<li><p>딥러닝 과정 중에는 가지고 있는 데이터를 GPU 옆의 local filesystem에 옮기는 작업이 필요하다. 데이터를 train가능한 형태로 옮기는 방법은 프로젝트나 회사마다 다르다. 예를 들면:</p>
<ul>
<li><p>train your images on ImageNet, and all the images are just S3 URLs -&gt; simply download them over to the local filesystem.</p>
</li>
<li><p>a bunch of text files -&gt; use Spark to process them on a cluster and Pandas data frame to analyze/select subsets that will be used in the local filesystem.</p>
</li>
<li><p>collect logs and records from your database into a data lake/warehouse (like Snowflake) -&gt; process that output and convert them into a trainable format.</p>
</li>
</ul>
</li>
<li><p>Key Points in Data Management</p>
<ul>
<li><strong>Let the Data flow through you</strong><ul>
<li>Spend a lot of time exploring the dataset.</li>
</ul>
</li>
<li><strong>Data is the best way to improve your overall ML project</strong><ul>
<li>adding more data &amp; augumenting the existing dataset is better than trying new architectures.</li>
</ul>
</li>
<li><strong>Keep it Simple Stupid</strong><ul>
<li>Do not over-complicate things!
#<h3 id="data-sources">Data Sources</h3>
</li>
</ul>
</li>
</ul>
</li>
<li><p>Where do the training data come from?</p>
<ul>
<li>대부분의 딥러닝 프로젝트에서 labeled data를 요구함.</li>
<li>(예외: 강화학습, GANs, GPT-3)</li>
<li>이미 publicly labeled된 dataset을 사용할 수도 있겠지만 이를 딱히 경쟁력있는 단점은 없음.</li>
<li>그래서 많은 회사들이 자신이 가진 데이터를 labeling하는 데 많은 시간과 돈을 투자함.</li>
</ul>
</li>
<li><p><strong>Data Flywheel</strong></p>
<ul>
<li>user들을 label과정에 참여시킴. </li>
<li>if you can get your models in front of the users, you can build your products in a mechanism that your users contribute good data back to you and improve the model predictions.</li>
</ul>
</li>
<li><p><strong>Semi-Supervised Learning</strong></p>
<ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/e8e54ad1-4d23-4439-9d00-e813b37dffb3/image.png" alt=""></li>
<li>data의 일부를 가지고 automatically label.</li>
<li>online fashion(처음부터 사람이 아예 개입하지 않고 데이터 labeling 진행 가능)<ul>
<li>text</li>
<li>SEER<ul>
<li>Vision에 적용한 Semi-Supervised Learning</li>
<li>by FacebookAI</li>
<li>Trained on 1B random images</li>
<li>Open Source library</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p>Image Data Augmentation</p>
<ul>
<li>Must do for training vision models</li>
<li>Frameworks에서 augmentation을 제공함.(e.g.torchvision)</li>
<li>Done in parallel to GPU training on the CPU</li>
</ul>
</li>
<li><p>Other data augmentation</p>
<ul>
<li>Tabular<ul>
<li>Delete some cells to simulate missing data</li>
</ul>
</li>
<li>Text<ul>
<li>replace words or order of things(but not well established)</li>
</ul>
</li>
<li>Speech/Video<ul>
<li>crop out parts, shrink/grow the timeline, inject noise, mask at different frequencies</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="data-storage">Data Storage</h3>
<ul>
<li>Filesystem<ul>
<li>Foundational layer of stroage.</li>
<li>Fundamental unit is a &quot;file&quot;.(can be text or binary)</li>
<li>Can be:<ul>
<li>locally mounted</li>
<li>networked</li>
<li>distributed</li>
</ul>
</li>
<li>Fastest option when it comes to storage</li>
</ul>
</li>
<li>Local Data Format<ul>
<li>binary data: just files</li>
<li>large tabular/text data: <ul>
<li>HDF5(powerful but bloated and declining)</li>
<li>Parquet(widespread and recommended)</li>
<li>Feather(powered by Apache Arrow, up-and-coming)</li>
</ul>
</li>
<li>Try to use native Tensorflow and PyTorch dataset classes</li>
</ul>
</li>
<li>Object Storage<ul>
<li>An API over the filesystem</li>
<li>GET PUT DELETE files to a service w/o worrying where tey are stored</li>
</ul>
</li>
<li>Database<ul>
<li>Online Transaction Processing(OLTP)</li>
<li>Everything is actually in RAM, but software ensures that everything is logged to disk and never lost.</li>
<li>Not for binary data!(store references instead)</li>
<li>Postgress is a nice choice. Supports unstructured JSON.<ul>
<li>SQLite is perfect for small projects.</li>
</ul>
</li>
<li>Avoid NoSQL</li>
</ul>
</li>
<li>SQL and DataFrames<ul>
<li>Most data solutions use SQL. Some(like Databricks) use DataFrames.</li>
<li>SQL is the standard interface for structured data.</li>
<li>Pandas is the main DataFrame in the Python ecosystem.</li>
<li>advice: be fluent in BOTH</li>
</ul>
</li>
<li>Data Lake<ul>
<li>Unstructured aggregation of data from multiple sources</li>
<li>ELT: dump everything in, then transform for specific need later.<h3 id="data-processing">Data Processing</h3>
</li>
</ul>
</li>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/f671a807-9415-4370-b06f-085e26e4f9de/image.png" alt=""></li>
</ul>
<h3 id="feature-stores">Feature Stores</h3>
<ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/a036ccc7-dd6e-46d5-b770-1bada0bdfab4/image.png" alt=""></li>
</ul>
<h3 id="data-labeling">Data Labeling</h3>
<h4 id="user-interfaces">User interfaces</h4>
<ul>
<li>Standard set of features<ul>
<li>bounding boxes, segmentations, keypoints, cuboids</li>
<li>a set of applicable classes</li>
</ul>
</li>
<li>Training annotators is crucial<ul>
<li>And quality assurance is key!</li>
</ul>
</li>
</ul>
<h4 id="sources-of-labor">Sources of labor</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/2182932e-dc0e-41ee-a23c-074f6e86cd51/image.png" alt=""></p>
<h4 id="service-companies">Service companies</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/3993dca8-f276-4f8d-993f-f41307d4c548/image.png" alt="">
    -    FigureEight
    -    Scale.ai 
    -    Labelbox, etc.</p>
<h3 id="data-versioning">Data Versioning</h3>
<h4 id="level0-unversioned">Level0: unversioned</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/7e9259d5-c544-4c85-85fc-43d0b427f5ee/image.png" alt=""></p>
<h4 id="level1-versioned-via-snapshot-at-training-time">Level1: versioned via snapshot at training time</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/66713514-a2c4-4f1a-8fc2-75d952ef76e8/image.png" alt=""></p>
<h4 id="level2-versioend-as-a-mix-of-assets-and-code">Level2: versioend as a mix of assets and code</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/fa41e1fc-fb16-4db7-9ce2-3f45d31b9050/image.png" alt=""></p>
<h4 id="level3-specialized-data-versioning-solution">Level3: specialized data versioning solution</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/28000df5-ccfe-42cc-a7eb-7e9129360c38/image.png" alt=""></p>
<ul>
<li><strong>DVC</strong>: Open-sources version control system for ML learning projects<ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/70062eec-21b3-4a46-afab-60610aa3091e/image.png" alt=""></li>
</ul>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[Database]]></title>
            <link>https://velog.io/@shining_arrow/Database</link>
            <guid>https://velog.io/@shining_arrow/Database</guid>
            <pubDate>Wed, 22 Jun 2022 16:42:17 GMT</pubDate>
            <description><![CDATA[<h3 id="database란">Database란?</h3>
<ul>
<li>컴퓨터 파일 시스템에서 관련 있는 데이터들끼리 모아놓은 것</li>
<li>통상적으로 DBMS(Database Management System)를 Database라고 일컫는다.<ul>
<li>DBMS: 데이터를 더 효과적으로 관리할 수 있는 시스템(DB관리 엔진)</li>
<li>많이 쓰이는 DBMS: Oracle, MySQL, DynamoDB, PostgreSQL, mongoDB</li>
</ul>
</li>
<li>특징<ul>
<li>데이터를 저장하고 읽어오는 데 최적화됨.</li>
<li>복잡한 데이터를 다룰 수 있음.</li>
<li>안전하게 동시다발적으로 접근할 수 있음.</li>
<li>보안이 뛰어나다.</li>
<li>파일 시스템에 비해 복잡하다.</li>
</ul>
</li>
<li>DBMS의 두가지 종류<ul>
<li><strong>SQL(Structured Query Language)</strong><ul>
<li>관계형(Relational) DBMS임.</li>
<li>관련 있는 데이터들을 table로 만들어 두고 이들의 관계를 정의할 수 있다.</li>
</ul>
</li>
<li><strong>NoSQL</strong><ul>
<li>SQL이 아닌 모든 것을 가리킴.</li>
<li>관계가 없는 데이터베이스를 말함.</li>
<li>Key-Value, Document, Wide-column, Graph 등 여러가지 데이터베이스 타입이 존재함.</li>
</ul>
</li>
<li>SQL과 NoSQL의 장단점 및 차이점을 알아서 어떤 것을 사용하면 좋을지 잘 판단해야함.</li>
</ul>
</li>
</ul>
<p>#</p>
<h3 id="sql-database">SQL Database</h3>
<ul>
<li>Excel에서 흔히 데이터를 저장하는 방식과 비슷함.</li>
<li>행과 열로 이뤄진 table사용, 여러가지 종류의 table존재</li>
<li>행마다 특정 data type을 지정해야 한다.</li>
<li>모든 요소가 다 정의된 한 줄의 데이터를 <strong>record</strong>라고 한다.</li>
<li>Schema를 정의함으로서 data integrity를 지킬 수 있다.</li>
<li><strong>primary key</strong>: table에서 정말 중요한 식별자가 id 정보를 담음.<ul>
<li>primary key를 바탕으로 검색의 최적화가 이루어짐.</li>
</ul>
</li>
<li><strong>foreign key</strong>: 두 개의 서로 다른 key의 관계를 정의해줌.
#<h3 id="sql-query의-기본-구조">SQL Query의 기본 구조</h3>
</li>
<li>세 가지 주요 명령어: SELECT, FROM, WHERE</li>
<li><strong>SELECT</strong>: table에서 어떤 행을 선택할 건지 결정<ul>
<li>ex) SELECT *: 유저가 가진 모든 행에 대한 데이터를 가져옴.</li>
</ul>
</li>
<li><strong>FROM</strong>: 어떤 table에서 데이터를 가져올 건지 결정<ul>
<li>ex) SELECT Name FROM User: User테이블의 Name에 대한 데이터를 가져옴.</li>
</ul>
</li>
<li><strong>WHERE</strong>: 조건을 걸 때 사용</li>
<li>예시</li>
</ul>
<pre><code class="language-node.js">SELECT *FROM Users WHERE name LIKE &#39;%Bob%&#39;;
</code></pre>
<p>[Users]</p>
<table>
<thead>
<tr>
<th align="center">id</th>
<th align="center">name</th>
<th align="center">email</th>
<th align="center">age</th>
</tr>
</thead>
<tbody><tr>
<td align="center">1</td>
<td align="center">Yoon</td>
<td align="center"><a href="mailto:yoon@song.com">yoon@song.com</a></td>
<td align="center">18</td>
</tr>
<tr>
<td align="center">2</td>
<td align="center">Bob</td>
<td align="center"><a href="mailto:bob@example.com">bob@example.com</a></td>
<td align="center">45</td>
</tr>
<tr>
<td align="center">3</td>
<td align="center">Ashley</td>
<td align="center"><a href="mailto:ashley@air.io">ashley@air.io</a></td>
<td align="center">23</td>
</tr>
</tbody></table>
<blockquote>
<p>Users라는 table의 모든 행을 선택하되 이름이 Bob인 행을 찾아달라는 의미이다.</p>
</blockquote>
<ul>
<li>유명한 SQL Database: Oracle, <strong>SQLite</strong>(핸드폰이나 임베디드 시스템에서 자주 사용), SQLServer, <strong>MySQL</strong>(보편적), <strong>PostgreSQL</strong>(최근 but 약간 복잡)</li>
</ul>
<p>#</p>
<h3 id="nosql">NoSQL</h3>
<ul>
<li><p>Why NoSQL?</p>
<ul>
<li>빅데이터가 뜨기 시작하면서..</li>
</ul>
</li>
<li><p>특징</p>
<ul>
<li>Schema가 없다.</li>
<li>관계형이 아니다. 데이터들이 서로 관계가 없으므로 고립된 형태로 분산해서 여러 서버에 나눠 관리할 수 있다.</li>
<li>특수 문제 해결을 위해 사용됨.</li>
<li>Key-Value, Document, Wide-Column, Graph 등의 type이 존재.</li>
</ul>
</li>
<li><p>Web상에서 가장 많이 사용되는 mongoDB</p>
<ul>
<li>document database(document로 데이터 관리-&gt;json형태로)</li>
<li><strong>collection</strong>을 사용해 데이터가 정리됨. collection들은 개별적으로 관리(서로 다른 서버에 보관)하는 것이 가능하다.</li>
<li>데이터 간의 관계를 설정하지 x. 차라리 중복해서 사용함.</li>
<li>데이터베이스에서는 어떤 정보가 정확한 지 알 수 없으므로 개발자가 스스로 컬렉션을 잘 관리해야 함.</li>
</ul>
</li>
<li><p>유명한 NoSQL Database: cassandra(Wide Column), Cloud Bigtable(Wide Column), neo4j(Graph), Redis(Key-Value), mongoDB(Document), DynamoDB(Key-Value)</p>
</li>
</ul>
<p>#</p>
<h3 id="orm과-odm">ORM과 ODM</h3>
<ul>
<li><p><strong>ORM(Object Relational Mapping)</strong></p>
<ul>
<li>원래는 코드 내의 Object들을 어떻게 데이터베이스의 Table로 변환할 건지, 어떻게 Schema를 만들건지 등을 직접 고민해야함.</li>
<li>ORM이란, 위 작업들을 자동으로 해주는 엔진 라이브러리. (DB추상화 도구)</li>
<li>사용방법<ul>
<li><ol>
<li>코드 상으로 schema정의 후 프로그램 실행</li>
</ol>
</li>
<li><ol start="2">
<li>자동으로 table생성해줌.</li>
</ol>
</li>
<li><ol start="3">
<li>자동으로 data를 table에 기록해줌.</li>
</ol>
</li>
</ul>
</li>
<li>장점<ul>
<li>DB query에 신경쓰지 않고 어플리케이션의 business logic에 집중할 수 있다.</li>
<li>boilerplate code를 줄일 수 있다.</li>
<li>추상화 level이 추가됨. </li>
<li>Schema가 변경된다면 자동으로 처리해주는 migration 지원.</li>
</ul>
</li>
<li>단점<ul>
<li>ORM API만으로는 복잡한 query를 할 수 없음.</li>
<li>느림. 메모리 최적화 x.</li>
</ul>
</li>
<li>자주 사용되는 ORM: TYPEORM, Sequelize, Prisma</li>
</ul>
</li>
<li><p><strong>ODM(Object Document Mapper)</strong></p>
<ul>
<li>mongoose, mongoDB 등이 존재</li>
<li>추상화 단계 추가됨.</li>
</ul>
</li>
</ul>
<h3 id="sql-vs-nosql">SQL vs. NoSQL</h3>
<table>
<thead>
<tr>
<th align="center"></th>
<th align="center">SQL</th>
<th align="center">NoSQL</th>
</tr>
</thead>
<tbody><tr>
<td align="center">시작 barrier</td>
<td align="center">보통</td>
<td align="center">쉬움</td>
</tr>
<tr>
<td align="center">데이터 구조</td>
<td align="center">고정됨(정적)</td>
<td align="center">유연함(동적)</td>
</tr>
<tr>
<td align="center">데이터 찾기</td>
<td align="center">쉬움</td>
<td align="center">쉬움</td>
</tr>
<tr>
<td align="center">연관된 데이터 연결</td>
<td align="center">쉬움</td>
<td align="center">어려움</td>
</tr>
<tr>
<td align="center">확장성</td>
<td align="center">어려움</td>
<td align="center">쉬움</td>
</tr>
<tr>
<td align="center">클라우드 운영 비용</td>
<td align="center">비쌈</td>
<td align="center">저렴</td>
</tr>
</tbody></table>
<ul>
<li>확장성<ul>
<li><strong>수직 확장</strong>: SQL은 서로 다른 table이 연관되었기 때문에 하나의 table을 다른 table에서 불러다 써야 하는 경우가 다수 존재함. 따라서 이 table들을 다른 server에 저장해 두는 것이 없음. 따라서 server를 수직적(CPU, RAM, DISC추가 등)으로 확장해야함.</li>
<li><strong>수평 확장</strong>: NoSQL은 table간의 관계성이 없으므로 여러 server에 데이터를 나눠서 저장할 수 있음. 따라서 여러 대의 server를 사용해 수평적으로 확장할 수 있음.</li>
</ul>
</li>
<li>SQL vs. NoSQL 무엇을 사용할지에 대한 판단 기준<ul>
<li><ol>
<li>어떤 data type을 저장할 것인가?</li>
</ol>
</li>
<li><ol start="2">
<li>얼마나 많은 사용자를 예상하는가?(데이터양)</li>
</ol>
</li>
<li>**3. 데이터들이 서로 관계가 있는가?</li>
<li>그치만 많은 기업들이 hybrid 형식을 사용(상황에 따라 SQL과 NoSQL 혼합 사용)</li>
</ul>
</li>
</ul>
<h3 id="mysql-실습">MySQL 실습</h3>
<ul>
<li><p>table 만들기
<img src="https://velog.velcdn.com/images/shining_arrow/post/74bbf76b-f1ee-4d1a-8a13-95fbfcdb8722/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/429df87b-2aa1-4b60-a659-84579b842cc0/image.png" alt=""></p>
</li>
<li><p>foreign key 만들기
<img src="https://velog.velcdn.com/images/shining_arrow/post/3a3928f1-3deb-4315-9282-6f789fd0165c/image.png" alt=""></p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[Validation , Authentication, Configuration]]></title>
            <link>https://velog.io/@shining_arrow/Validation-Authentication-Configuration</link>
            <guid>https://velog.io/@shining_arrow/Validation-Authentication-Configuration</guid>
            <pubDate>Sat, 04 Jun 2022 18:56:55 GMT</pubDate>
            <description><![CDATA[<h3 id="validation이란">Validation이란?</h3>
<ul>
<li>client가 server에게 특정한 요청을 보낼 때 body로 보내는 데이터들이 유효한지 확인하는 과정.</li>
<li>DB쪽에서 필요한 데이터가 모두 전달되었는지 확인할 수 있음. 하지만 db에서 유효성 검사를 할 때까지 기다리는 것은 별로임. server에서도 유효성 검사를 빨리 하면 할 수록 좋음(불필요한 비용을 줄일 수 있기 때문에)</li>
<li>client쪽에서도 client만의 유효성 검사를 할 수도 있음. (대부분의 경우 이것은 optional하기 때문에 server에서 반드시 validation을 해줘야 한다.)</li>
</ul>
<!--### 유효성 검사 방법
-    terminal창에서 npm i express-validator를 실행시킴.-->
<p>#</p>
<h3 id="authenication이란">Authenication이란?</h3>
<ul>
<li>Authenication(인증): you are who you say you are- 누구인지 식별<ul>
<li>password, pincode(what you know:알고 있는 것)</li>
<li>mobile phone, hardware token(what you have: 가지고 있는 것)</li>
<li>fingerprints, signature(what you are: 생체 정보나 자필 서명)</li>
</ul>
</li>
<li>HTTP는 stateless protocol(상태를 보관하고 있지 않음)임.<ul>
<li>그렇다면 AUTH는 어떻게 일어나는가?<ul>
<li>session + cookie</li>
<li>JWT
#</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="session">Session</h3>
<ul>
<li>사용자의 세션을 서버에서 보관.</li>
<li><ol>
<li>client가 서버에 로그인</li>
</ol>
</li>
<li><ol start="2">
<li>server는 db에 있는 사용자의 id, pw가 일치하는지 확인</li>
</ol>
</li>
<li><ol start="3">
<li>유효한 사용자라면 session을 만든다.(session id, user id, expiration정보 포함)</li>
</ol>
</li>
<li><ol start="4">
<li>session정보를 session이라는 별도의 database에 저장한다.(대부분의 경우)</li>
</ol>
</li>
<li><ol start="5">
<li>client에게 session과 관련된 정보를 쿠키에 담아 보내준다.</li>
</ol>
<ul>
<li>HTTP Only라는 옵션을 주게 되면 해당 쿠키는 브라우저에 의해서만 읽을 수 있다. js나 프로그램 내에서는 읽을 수 없고 브라우저 내에서만 읽어서 다시 서버에 보낼 수 있는 안전한 방법임.</li>
</ul>
</li>
<li>장점: <ul>
<li>session db에 모든 세션에 대한 정보를 보관하므로 신뢰할 수 있는 데이터임</li>
<li>쿠키를 사용하기 때문에 client측에서 별도의 처리를 하지 않아도 브라우저에서 simple하게 대신 함. </li>
<li>HTTPonly 옵션을 사용하므로 보안이 좋다. </li>
<li>cookie를 사용하므로 사용자 정보를 직접적으로 전달하지 않고 session id만 사용하므로 보안이 좋다.</li>
</ul>
</li>
<li>단점: <strong>Stateful</strong>. 한 세션에 정보를 보관하고 있으므로 여러 개의 서버들이 session에 대한 정보를 얻기 위해 하나의 서버에 접속한다. 이 때 네트워크 요청을 하는 과정에서 시간이 많이 걸릴 수 있다. 
#</li>
</ul>
<h3 id="jwt란">JWT란?</h3>
<ul>
<li>JSON Web Token<ul>
<li>JSON안의 header, payload, signature에 AUTH정보를 담고 있음.<ul>
<li>header: 사용하는 algorithm과 type</li>
<li>payload: 주고받고자 하는 data가 encoding된 형태로 저장</li>
<li>signature: encoding한 헤더와 payload부분, encoding할 때 사용한 서버의 비밀 키(<strong>secret</strong>)-&gt; 정보의 유효성을 지킬 수 있다.</li>
</ul>
</li>
</ul>
</li>
<li><ol>
<li>client가 서버에 로그인</li>
</ol>
</li>
<li><ol start="2">
<li>server는 db에 있는 사용자의 id, pw가 일치하는지 확인</li>
</ol>
</li>
<li><ol start="3">
<li>유효한 사용자라면 JWT를 만든다. </li>
</ol>
</li>
<li><ol start="4">
<li>JWT를 사용자에게 보낸다. </li>
</ol>
</li>
<li><ol start="5">
<li>추후에 발생하는 api요청에 대해 JWT를 헤더에 포함한 상태로 server에게 보낸다.</li>
</ol>
</li>
<li><ol start="6">
<li>Verify: server측에서 JWT가 수정되어있는지, 정보가 정확한지, 만료되지 않았는지 등 유효성 검사 실시</li>
</ol>
</li>
<li><ol start="7">
<li>해당 데이터를 client에게 보낸다.</li>
</ol>
</li>
<li>장점: server에 state가 없다. session을 사용할 때는 server에 session이라는 상태가 필요했음. 반면 JWT는 한번 JSON파일을 생성해 client에게 보내주고 다시 검증하는 과정만 거치면 되기 때문에 하나의 서버에 접속하는 과정이 필요 없다. 그냥 server들이 secret key만 가지고 있으면 됨. </li>
<li>단점: client와 server가 계속 JWT를 주고받기 때문에 보안에 취약할 수 있다.
#</li>
</ul>
<h3 id="bcrypt---패스워드-안전하게-보관하기">bcrypt - 패스워드 안전하게 보관하기</h3>
<ul>
<li>bcrypt: password-hashing function</li>
<li>사용자가 설정한 id와 pw를 암호화 알고리즘을 통해 hashing된 상태로 db에 저장.<ul>
<li>Alg정보/cost/salt/hash로 구성되어 있음</li>
<li>해킹 방지를 위해 salt사용(암호화를 더 복잡하게)</li>
</ul>
</li>
</ul>
<h3 id="configuration">Configuration</h3>
<ul>
<li>server code를 깃허브 등의 open source에 올릴 때 주의해야 할 사항<ul>
<li>secret key도 함께 올리면 사용자의 정보가 유출될 위험이 크다.</li>
<li>따라서 secret key관련 정보는 공개적으로 올리지 않는다. local에서만 가지고 있어야 함.(보통 따로 보관해놓음)</li>
</ul>
</li>
<li>server의 설정성/유연성<ul>
<li>salt나 expire에 관한 정보가 코드에 들어 있어서 개발자가 관련 정보를 고치고 싶다면 코드를 고친 후 컴파일해서 다시 배포해야 한다. -&gt; 설정성이 떨어짐+시간이 오래 걸림.</li>
<li>따라서 코드를 변경하지 않고도 설정값을 바꿀 수 있게 해야 한다.</li>
</ul>
</li>
</ul>
<!---    Dwitter는 jwt를 사용해 auth설정.
-    이유:
    -    1. Dwitter서버는 RESTful API를 사용하기 때문.
    -    2. 서비스의 확장성을 위해
    -    3. jwt를 사용하면 서버의 확장이 편리하기 때문-->


<h3 id="socket">Socket</h3>
<ul>
<li>기존의 HTTP는 request와 response로 이루어짐. client가 요청을 해야만 server가 대답할 수 있는 상태.</li>
<li>반면에 socket에서는 client와 server가 연결되어 있기만 하다면 server에 변동사항이 생겼을 때 이를 client의 request 없이도 보내줄 수 있다.(원할 때마다 전송 가능)</li>
<li>client와 server용 socket.io를 각각 설치해 연결한다. </li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[6. MLOps Infrastructure & Tooling]]></title>
            <link>https://velog.io/@shining_arrow/6.-MLOps-Infrastructure-Tooling</link>
            <guid>https://velog.io/@shining_arrow/6.-MLOps-Infrastructure-Tooling</guid>
            <pubDate>Tue, 31 May 2022 11:03:58 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/shining_arrow/post/bd72c9fb-f762-4919-b092-1f9e0eba8ffa/image.png" alt=""></p>
<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h3 id="📌3-buckets-of-ml-infrastructure--tooling-landscape">📌3 Buckets of ML Infrastructure &amp; Tooling Landscape</h3>
<p> <img src="https://velog.velcdn.com/images/shining_arrow/post/5b4dd968-87d5-43a7-81a8-d2a8799a5c37/image.png" alt=""></p>
<ul>
<li>** Data**</li>
</ul>
<pre><code>-    Sources
-    Data Lake/Warehouse
-    Processing
-    Exploration
-    Versioning
-    Labeling</code></pre><ul>
<li><strong>Training/Evaluation</strong></li>
</ul>
<pre><code>-     Compute
-    Resource Management
-    Software Engineering
-    Frameworks &amp; Distributed Training
-    Experiment Management
-    Hyperparameter Tuning</code></pre><ul>
<li><strong>Deployment</strong></li>
</ul>
<pre><code>-    CI/Testing
-    Edge(mobile/robotic hardware)
-    Web
-    Monitoring</code></pre><h3 id="📌software-engineering">📌Software Engineering</h3>
<ul>
<li><p>Programming Language</p>
<ul>
<li>Python, because of the libraries</li>
<li>Clear winner in scientific and data computing
#</li>
</ul>
</li>
<li><p>Editors</p>
<ul>
<li>use text editors</li>
<li>Vim, Emacs, Jupyter, <strong>VS Code</strong>, PyCharm</li>
<li><strong>VS Code</strong> makes for a very nice Python experience<ul>
<li>built-in git staging and diffing</li>
<li>peek documentation</li>
<li>Open whole projects remotely</li>
<li>Lint code as you write</li>
<li>Use the terminal integrated in the editor</li>
<li>notebook port forwarding (opens notebooks(e.g.Jupyter) in the browser seamlessly)</li>
<li>Linters and Type Hints</li>
<li>Static analysis can catch some bugs(like using a variable never defined)</li>
<li>Static type checking both documents code and catches bugs</li>
</ul>
</li>
<li><strong>Jupyter Notebooks</strong><ul>
<li>Notebooks have become fundamental to data science</li>
<li>Great as the &quot;first draft&quot; of a project</li>
<li>Jeremy Howard from fast ai. 추천!!(<strong>course.fast.ai</strong> videos)</li>
<li>Problems with notebooks: hard to version, notebook IDE is primitive, very hard to test, out-of-order execution artifacts, hard to run long or distributive tasks</li>
<li>Counterpoints to these problems: some companies has made good workflow in the notebook</li>
</ul>
</li>
<li><strong>Streamlit</strong><ul>
<li>New, but great at fulfilling a common ML need: interactive applets</li>
<li>Decorated normal Python code</li>
<li>smart data caching, quick re-rendering
#</li>
</ul>
</li>
</ul>
</li>
<li><p>Setting up environment</p>
<ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/36348ecb-ec35-4147-8a27-5b148c2e3969/image.png" alt=""></li>
</ul>
</li>
</ul>
<h3 id="📌compute-hardware">📌Compute Hardware</h3>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/1e9d89a2-bc61-461d-b94c-460968cc226d/image.png" alt=""></p>
<ul>
<li>GPU<ul>
<li>NVIDIA is the only game in town</li>
<li>Google TPUs are the fastest
#</li>
</ul>
</li>
<li>Cloud<ul>
<li>Amazon Web Services, Google Cloud Platform, Microsoft Azure are the heavyweights.</li>
<li>Heavyweights are largely similar in function and price.<ul>
<li>AWS most expensive
<img src="https://velog.velcdn.com/images/shining_arrow/post/f31482b4-82e5-4416-b378-bf3dc02bcb91/image.png" alt=""></li>
<li>GCP just about as expensive, and has TPUs</li>
<li>Azure reportedly has bad user experience</li>
</ul>
</li>
<li>Startups are Coreweave, Lamda Labs, and more
#</li>
</ul>
</li>
<li>On-prem<ul>
<li>Build your own<ul>
<li>Up to 4 Turing or 2 Ampere GPUs is easy</li>
<li>All you need to know: <a href="http://timdettmers.com/2018/12/16/deep-learning-hardware-guide/">http://timdettmers.com/2018/12/16/deep-learning-hardware-guide/</a> </li>
</ul>
</li>
<li>Buy pre-built<ul>
<li>Lambda Labs, NVIDIA, and builders like Supermicro, Cirrascale, etc.
#</li>
</ul>
</li>
</ul>
</li>
<li>In Practice<ul>
<li>Even though cloud is expensive, it&#39;s hard to make on-prem scale past a certain point</li>
<li>Dev-ops(declarative infra, repeatable processes) definitely eadier in the cloud</li>
<li>Maintenance is also a big factor
#</li>
</ul>
</li>
<li>Recommendation for hobbyist<ul>
<li>Development<ul>
<li>Build a 4x Turing or 2x Ampere PC</li>
</ul>
</li>
<li>Training/Evalutaion<ul>
<li>Use the same PC, just always keep it running</li>
<li>To scale out, use Lambda or Coreweave cloud instances.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="📌resource-management">📌Resource Management</h3>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/486bcf42-2c09-4943-ba1e-4810822ea807/image.png" alt=""></p>
<h3 id="📌deep-learning-frameworks">📌Deep Learning Frameworks</h3>
<ul>
<li>Unless you have a good reason not to, <strong>use Tensorflow/Keras or PyTorch</strong></li>
<li>Both have converged to the same point:<ul>
<li>Tensorflow uses eager execution -&gt; Pytorch랑 비슷한 code 작성 가능, and Pytorch got faster using TorchScript</li>
</ul>
</li>
<li>Most new projects use PyTorch (because it&#39;s more dev-friendly)</li>
<li>fast.ai library builds on PyTorch with best practices</li>
<li>PyTorch-Ligthning adds a powerful training loop
#</li>
<li>Hugging face<ul>
<li>Tons of NLP-focused model architectures (and pre-trained weights) for both PyTorch and Tensorflow
#</li>
</ul>
</li>
<li>Distributed Training<ul>
<li>Using multiple GPUs and/or machines to train a single model.</li>
<li>More complex than simplt running different experiments on different GPUs</li>
<li>A must-do on big datasets and large models
#</li>
</ul>
</li>
<li><strong>Data Parallelism</strong><ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/b101143f-191a-417d-bdeb-8c6b41fd1559/image.png" alt=""></li>
<li>If iteration time is too long, try training in data parallel regime</li>
<li>For convolution, expect 1.9x/3.5x speedup for 2/4 GPUs.
<img src="https://velog.velcdn.com/images/shining_arrow/post/1421c9a5-ef50-4868-9052-80638224837a/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/1f492748-f79c-4b67-be50-abf4bed0253b/image.png" alt=""></li>
</ul>
</li>
</ul>
<p>#</p>
<ul>
<li><strong>Model Parallelism</strong><ul>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/4a0aa452-50ae-45e5-9291-77e166867bcc/image.png" alt=""></li>
<li>Model parallelism is necessary when model does not fit on a single GPU<ul>
<li>Introduces a lot of complexity and is usually not worth it.(But this is changing.)</li>
<li>Better to buy the largest GPU you can, and/or use gradient checkpointing</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="📌experiment-management">📌Experiment Management</h3>
<ul>
<li>Problem: <ul>
<li>Even when running one experiment at a time, you can lose track of which code, parameters, and dataset generated which trained model.</li>
<li>When running multiple experiments, problem is much worse.</li>
</ul>
</li>
<li>Solutions:<ul>
<li><strong>Tensorboard</strong><ul>
<li>A fine solution for single experiments</li>
<li>Gets unwieldy to manage many experiments, and to properly store past work</li>
</ul>
</li>
<li><strong>MLFlow Tracking</strong><ul>
<li>self-hosted solution from DataBricks</li>
</ul>
</li>
<li><strong>Comet.ml</strong></li>
<li><strong>Weights &amp; Biases</strong><ul>
<li>publish reports with embedded charts, figures, etc.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="📌hyperparameter-tuning">📌Hyperparameter Tuning</h3>
<h3 id="📌all-in-one-solutions">📌All-in-one Solutions</h3>
<ul>
<li>Single system for everything<ul>
<li>development(hosted notebook)</li>
<li>scaling experiments to many machines(sometimes even provisioning)</li>
<li>tracking experiments and versioning models</li>
<li>deploying models</li>
<li>monitoring performance</li>
</ul>
</li>
<li>FBLearner Flow</li>
<li>Google Cloud AI Platform</li>
<li>Amazon SageMaker</li>
<li>Neptune Machine Learning Lab</li>
<li>FLOYD</li>
<li>gradient by Paperspace</li>
<li>Determined AI</li>
<li>Domino Data Lab
<img src="https://velog.velcdn.com/images/shining_arrow/post/34e166d0-d7df-4efb-a770-3a52aa45080d/image.png" alt=""></li>
</ul>
<p>#
  :)
  #</p>
<p><strong>💡READING</strong>: <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/43146.pdf">https://storage.googleapis.com/pub-tools-public-publication-data/pdf/43146.pdf</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[4.Transformers]]></title>
            <link>https://velog.io/@shining_arrow/4.Transformers</link>
            <guid>https://velog.io/@shining_arrow/4.Transformers</guid>
            <pubDate>Tue, 17 May 2022 12:17:14 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/shining_arrow/post/58a258ff-02b0-425e-8073-9e1a13c17733/image.png" alt=""></p>
<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h4 id="📌transfer-learning-in-computer-vision">📌Transfer Learning in Computer Vision</h4>
<ul>
<li><p>Resnet-50와 같은 deep neural network(NN)들은 성능이 좋긴함.</p>
</li>
<li><p>But they are so large that it overfits on our small data.</p>
</li>
<li><p>Solution: ImageNet을 사용해 NN을 train한 후 fine-tuning하기</p>
</li>
<li><p>Result: better performance!
<img src="https://velog.velcdn.com/images/shining_arrow/post/40743dbc-f5f7-4cd0-b285-b20469e2907b/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/03bd052f-fad0-46c5-a0d8-98e02c9b196a/image.png" alt=""></p>
</li>
<li><p>Fine-tuning model: ImageNet을 사용해 모델을 학습시킨 후 마지막 몇 개의 layer만 다른 것으로 replace.</p>
</li>
<li><p>Tensorflow와 Pytorch로 쉽게 구현 가능.</p>
</li>
</ul>
<h4 id="📌embeddings-and-language-models">📌Embeddings and Language Models</h4>
<ul>
<li>NLP에서의 input: sequence of words.</li>
<li>Deep Learning에서의 input: vectors.</li>
<li>How do we convert words to vectors?</li>
<li>Idea: <strong>one-hot encoding</strong><ul>
<li>look up whatever words you need to encode in the dictionary.</li>
<li>All-zero vector except one at the position where that word is in the dictionary.</li>
<li>Problem: scales poorly with vocab size.</li>
<li>Logically violates what we know about word similarity</li>
</ul>
</li>
<li>SOL1)Map one-hot to dense vectors</li>
<li>SOL2)Learn a Language Model<ul>
<li>&quot;pre-train&quot; for your NLP task by learning a really good word embedding</li>
<li>How? -&gt; train for a very general task on a large corpus of text(e.g., wikipedia).
<img src="https://velog.velcdn.com/images/shining_arrow/post/c74c54f0-5ed6-45d8-aee1-31bb8f4302f3/image.png" alt=""></li>
<li><strong>N-Grams</strong>: Slide an N-sized window through the text, forming a dataset of predicting the last word.</li>
<li><strong>Skip-Grams</strong>: N-Gram의 성능을 향상시킬 수 있음. Look on both sides of the target word and form multiple samples from each N-gram.</li>
<li><strong>How to train faster</strong>: use binary instead of multi-class</li>
</ul>
</li>
</ul>
<h4 id="📌nlps-imagenet-moment-elmo-and-ulmfit-on-datasets">📌NLP&#39;s ImageNet moment: ELMO and ULMFit on datasets</h4>
<ul>
<li><p>Word2Vec and GloVe embeddings became popular in 2013-14</p>
</li>
<li><p>많은 task에서 정확도를 큰 폭으로 높임.</p>
</li>
<li><p>But these representations are shallow:</p>
<ul>
<li>only first layer would have benefit of seeing all of Wikipedia</li>
<li>rest of the layers would be trained on the task dataset( your data), which is way smaller</li>
</ul>
</li>
<li><p>Why not pre-train more layers and disambiguate words, learn gramar, etc? -&gt; <strong>ELMO</strong> 에서 처음 적용함
<img src="https://velog.velcdn.com/images/shining_arrow/post/29c2b7b1-b30c-4758-9684-de4b8e5a06ce/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/b7d7d784-15fa-4571-b71f-77eb17001df7/image.png" alt=""></p>
<ul>
<li><p><strong>SQuAD dataset</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/ed792a6e-7478-4f43-80a3-2465afd7bdf7/image.png" alt=""></p>
</li>
<li><p><strong>SNLI dataset</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/93a22353-3945-45dd-96d9-1fb233381ea5/image.png" alt=""></p>
</li>
<li><p><strong>GLUE dataset</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/18b8dfa0-5a12-4587-9b27-0ed924eb7b88/image.png" alt=""></p>
</li>
<li><p><strong>ULMFit</strong></p>
</li>
<li><p>similar to ELMO</p>
</li>
<li><p>took hackers&#39; approach to deep learning</p>
</li>
</ul>
</li>
</ul>
<h4 id="📌transformers">📌Transformers</h4>
<ul>
<li><p>💡Attention in detail</p>
<ul>
<li>Input: sequence of tensors</li>
<li>Output: sequence of tensors, each one a weighted sum of the input sequence</li>
<li>Not a learned weight, but a function of x_i and x_j</li>
<li>How do we learn weights?<ul>
<li>1)<strong>Query</strong>: Compared to every other vector to comput attention weight for its own output y_i</li>
<li>2)<strong>Key</strong>: Compared to every other vector to comput attention weight w_ij for output y_j</li>
<li>3)<strong>Value</strong>: Summed with other vectors to form the result of the attention weighted sum</li>
</ul>
</li>
<li>Mulitiple Heads</li>
<li>Layer Normalization<ul>
<li>Neural networks work best when inputs to a layer have uniform mean and standard deviation in each dimension.</li>
<li>Layer 사이에서 normalization을 사용해 uniform mean + standard deviation 갖도록 하는 hack<h1 id=""></h1>
</li>
</ul>
</li>
</ul>
</li>
<li><p>💡BERT, GPT-2, DistillBERT, T5</p>
<ul>
<li><strong>GPT, GPT-2</strong><ul>
<li>Generative Pre-trained Transformer</li>
<li>GPT learns to predict the next word in the sequence(generating text), just like ELMO or ULMFit<ul>
<li>그치만 ELMO와 ULMFit은 embedding layer와 LSTM을 사용하고 GPT는 embedding layer와 transfer layer사용함.</li>
</ul>
</li>
<li>Uses masked self-attention</li>
</ul>
</li>
<li><strong>BERT</strong><ul>
<li>Bidirectional Encoder Representation from Transformers</li>
<li>GPT(uni-directional)와 달리 bidirectional</li>
<li>involves pre-training on A LOT of text w/ 15% of all words masked out<ul>
<li>also sometimes predicts whether one sentence follows another</li>
</ul>
</li>
</ul>
</li>
<li><strong>T5</strong><ul>
<li>Text-to-Text Transfer Transformer</li>
<li>Feb 2020</li>
<li>Evaluated most recent transfer learning techniques</li>
<li>Input and Output are both text strings</li>
<li>Trained on C4(Colossal Clean Crawled Corpus) - 100x larger than Wikipedia</li>
<li>11B parameters</li>
<li>SOTA on GLUE, SuperGLUE, SQuAD</li>
</ul>
</li>
<li><strong>GPT-3</strong></li>
<li><strong>DistillBERT</strong><ul>
<li>a smaller model is trained to reproduce output of a larger model</li>
</ul>
</li>
<li>Transformers are growing in size
<img src="https://velog.velcdn.com/images/shining_arrow/post/10ae5489-d3f3-4440-a06f-31c707e17f41/image.png" alt=""></li>
</ul>
</li>
</ul>
<p>#</p>
<p>📕<strong>READINGS</strong>
Attention is all you need(2017) <a href="http://peterbloem.nl/blog/transformers">http://peterbloem.nl/blog/transformers</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[3. RNNs]]></title>
            <link>https://velog.io/@shining_arrow/3.-RNNs</link>
            <guid>https://velog.io/@shining_arrow/3.-RNNs</guid>
            <pubDate>Sun, 08 May 2022 16:49:15 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/shining_arrow/post/8facc472-94d5-451c-bf9b-fdd242dab7e3/image.png" alt=""></p>
<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h4 id="📌sequence-problems">📌Sequence Problems</h4>
<ul>
<li>Sequence Problem 종류<ul>
<li>one-to-many: input -&gt; single value, output -&gt; sequence인 경우</li>
<li>many-to-one: input -&gt; sequence, output -&gt; single value인 경우</li>
<li>many-to-many: input -&gt; sequence, output -&gt; sequence인 경우</li>
</ul>
</li>
</ul>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/966820a2-9ee0-4bf7-a772-d473b381ad49/image.png" alt=""></p>
<ul>
<li>Sequence Problem 예시
<img src="https://velog.velcdn.com/images/shining_arrow/post/d135f11c-b2c5-48d6-97e1-17a778ae6cc4/image.png" alt=""></li>
<li>Why not use feedforward networks instead?</li>
</ul>
<pre><code>- Problem 1: Variable Length Inputs
    - 모든 sequence에 padding을 추가해 max length와 동일한 크기를 갖도록 하여 해결할 수 있다.</code></pre><ul>
<li><p>Problem 2: Memory Scaling</p>
<ul>
<li><p>Memory requirement scales lineraly in number of timesteps</p>
</li>
<li><p>Problem 3: Overkill</p>
<ul>
<li>Model needs to learn patterns everywhere in the sequence -&gt; data inefficient!</li>
<li>This ignores the nature of the problem that patterns repeat themselves over time.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="📌rnns">📌RNNs</h4>
<ul>
<li><p>Instead of having a single massive matrix(one that has independent weights for every position in the sequence), does stateful computation.</p>
</li>
<li><p><strong>Stateful Computation</strong>:</p>
<ul>
<li><p>output of model depends on the input at the current timestep in the sequence &amp; some state the model maintains over time.</p>
</li>
<li><p>For every input in a particular timestep, the model produces the output as well as the next hidden state for the model.</p>
</li>
<li><p>아래 그림처럼 처음에 h0와 x1이 주어지면 output인 y1뿐 아니라 next state인 h1까지 계산한다. 같은 과정(weight)으로 이후 step들도 계산함.
<img src="https://velog.velcdn.com/images/shining_arrow/post/3c5f1da9-0267-4ac9-98bc-57e5491420f9/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/d585818b-135c-445e-89c9-4fe13aad8ecb/image.png" alt=""></p>
</li>
<li><p>RNN에선 input이 있을 때마다 step function을 사용하고, output을 생성한다. -&gt; many-to-many problem일때는 잘 적용됨.</p>
</li>
<li><p>그치만 many-to-one problem인 경우에는 어떻게 해결하는가?</p>
<ul>
<li>가장 마지막 timestep의 output인 yt를 가지고 전체 sequence값을 계산한다. (yt값을 classifier가 전달받아 결과값을 출력한다.)</li>
<li><strong>Encoder-decoder architecture</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/c750f2b4-f16b-4f91-a608-5f8e0a7c9c21/image.png" alt=""></li>
</ul>
</li>
<li><p>one-to-many problem의 경우에는 어떻게 해결하는가?</p>
<ul>
<li>convnet을 사용해 image classification까지의 전체 과정을 수행하는 방법 대신 fully-connected layer의 마지막 단계 vector들을 RNN의 inital hidden state로 사용한다.</li>
<li><strong>Encoder-decoder architecture</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/66f1e914-00a9-4306-a9e7-e2ab78ef259b/image.png" alt=""><ul>
<li>💡<em>disclaimer</em> : thinking of encoder and decoder as separate networks is just a mental heuristic for understanding - they aren&#39;t separate in any meaningful sense!(They are connected during back propagation.)
<img src="https://velog.velcdn.com/images/shining_arrow/post/ac89d156-c03d-40a6-9c2b-a24c6495939d/image.png" alt=""></li>
</ul>
</li>
<li>여기서 input은 이전 timestep의 output임.</li>
<li>그렇다면 언제 input을 멈춰야할지 알 수 있을까?
(이전 단계의 output이 이번 단계의 input이면 계속 input이 존재할 것이므로)</li>
<li><blockquote>
<p>special character를 사용. (tells the architecture when to stop.)</p>
</blockquote>
</li>
</ul>
<p>#</p>
</li>
<li><p>many-to-many problem에서는 어떻게 해결하는가?</p>
<ul>
<li>마찬가지로 encoder-decoder architecture 사용.</li>
<li>encoder와 decoder 모두 RNN임.</li>
<li>most common case</li>
<li>used for machine translation</li>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/7bc8b040-19b6-4bb2-aa5a-adec8156257d/image.png" alt=""></li>
<li><img src="https://velog.velcdn.com/images/shining_arrow/post/75552090-640e-4dcf-9a80-7045ac3be136/image.png" alt=""></li>
<li>one-to-many problem처럼 이전 단계의 output을 이번 단계의 input으로 사용하고 special character을 만나면 input 멈춤. encoder로 구한 output을 decoder의 inital input으로 사용하고 같은 과정을 반복한다.</li>
<li>입력문장의 모든 정보들은 encoder RNN을 통해 하나의 hidden state vector로 압축된다. -&gt; 이후 decoder RNN의 inital state vector로 사용.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="📌vanishing-gradients-issue">📌Vanishing gradients issue</h4>
<ul>
<li>RNN Desiderata<ul>
<li>Goal: handle long sequences</li>
<li>Connect events from the past to outcomes in the future<ul>
<li>i.e., Long-term dependencies</li>
<li>e.g., remember the name of a character from the last sentence</li>
</ul>
</li>
</ul>
</li>
<li>Vanilla RNNs: the reality<ul>
<li>Can&#39;t hadle more than 10-20 timesteps</li>
<li>Longer-term dependenicies get lost</li>
<li>Why? <strong>Vanishing gradients</strong><ul>
<li>sigmoid와 tanh는 input값이 커지면 derivative값이 0에 매우 가까워짐</li>
<li>tanh primes multiplied by each other eventually hits zero in numerical precision</li>
<li>After enough steps, gradients are too small</li>
<li>ReLu는 위의 문제에 해당되지 않는데?<ul>
<li>ReLu RNNs in practice often have the opposite problem which is <strong>exploding gradients</strong>.(gradients tend to get too big)
<img src="https://velog.velcdn.com/images/shining_arrow/post/ff001fb6-73f3-4f52-87e9-320c2221591f/image.png" alt=""></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="📌lstms">📌LSTMs</h4>
<ul>
<li><p>목적: use a compute_next_h function that preserves gradients -&gt; vanishing gradients issue를 해결하고자 함.
<img src="https://velog.velcdn.com/images/shining_arrow/post/78d3081c-6a98-4c8c-ba92-1d6af7659706/image.png" alt=""></p>
</li>
<li><p>Main idea: introduce a new &quot;cell state&quot; channel</p>
<ul>
<li>In addition to hidden states that get updated every time step, update &quot;cell states&quot;.</li>
<li>Cell states have very particular rules about how it gets updated. 이때 규칙은 hidden state와 cell state간의 interaction에 따라 세가지 step으로 나뉜다. <ul>
<li><strong>Forget gate</strong>: decide what parts of old cell state to forget. Previous hidden state를 input과 합쳐 sigmoid에 입력함. Sigmoid output값과 cell state를 multiply -&gt; gets rid of old info that no longer needs to be in the cell state</li>
<li><strong>Input gate</strong>: decide how to incorporate new information into the cell state</li>
<li><strong>final gate</strong>: decide how to produce the output as hidden state</li>
</ul>
</li>
</ul>
</li>
<li><p>What about other RNNs like GRUs?</p>
<ul>
<li>LSTMs work well for most tasks.</li>
<li>Try GRUs if LSTMs are not performing well.</li>
</ul>
<p>#</p>
</li>
</ul>
<h4 id="📌case-study-machine-translation-bidirectionality-and-attention">📌Case Study: Machine Translation (Bidirectionality and Attention)</h4>
<ul>
<li><p><strong>Key questions for machine learning applications papers</strong></p>
<ul>
<li>What problem are they trying to solve?</li>
<li>What model architecture was used?</li>
<li>What dataset was it trained on?</li>
<li>How did they do training?</li>
<li>What tricks were needed for inference in deployment?
#</li>
</ul>
</li>
<li><p>Google&#39;s Neural Machine Translation System: Bridging the Gap between Human and Machine Translation(Wu et al.,2016)</p>
<ul>
<li><p>1) What problem are they trying to solve?<img src="https://velog.velcdn.com/images/shining_arrow/post/de27e705-081f-4f7f-82f3-e13a062c0454/image.png" alt=""></p>
</li>
<li><p>2) What model architecture was used?</p>
<ul>
<li><p>Encoder와 decoder이 모두 RNN인 Encoder-decoder architecture</p>
</li>
<li><p>Problem 1: using single layer will underfit the task</p>
</li>
<li><p>Solution 1: stack LSTM layers
<img src="https://velog.velcdn.com/images/shining_arrow/post/6fcca040-40ca-43b3-96b0-1a3814e5ba44/image.png" alt=""></p>
</li>
<li><p>Problem 2: Stacked LSTMs are hard to train. They barely work with more than 6 layers.</p>
</li>
<li><p>Solution 2: add residual connections(ResNet처럼). LSTM의 layer 사이에 skip function을 둔다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/30f1c040-1c23-42ff-97ce-1da9193a42fa/image.png" alt=""></p>
</li>
<li><p>Problem 3: bottleneck between the encoder and decoder when dealing with large information</p>
</li>
<li><p>Solution 3: Attention(Attention에 대해서는 다음주에 더 자세히 다룸.)
<img src="https://velog.velcdn.com/images/shining_arrow/post/811ca574-a8cf-4012-bf2b-c8532cbf3b07/image.png" alt="">
Idea: 각 언어의 어순을 고려해 번역하려는 단어마다 관련 있는 문장의 영역에 집중한다. 
How: <strong>Relevance score</strong>을 사용해 문장 속 각 단어들에 대한 attention value를 계산. Input sentence의 모든 단어들이 output sentence의 특정 단어와 얼마나 관련있는지 구한다.
<img src="https://velog.velcdn.com/images/shining_arrow/post/124aba09-8adb-4496-8976-493ff0afac0c/image.png" alt=""></p>
</li>
</ul>
</li>
</ul>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/66cbe2b8-cde3-47f9-abd4-dad2e6c85b9c/image.png" alt=""></p>
<h2 id="attention은-번역-외에-다양한-분야에도-쓰인다-음성인식이나-img-model에도-쓰임">   Attention은 번역 외에 다양한 분야에도 쓰인다. (음성인식이나 img model에도 쓰임)</h2>
<ul>
<li>Problem 4: LSTMs only consider backward context. 하지만 단어의 뜻은 문맥에 따라 달라지므로 문장 전체에 대해 이해하는 것이 단어의 올바른 뜻을 찾는데 효과적이다. </li>
<li>Solution 4: Bidirectional LSTM -&gt; Use one LSTM to process the sequence in forward order and the other in backward order. Then you concatenate those two outputs and pass it on to the next layer.
<img src="https://velog.velcdn.com/images/shining_arrow/post/2bf0fefe-d9f3-498e-b1ab-10c7ff1193d6/image.png" alt="">
<img src="https://velog.velcdn.com/images/shining_arrow/post/2c312abd-661c-4d24-ae4a-35ea07afa39d/image.png" alt=""></li>
</ul>
</li>
<li><p>Summary of GNMT approach</p>
<ul>
<li>Stacked LSTM encoder-decoder architecture with residual connections</li>
<li>Attention enables longer-term connections</li>
<li>Bidirectional LSTM to encode future information</li>
<li>Train using standard cross-entropy</li>
<li>Speed up inference with quantization of weights</li>
</ul>
</li>
</ul>
<h4 id="📌ctc-loss">📌CTC loss</h4>
<ul>
<li>Goal:
<img src="https://velog.velcdn.com/images/shining_arrow/post/0a0859c0-2748-47b6-8808-b24033ba3b9d/image.png" alt=""><ul>
<li>Convnet window를 손글씨 이미지 위에서 sliding하면서 convnet output을 LSTM에서 이전 단계의 hidden state와 combine.
<img src="https://velog.velcdn.com/images/shining_arrow/post/d18052a4-bfaf-4c87-9b91-e71c8ef7579b/image.png" alt=""></li>
<li>Problem: What if an input is scaled differently? (window하나의 크기보다 알파벳 하나의 크기가 더 큰 경우. 같은 글자를 여러번 출력하는 오류 발생)</li>
<li>Solution: 같은 알파벳이 연속되어 출력되면 같은 알파벳이라고 예상한다. -&gt; Combine subsequent characters that have the same value
<img src="https://velog.velcdn.com/images/shining_arrow/post/8ff451ae-7ee0-4495-b11c-aba552315020/image.png" alt=""></li>
<li>실제로 같은 알파벳이 여러번 존재하는 단어의 경우 어떻게 해결해야하는가?<ul>
<li>Add extra epsilon tokens -&gt; 정해진 규칙에 따라 token들을 알파벳과 merge할지 결정. -&gt; final output sentence</li>
<li>규칙:
<img src="https://velog.velcdn.com/images/shining_arrow/post/beeca7b0-2ed9-4c98-be3f-37e3a98d5c5e/image.png" alt=""></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="📌pros-and-consof-rnn-architecture">📌Pros and Cons(of RNN architecture)</h4>
<ul>
<li><p>Pros</p>
<ul>
<li>Encoder/decoder LSTM architectures are very flexible
(works for one-to-many, many-to-one, many-to-many sequence problems)</li>
<li>Has a history of many successes in NLP and other applications</li>
</ul>
</li>
<li><p>Cons</p>
<ul>
<li>Recurrent network training is not as parallelizable as FC or CNN, due to the need to go in sequence(이전 단계를 계산해야만 다음 단계가 진행되므로..)</li>
<li>Therefore much slower!</li>
<li>Can be finicky to train</li>
</ul>
</li>
</ul>
<h4 id="📌a-preview-of-non-recurrent-sequence-models">📌A preview of non-recurrent sequence models</h4>
<ul>
<li><p>Sequence data does not require recurrent models!</p>
</li>
<li><p>Hence, <strong>convolutional approach</strong> can be used for sequence data modeling</p>
</li>
<li><p>WaveNet: A Generative Model for Raw Audio(van den Oord et al, 2016)</p>
<ul>
<li><p>used in Google Assistant and Google Cloud Text to Speech(e.g., for call centers)</p>
</li>
<li><p>Main idea: convolutional sequence models</p>
</li>
<li><p>1) What problem are they trying to solve?
<img src="https://velog.velcdn.com/images/shining_arrow/post/b0bb6be9-328e-43a7-ad38-5dda9d0fe1a5/image.png" alt=""></p>
</li>
<li><p>2) What model architecture was used?
<img src="https://velog.velcdn.com/images/shining_arrow/post/8cbaf5d8-f32a-42bf-9e92-e5c578ad5e3f/image.png" alt=""></p>
</li>
<li><p>3) Insights of solution
<img src="https://velog.velcdn.com/images/shining_arrow/post/47869337-aa4f-41ca-aab3-19278b0d9e2c/image.png" alt=""></p>
</li>
<li><p>An output is produced by looking at the window of previous hidden layers, and those inputs from the previous hidden layer is produced from a window of inputs of the layer before that.</p>
</li>
<li><p><strong>Causal convolution</strong>: the entire window is from the past. You don&#39;t look at any future data layers to get the output.</p>
</li>
<li><p>4) Challenge of the solution : getting a large receptive field</p>
</li>
<li><p>5) Solution of the challenge : dilated convolutions
<img src="https://velog.velcdn.com/images/shining_arrow/post/9dd737a6-90bb-4c35-93ba-31129951dff2/image.png" alt=""></p>
</li>
<li><p>6) What model architecture was used?
<img src="https://velog.velcdn.com/images/shining_arrow/post/92b9d1f3-e14c-4d7d-8f92-8d40813a198e/image.png" alt=""></p>
</li>
<li><p>7) What dataset was it trained on?</p>
<ul>
<li>Internal Google datasets (24.6 hours of speech in North American English, 34.8 hours of speech in Mandarin Chinese, ~16,000 samples per second)</li>
</ul>
</li>
<li><p>8) How was it trained?</p>
<ul>
<li>병렬처리가 가능해서 따로 train을 하는 trick이 필요하지 않음</li>
</ul>
</li>
<li><p>9) What tricks were needed for inference in deployment?</p>
<ul>
<li>Training(parallel)은 쉬우나 inference(serial)는 복잡함.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>#</p>
<p>💡<strong>READING</strong></p>
<ul>
<li><a href="https://karpathy.github.io/2015/05/21/rnn-effectiveness/">https://karpathy.github.io/2015/05/21/rnn-effectiveness/</a></li>
<li><a href="https://towardsdatascience.com/attention-craving-rnns-a-journey-into-attention-mechanisms-eec840fbc26f">https://towardsdatascience.com/attention-craving-rnns-a-journey-into-attention-mechanisms-eec840fbc26f</a></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[2B. Computer Vision]]></title>
            <link>https://velog.io/@shining_arrow/2B.-Computer-Vision</link>
            <guid>https://velog.io/@shining_arrow/2B.-Computer-Vision</guid>
            <pubDate>Wed, 04 May 2022 14:45:37 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h4 id="📌alexnet">📌AlexNet</h4>
<ul>
<li><p>Deep layer with 8 layers</p>
</li>
<li><p>First convnet winner</p>
</li>
<li><p>Innovated with ReLU and Dropout</p>
<ul>
<li>Dropout: some set of weights are set to zero randomly in training</li>
</ul>
</li>
<li><p>Heavy data augmentation(flip, scale, etc)</p>
<ul>
<li>Fun fact: usually drawn as two parts, because the biggest GPU only had 3GB memory at the time</li>
<li>그래서 model distributed training을 했어야 했다. (model이 두개의 다른 GPU에 위치한 상태)</li>
</ul>
</li>
</ul>
<h4 id="📌zfnet">📌ZFNet</h4>
<ul>
<li>거의 AlexNet과 동일 + just tweaking some parameters</li>
<li>famous for deconvolutional visualizations</li>
<li>each layers detect a certain type of image patch.<ul>
<li>early layers: learn edge detection &amp; texture detection(color detection)</li>
<li>later layers: detect parts of objects, e.g., ears, eyes, wheels, etc.</li>
</ul>
</li>
</ul>
<h4 id="📌vggnet">📌VGGNet</h4>
<ul>
<li>More layers!</li>
<li>Only use 3x3 convolutions &amp; 2x2 max pools</li>
<li>increased channel dimension with each layer<ul>
<li>early layers: 64 channels</li>
<li>later layers: 512 channels</li>
</ul>
</li>
<li>has 138 million parameters</li>
<li>most parameters are used in the later layers with the fully connected layers
  -사용되는 parameter를 제한하기 때문에 적은 수의 parameter로 계산할 수 있다-&gt; 빠름!</li>
</ul>
<h4 id="📌googlenet">📌GoogleNet</h4>
<ul>
<li>=inception net</li>
<li>VGG만큼 저렴하지만 3%정도의 parameter만 사용한다</li>
<li>No fully-connected layers</li>
<li>Is just a stack of inception modules( network module more creative than the standard)</li>
<li>injected classifier outputs not only at the end but also in the middle<ul>
<li>it let the network get gradient from the loss function at more spot than just at the end of the network</li>
</ul>
</li>
</ul>
<h4 id="📌resnet">📌ResNet</h4>
<ul>
<li><p>Very deep layer: 152 layers</p>
</li>
<li><p>Down to 3.57% top-5 error(5%인 human performance보다 낮음!)</p>
</li>
<li><p>most commonly used network now</p>
</li>
<li><p>Problem: network가 깊어질수록 얕은 네트워크만큼의 성능을 내야하는데 그러지 않는 경우 발생 </p>
<ul>
<li>due to vanishing gradient</li>
<li>Solution: make an option to skip around layers </li>
<li>gradient가 vanish되는 경우 skip</li>
</ul>
</li>
<li><p>ResNet Variants</p>
<ul>
<li>DenseNet: using more skip connections (skip connection을 건너뛰고 싶은 해당 layer만이 아니라 다른 모든 부분에 다 연결함)</li>
<li>ResNeXt: inception net + ResNet</li>
</ul>
</li>
</ul>
<h4 id="📌squeezenet">📌SqueezeNet</h4>
<ul>
<li>Focused on trying to reduce the number of parameters as much as possible</li>
<li>Use constant 1x1 bottlenecking techniques<ul>
<li>number of channels never expands</li>
</ul>
</li>
</ul>
<h4 id="📌overall-comparison">📌Overall Comparison</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/125505aa-8056-491d-925e-3a84492e58b6/image.png" alt=""></p>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/56a4b3ce-26c8-43c4-a270-659b9b012ca1/image.png" alt=""></p>
<h4 id="📌localization-detection-and-segmentation">📌Localization, Detection, and Segmentation</h4>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/50bcbc72-2615-466c-b083-576538fb6deb/image.png" alt=""></p>
<ul>
<li><p><strong>Classification</strong>: given an image, output the class of the object</p>
</li>
<li><p><strong>Localization</strong>: Do classification, but also highlight where the object is in the image</p>
</li>
<li><p><strong>Detection</strong>: given an image, output every object&#39;s class and location</p>
</li>
<li><p><strong>Segmentation</strong>: label every pixel in the image as belonging to an object or the background</p>
<ul>
<li><strong>Instance Segmentation</strong>: additionally differentiates between different objects of the same class</li>
</ul>
</li>
<li><p>Using networks for Localization
<img src="https://velog.velcdn.com/images/shining_arrow/post/29fb4a80-dce2-445d-b973-b132ff33a56f/image.png" alt=""></p>
<ul>
<li>output bounding box coordinates(x1,y1,x2,y2) as well as the class of an object</li>
<li>class 결과를 제공할 때 사용하는 network와 동일한 네트워크를 사용해 마지막 단계에서 coordinate 예측값도 산출하게 한다.</li>
</ul>
</li>
<li><p>Using networks for Detection
<img src="https://velog.velcdn.com/images/shining_arrow/post/ed325551-dca0-4550-9caa-5d93c160a143/image.png" alt=""></p>
<ul>
<li>몇 개의 object가 있는지 모르는 상태라서 Localization에 사용한 방법을 사용할 수 없음</li>
<li>Solution: slide a classifier over the image(at multiple scales)<ul>
<li>VERY computationally expensive, but 해결방법 있음!</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="📌non-maximum-supressionnms-and-iou">📌Non-maximum Supression(NMS) and IOU</h4>
<ul>
<li>Non-maximum Supression(NMS): When multiple bounding boxes overlap, you should keep the one with the highest score and remove all the others.</li>
<li>Intersection over Union(IOU): most common metric for localization quality</li>
</ul>
<h4 id="📌yolossd">📌YOLO/SSD</h4>
<ul>
<li><p><strong>YOLO(You Only Look Once)</strong>
<img src="https://velog.velcdn.com/images/shining_arrow/post/7a2fd67d-e97d-4306-a6dc-2237b08274b2/image.png" alt=""></p>
<ol>
<li>Put a fixed grid over an image, and within the grid find objects</li>
<li>Output class and box coordinates</li>
<li>Run non-maximum supression</li>
</ol>
<ul>
<li>nice &amp; fast, and is in active development!</li>
</ul>
</li>
<li><p>Microsoft <strong>COCO</strong>: Common Objects in Context
<img src="https://velog.velcdn.com/images/shining_arrow/post/bbf44312-bb4c-4e62-bbf7-0f48bd4de36a/image.png" alt=""></p>
<ul>
<li>이 dataset을 가지고 YOLO의 성능을 평가함.</li>
<li>330,000 images &amp; 1.5 million object instances &amp; 80 categories &amp; some captions</li>
</ul>
</li>
</ul>
<h4 id="📌region-proposal-methods">📌Region Proposal Methods</h4>
<ul>
<li><p>이제까지는 이미지의 모든 부분을 관찰함.</p>
<ul>
<li>그러지 말고 중요해 보이는 부분만 관찰하면 어떨까? (look only at regions that seem interesting)</li>
</ul>
</li>
<li><p><strong>R-CNN(Region-CNN)</strong></p>
<ol>
<li>Using external(non-deeplearning) methods to find regions </li>
<li>Use AlexNet on regions</li>
<li>Predict both class and bounding box(coordinates)</li>
</ol>
</li>
<li><p><strong>Faster R-CNN</strong>
-Used convnet for the Regional Proposal Network</p>
<ul>
<li><strong>Region Proposal Network(RPN)</strong>: a fully convolutional method for scoring a bunch of candidate windown for &quot;objectness&quot;
<img src="https://velog.velcdn.com/images/shining_arrow/post/a7d7f671-4451-4368-bbf8-11093002972b/image.png" alt=""></li>
<li>Faster (because everything is done in the convnet!)</li>
<li>Four losses total: classifier and bbox regression for both RPN and object classifier</li>
</ul>
</li>
<li><p><strong>Mask R-CNN</strong>
-Each region goes in not only the classification but also the segmentation step</p>
<ul>
<li>Regions go through a couple of non-downsampling convolutions</li>
</ul>
</li>
</ul>
<h4 id="📌adversarial-attacks">📌Adversarial Attacks</h4>
<ul>
<li><p>Convnets can be brittle in unexpected ways</p>
</li>
<li><p>Convnet 공격 방법</p>
<ul>
<li>Add noise to an image
<img src="https://velog.velcdn.com/images/shining_arrow/post/c8487e45-63c0-4ba5-936d-12885fa9ac99/image.png" alt=""></li>
<li>Add real things in real world such that when you take an image of it, it messes up the network
<img src="https://velog.velcdn.com/images/shining_arrow/post/2943c81a-6d87-45cf-9e6c-b6f911807098/image.png" alt="">  <ul>
<li>자율주행자동차 운행에 문제</li>
</ul>
</li>
</ul>
</li>
<li><p>Who would win?</p>
<ul>
<li><p>Detect 방법: try to find inputs that push the gradient of the network towards some class very strongly</p>
</li>
<li><p>Defend 방법:</p>
<pre><code> -    adversarial example을 같이 traing하기(doesn&#39;t work well)</code></pre><ul>
<li>Smooth the class decision boundaries(= Defensive distillation)</li>
</ul>
</li>
</ul>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[1. Deep Learning Fundamentals]]></title>
            <link>https://velog.io/@shining_arrow/1.-Deep-Learning-Fundamentals</link>
            <guid>https://velog.io/@shining_arrow/1.-Deep-Learning-Fundamentals</guid>
            <pubDate>Mon, 11 Apr 2022 06:32:33 GMT</pubDate>
            <description><![CDATA[<img src="https://velog.velcdn.com/images/shining_arrow/post/2049a8dd-63eb-4bbf-8f8d-d8630f488e1e/image.png" alt="1주차표지">

<blockquote>
<p><a href="https://fullstackdeeplearning.com/spring2021/">Full Stack Deep Learning</a> 강의를 듣고 정리한 내용입니다.</p>
</blockquote>
<h2 id="neural-networks">Neural Networks</h2>
<p>📌<strong>Biological Neurons</strong></p>
<ul>
<li>외부의 자극이 dentrites를 통해 들어옴 -&gt;역치를 넘어서면 firing함(axon을 통해 electrical potential전달)</li>
</ul>
<p>📌<strong>Artificial Neuron</strong></p>
<ul>
<li>input x: biological neuron에서 외부의 자극에 해당</li>
<li>weight w: 자극에 대해 얼마나 영향을 받는지 조정</li>
<li>b: bias</li>
<li>activation function: (=threshold function) sum값이 역치를 넘어서면 on, 아니면 off
<img src="https://velog.velcdn.com/images/shining_arrow/post/a04b1ede-cd9d-4c63-aa2d-9e3c36189563/image.png" alt=""></li>
</ul>
<p>📌<strong>Common Activation Function</strong></p>
<ul>
<li>Sigmoid Function</li>
<li>Hyperbolic Tangent</li>
<li>Rectified Linear Unit(ReLU)
<img src="https://velog.velcdn.com/images/shining_arrow/post/153e6d13-a485-45a3-9c4a-0e783ed206e9/image.png" alt=""></li>
</ul>
<h2 id="types-of-learning-problems">Types of Learning Problems</h2>
<p><img src="https://velog.velcdn.com/images/shining_arrow/post/0db11d40-b4c6-4878-a518-57ed4fa8ccd6/image.png" alt=""></p>
<p>📌 <strong>Unsupervised Learning</strong></p>
<ul>
<li><p>Unlabeled data X로 학습</p>
</li>
<li><p>GOAL: To learn the structure of data X</p>
</li>
<li><p>WHY? : 
i) To generate more of the same kind of data(e.g. <strong>fake</strong> reviews, <strong>fake</strong> soundclips, etc)
ii) To obtain <strong>insights</strong> into what the data might hold</p>
</li>
<li><p>e.g.1 <strong>Predicting next character in a string</strong>
  <img src="https://velog.velcdn.com/images/shining_arrow/post/51715fe0-1898-40f6-9fd3-b1a6775eb063/image.png" alt=""> </p>
<pre><code> -&gt; input type(글자들)과 model이 주어지면 RNN이 글을 쓴다. 아래는 character prediction의 예시이다.</code></pre><p> <em>Using RNN to feed in one character at a time and the RNN can output characters. What you end up learning is a language model. When you write a word, it will just keep writing by generating character by character. With an input type and model, it can generate paragraphs.</em></p>
<p> <img src="https://velog.velcdn.com/images/shining_arrow/post/0f982d77-135b-4567-b322-a439302bb146/image.png" alt=""></p>
</li>
</ul>
<p>참고자료: <a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/">http://karpathy.github.io/2015/05/21/rnn-effectiveness/</a> </p>
<ul>
<li><p>e.g.2 <strong>Predicting word relationships</strong>
  input: words in a vocabulary
  -&gt; 각 단어들을 벡터로 표현하고 학습된 시스템에 입력하면 man-woman, king-queen등의 관계를 파악한다.
  <em>Each words would be represented as a vector that&#39;s all zeros except for one in the place that corresponds to that word in some list of words. If you feed in a bunch of those vectors into a system that is properly set up and trained, you can determine that there are certain relationships between words like man-woman, king-queen.</em></p>
</li>
<li><p>e.g.3 <strong>Predicting next pixel(pixelCNN)</strong>
  -&gt; 컴퓨터 비전 영역에서는 이미지의 픽셀 일부만 주어지면 나머지 부분을 자동완성하도록 응용할 수 있다.
  _You can get something going with just a little bit of an image and then it auto-completes it.</p>
</li>
</ul>
<p>📌 <strong>Supervised Learning</strong></p>
<ul>
<li>Labeled data <strong>X(raw data), Y(label)</strong>로 학습</li>
<li>Learn X -&gt; Y</li>
<li>GOAL: To learn a function in order to make <strong>predictions</strong></li>
<li>상업적으로 사용하기에 가장 알맞음</li>
</ul>
<p>📌 <strong>Reinforcement Learning</strong></p>
<ul>
<li>Agent에게 특정 명령을 수행하도록 시켜 Environment와의 상호작용 확인</li>
<li>GOAL: To <strong>learn</strong> how to take <strong>actions</strong> in an <strong>environment</strong></li>
<li>e.g. <strong>Train game-playing agents</strong>: move a robot in an environment and check if there&#39;s a reward associated or not</li>
</ul>
<p>📌 (위의 세가지가 ML의 가장 대표적인 예시이고, 이 외에도 transfer learning, imitation learning, meta-learning, ...등 다양한 종류의 learning problem들이 존재한다.)</p>
<p>#</p>
<h2 id="empirical-risk-minimization">Empirical Risk Minimization</h2>
<p>Empirical Risk Minimization = minimize loss L as measured (empirically) on the data</p>
<p>📌<strong>Linear Regression</strong></p>
<p>2차원 그래프 : one-dimensional input과 one-dimensional output을 가짐.
GOAL: To minimize the loss function
find the setting of weights and biases like a and b in ax+b that minimize the loss function. </p>
<p>📌<strong>Neural Net Regression</strong></p>
<ul>
<li>Find w,b parameters that optimize loss
<img src="https://velog.velcdn.com/images/shining_arrow/post/9accb06d-97a6-410e-a5ac-2c0567e34ee2/image.png" alt=""></li>
<li>Typical losses:<ul>
<li>Mean Squared Error(MSE)</li>
<li>Huber loss(=more robust to outliers)</li>
</ul>
</li>
</ul>
<p>📌<strong>Neural Net Classification</strong>
-You try to predict from the input to some real valued output whereas in classification you predict from input to some categorical output. Outputs will be exactly 0, 1, 2, ... and these things will correspond to the label of the datapoint. </p>
<ul>
<li>Typical losses:<ul>
<li>cross entropy</li>
</ul>
</li>
</ul>
<h2 id="gradient-descent">Gradient Descent</h2>
<p>📌<strong>Optimizing the Loss</strong></p>
<ul>
<li><p>GOAL: find w,b that optimize(=minimize the loss)
<img src="https://velog.velcdn.com/images/shining_arrow/post/43810e3c-17d7-45f1-b31f-a38c4daf66e1/image.png" alt=""></p>
</li>
<li><p>HOW: update each weight(wi)
<img src="https://velog.velcdn.com/images/shining_arrow/post/c0537440-0688-47e5-9bcd-14b66def4ebc/image.png" alt=""></p>
</li>
</ul>
<p>alpha: learning rate
gradient of the loss function with regard to the weight</p>
<p>📌<strong>Conditioning</strong>
-Well-conditioned data: zero-mean, equal variance</p>
<ul>
<li>First-order methods(You compute first order gradient and update the weight with that gradient)<ul>
<li>Initialization</li>
<li>Normalization</li>
</ul>
</li>
<li>Second-order methods(compute second-order derivative of the loss function with regard to the weight. typically don&#39;t use this because computationally intensive.But there are some approximate second order methods that can be used to train neural networks more quickly)<ul>
<li>Exact:<ul>
<li>Newton&#39;s method<ul>
<li>Natural gradient</li>
</ul>
</li>
</ul>
</li>
<li>Approximate second order methods:<ul>
<li>Adagrad, Adam, Momentum</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>📌<strong>Sampling Schemes for Gradient Descent</strong>
-We could compute the loss of every single data and update each weight, but in practice it is better to compute the gradient on just a subset of the data.
-&gt; 모든 데이터의 loss를 계산해 각 weight를 업데이트 하기보다는 일부 데이터만 가지고 계산한다. </p>
<ul>
<li><strong>Stochastic Gradient Descent</strong><ul>
<li>Compute each gradient step on just a subset(&quot;batch&quot;)
of data -&gt; 일부 데이터만 가지고 train 함</li>
<li>PROS: less compute per step</li>
<li>CONS: more noise per step</li>
<li>Overall: faster progress per amount of compute</li>
</ul>
</li>
</ul>
<h2 id="back-propagation">Back Propagation</h2>
<p>📌<strong>Gradients are just derivatives</strong>
-Neural Nets are made up of computations where each of the computations does have a gradient. So we can apply the <strong>chain rule</strong> to compute everything. 
-NN 계산 시 chain rule을 사용함. 그리고 derivative를 직접 입력하지 않아도 됨-&gt;소프트웨어가 대신 해줌.</p>
<ul>
<li><strong>Automatic differentiation software</strong><ul>
<li>e.g. PyTorch, Tensorflow, Theano, Chainer, etc.</li>
<li>우리(사람)는 function f(x,w)만 프로그래밍 하면 됨</li>
<li>software가 automatically computes all derivatives</li>
<li>This is typically done by caching info during forward computation pass of f and then doing a bachward pass = &quot;<strong>backpropagation</strong>&quot;</li>
</ul>
</li>
</ul>
<h2 id="architectural-considerations">Architectural Considerations</h2>
<p>📌<strong>NN Architecture Considerations</strong>
-Data efficiency</p>
<ul>
<li>Sometimes we might need an infinitely large network or an extremely large amount of data to learn the weights</li>
<li>In this case we can encode knowledge we have of the world into the architecture of the neural network.
e.g.     <ul>
<li>Computer Vision: use convolutional networks = spatial translation invariance</li>
<li>Sequence processing(e.g.NLP): use recurrent networks = temporal invariance(the rules of language are same no matter where in the sequence you are)</li>
</ul>
</li>
</ul>
<p>-Optimization landscape/conditioning</p>
<ul>
<li>Depth over Width(which one is better? depends!)/Skip connections, Batch/Weight/Layer Normalization</li>
</ul>
<h2 id="cuda">CUDA</h2>
<p>📌<strong>Why did deep learning explosion kick off around 2013?</strong></p>
<ul>
<li>Bigger datasets</li>
<li>Good libraries for matrix computations on GPUs -&gt; NVIDIA</li>
</ul>
<p>📌<strong>Why are GPUs important?</strong></p>
<ul>
<li>All NN computations are just matrix multiplications, which are well parallellized into the many cores of a GPU.</li>
</ul>
<p>💡<strong>READING</strong>
<a href="http://neuralnetworksanddeeplearning.com/chap2.html">http://neuralnetworksanddeeplearning.com/chap2.html</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[jQuery Methods]]></title>
            <link>https://velog.io/@shining_arrow/jQuery-Methods</link>
            <guid>https://velog.io/@shining_arrow/jQuery-Methods</guid>
            <pubDate>Fri, 01 Apr 2022 16:41:36 GMT</pubDate>
            <description><![CDATA[<h3 id="💡jquery-메서드methods">💡jQuery 메서드(Methods)</h3>
<h4 id="📌메서드-종류와-대표적인-예시">📌메서드 종류와 대표적인 예시</h4>
<table>
<thead>
<tr>
<th>이펙트</th>
<th>클래스 제어</th>
<th>요소 탐색</th>
</tr>
</thead>
<tbody><tr>
<td>.show()</td>
<td>.addClass()</td>
<td>.children()</td>
</tr>
<tr>
<td>.hide()</td>
<td>.removeClass()</td>
<td>.parent()</td>
</tr>
<tr>
<td>.slideDown()</td>
<td>.toggleClass()</td>
<td>.siblings()</td>
</tr>
<tr>
<td>.slideUp()</td>
<td></td>
<td>.find()</td>
</tr>
<tr>
<td>.fadeIn()</td>
<td></td>
<td>.next()</td>
</tr>
<tr>
<td>.fadeOut()</td>
<td></td>
<td>.prev()</td>
</tr>
<tr>
<td>.stop()</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h4 id="📌보이기감추기-메서드">📌보이기/감추기 메서드</h4>
<table>
<thead>
<tr>
<th><strong>메서드</strong></th>
<th><strong>설명</strong></th>
</tr>
</thead>
<tbody><tr>
<td>.show()</td>
<td>선택요소 보이기</td>
</tr>
<tr>
<td>.hide()</td>
<td>선택요소 감추기</td>
</tr>
<tr>
<td>.toggle()</td>
<td>선택요소 보이기/감추기</td>
</tr>
<tr>
<td>.slideDown()</td>
<td>선택요소 서서히 보이기</td>
</tr>
<tr>
<td>.slideUp()</td>
<td>선택요소 서서히 감추기</td>
</tr>
<tr>
<td>.slideToggle()</td>
<td>선택요소 서서히 보이기/감추기</td>
</tr>
</tbody></table>
<h4 id="📌페이드fade효과-메서드">📌페이드(fade)효과 메서드</h4>
<table>
<thead>
<tr>
<th><strong>메서드</strong></th>
<th><strong>설명</strong></th>
</tr>
</thead>
<tbody><tr>
<td>.fadeIn(<em>지속시간</em>)</td>
<td>선택요소를 페이드로(서서히) 나타나게 하는 효과</td>
</tr>
<tr>
<td>.fadeOut(<em>지속시간</em>)</td>
<td>선택요소를 페이드로(서서히) 사라지게 하는 효과</td>
</tr>
<tr>
<td>.fadeToggle()</td>
<td>선택요소를 페이드로(서서히) 사라지고 나타나게 하는 효과</td>
</tr>
</tbody></table>
<p>▶️지속시간 e.g.: &quot;fast&quot;, &quot;slow&quot;, 500(500ms라는 의미), 2000(2s라는 의미)</p>
<h4 id="📌클래스-제어-메서드">📌클래스 제어 메서드</h4>
<p>▶️클래스 제어란?</p>
<ul>
<li>html에 클래스를 만들었는데 css에는 해당 선택자에 대한 코드가 없는 상태에서 jQuery를 통해 클래스를 강제로 넣거나 뺄 수 있는 효과.</li>
</ul>
<table>
<thead>
<tr>
<th><strong>메서드</strong></th>
<th><strong>설명</strong></th>
</tr>
</thead>
<tbody><tr>
<td>.addClass()</td>
<td>선택요소에 클래스 넣기</td>
</tr>
<tr>
<td>.removeClass()</td>
<td>선택요소에 클래스 빼기</td>
</tr>
<tr>
<td>.toggleClass()</td>
<td>선택요소에 클래스 넣고 빼기</td>
</tr>
</tbody></table>
<p>▶️클래스 제어 메서드 예시 코드</p>
<ul>
<li>HTML<pre><code class="language-html">&lt;body&gt;
  &lt;div class=”container”&gt;
      &lt;a class=”show-btn” href=”#none”&gt;보이기&lt;/a&gt;
      &lt;a class=”hide-btn” href=”#none”&gt;감추기&lt;/a&gt;
      &lt;a class=”toggle-btn” href=”#none”&gt;토글&lt;/a&gt;
      &lt;div&gt;Box&lt;/div&gt;
  &lt;/div&gt;
</code></pre>
</li>
</ul>
<pre><code>
- CSS

```css
.container{
    width: 300px;
}
a{
    background-color: red;
    color: #000;
    text-decoration:none;
    padding: 5px;
    width: 70px;
    display: inline-block;
    text-align: center;
}
    .container div{
    background-color: dodgerblue;
    width: 250px;
    height: 300px;
    margin-top: 10px;
    text-align: center;
    line-height: 300px;(복습:요소의 높이값만큼 line-height을 주면 가운데로 온다.)
}
.active(일반적으로 클래스를 넣고 뺄 때 사용하는 클래스명이다.){
    background-color:red;
} </code></pre><p>현재 html에는 active라는 클래스가 없기 때문에 위의 css코드에서 .active 부분을 포함해도 아무런 일이 일어나지 않는다. <br></p>
<p>이제 jQuery를 통해 active클래스를 넣고 빼 보자.</p>
<ul>
<li>JavaScript</li>
</ul>
<pre><code class="language-javascript">$(‘.add-btn’).click(function(){
    $(‘container div’).addClass(‘active’)
})
$(‘.remove-btn’).click(function(){
    $(‘container div’).removeClass(‘active’)
})
$(‘.toggle-btn’).click(function(){
    $(‘container div’).toggleClass(‘active’)
})
</code></pre>
<p>🤚<strong>주의사항</strong>: 
클래스 제어 메서드 3가지의 괄호 안에 .과 함께 클래스명을 쓰면 안된다. <br>css에서의 클래스 표기법, 그리고 잠시 후 나올 요소 탐색 메서드와 헷갈리지 말 것!</p>
<p>#</p>
<h4 id="📌요소-탐색-메서드">📌요소 탐색 메서드</h4>
<p>▶️요소 탐색이란?</p>
<ul>
<li>선택 요소를 기준으로 두고 목표하는 요소를 찾는 것이다.</li>
</ul>
<table>
<thead>
<tr>
<th><strong>메서드</strong></th>
<th><strong>설명</strong></th>
</tr>
</thead>
<tbody><tr>
<td>.children()</td>
<td>선택 요소의 바로 아래 단계인 자식 요소만 선택</td>
</tr>
<tr>
<td>.siblings()</td>
<td>선택 요소의 형제 요소를 선택</td>
</tr>
</tbody></table>
<p>▶️요소 탐색 메서드 예시 코드</p>
<ul>
<li>HTML<pre><code class="language-html">&lt;ul class=”menu”&gt;
  &lt;li&gt;
      &lt;a href=”#none”&gt;MENU-1&lt;/a&gt;
      &lt;div class=”sub-menu”&gt;
          &lt;a href=”#none”&gt;SUB-MENU-1&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-2&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-3&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-4&lt;/a&gt;
      &lt;/div&gt;
      &lt;a href=”#none”&gt;MENU-2&lt;/a&gt;
      &lt;div class=”sub-menu”&gt;
          &lt;a href=”#none”&gt;SUB-MENU-1&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-2&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-3&lt;/a&gt;
          &lt;a href=”#none”&gt;SUB-MENU-4&lt;/a&gt;
      &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>
</li>
</ul>
<pre><code>- CSS
```css
.menu{
    Padding: 0;
    List-style:none;
    Width:200px;
    Border: 1px solid red;
    Text-align:center;
}
.menu li&gt;a /*(menu밑의 li바로 아래의 a tag자식요소들만 선택한 것임)*/{
    Background-color: #000;
    Color: #fff;
    Display: block; /*(가로배치 되었던 요소들을 새로배치로 바꿈)*/
    Text-align:center; /*(가운데정렬)*/
    Padding: 5px;
}
.sub-menu{
    Border: 1px solid #000;
    Display:none; /*.sub menu a가 아니라 .sub-menu에 적용해야 한다.*/
}
.sub-menu a {
    Display:block;
    Padding: 5px;
}
</code></pre><ul>
<li>JavaScript<pre><code class="language-javascript">$(‘.menu li’).mouseenter(function(){
  $(this).children(‘.sub-menu’).stop().slideDown()
});
</code></pre>
</li>
</ul>
<p>$(‘.menu li’).mouseleave(function(){
    $(this).children(‘.sub-menu’).stop().slideUp()
});</p>
<pre><code>
🤚this란, 현재 선택된(이 경우 mouseenter로 선택된 바로 그 클래스)를 받아오는 것이다. 코드를 이렇게 짜면 MENU-1에 마우스를 올렸을 경우 MENU-1의 SUB-MENU들을, MENU-2에 마우스를 올렸을 경우 MENU-2의 SUB-MENU들을 slideDown하게 되는 것이다. 
🤚이 때 slideDown/slideUp을 해야하는 요소는 this 인 ‘.menu li’의 자식요소들이므로 .children()을 써야 한다. .children()의 괄호 사이에 아무것도 적지 않으면 .menu li의 모든 자식요소를 선택하라는 것이다. &lt;br&gt;sub-menu들만 선택하고 싶은 경우 .children(‘.sub-menu’)라고 구체적으로 작성해야 한다.

#


▶️선택 요소의 형제 요소 관리하기
:어떤 요소를 클릭하면 형제 요소들의 에니메이션은 제거하고 싶을 때 작성하는 코드 예시
- HTML
```html
&lt;div class=”btn”&gt;
    &lt;span class=”active”&gt;요소 1&lt;/span&gt;
    &lt;span&gt;요소 2&lt;/span&gt;
&lt;/div&gt;</code></pre><ul>
<li>CSS<pre><code class="language-css">.btn{
  Width:300px;
}
.btn span{
Background-color: #ccc;
Padding: 5px;
Width: 100px;
Display: inline-block;
Text-align: center;
Border-radius: 5px;
}</code></pre>
</li>
<li>JavaScript<pre><code class="language-javascript">$(‘.btn span’).click(function(){
  $(this).addClass(‘active’) /* . 없음 주의!!(위의 내용참고)*/
  $(this).siblings().removeClass(‘active’)
});</code></pre>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[jQuery Basics]]></title>
            <link>https://velog.io/@shining_arrow/jQuery-Basics</link>
            <guid>https://velog.io/@shining_arrow/jQuery-Basics</guid>
            <pubDate>Fri, 01 Apr 2022 16:02:26 GMT</pubDate>
            <description><![CDATA[<h3 id="💡jquery-링크하기">💡jQuery 링크하기</h3>
<h4 id="📌방식-1">📌방식 1</h4>
<p>마감 body tag 바로 위에 jQuery 오픈소스 파일과 내가 만드는 파일을 링크하기</p>
<pre><code>    &lt;script src=”script/jquery-1.12.4.js”&gt;&lt;/script&gt;
    &lt;script src=”script/custom.js”&gt;&lt;/script&gt;
&lt;/body&gt;</code></pre><p>이때, 오픈소스 파일이 내가 작성한 파일보다 항상 위에 있어야 한다.</p>
<h4 id="📌방식-2">📌방식 2</h4>
<p>htmld의 head 부분에 태그를 포함하기</p>
<p>#</p>
<h3 id="💡jquery-기본-구문-만들기-선택자">💡jQuery 기본 구문 만들기, 선택자</h3>
<p>  📌기본 구문</p>
<pre><code>$(&#39;선택자&#39;).함수(function(){
    실행 구문;
});</code></pre><p>📌선택자(selector)의 종류</p>
<ul>
  <li>CSS 클래스 선택자</li>
  <li>CSS 아이디 선택자</li>
  <li>CSS 태그 선택자</li>
  <li>this</li>
</ul>

<p>📌필수 함수(function) 종류</p>
<ul>
  <li>click</li>
  <li>mouseenter</li>
  <li>mouseleave</li>
</ul>

<p>📌필수 메서드(method) 종류</p>
<ul>
  <li>slideDown()</li>
  <li>slideUp()</li>
  <li>stop()</li>
  <li>show()</li>
  <li>hide()</li>
  <li>fadeIn()</li>
  <li>fadeout()</li>
  <li>addClass()</li>
  <li>removeClass()</li>
  <li>children()</li>
  <li>siblings()</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[CSS필수 가상클래스]]></title>
            <link>https://velog.io/@shining_arrow/CSS%ED%95%84%EC%88%98-%EA%B0%80%EC%83%81%ED%81%B4%EB%9E%98%EC%8A%A4</link>
            <guid>https://velog.io/@shining_arrow/CSS%ED%95%84%EC%88%98-%EA%B0%80%EC%83%81%ED%81%B4%EB%9E%98%EC%8A%A4</guid>
            <pubDate>Sat, 26 Mar 2022 08:47:27 GMT</pubDate>
            <description><![CDATA[<h3 id="💡마우스-오버-효과br마우스-오버-이펙트hover--트랜지션transition">💡마우스 오버 효과<br>(마우스 오버 이펙트(hover) &amp; 트랜지션(transition))</h3>
<p>📌마우스 오버 이펙트</p>
<pre><code class="language-css"> a{
 color: #000;
 transition: 0.5s;
 }

 a:hover{
 color: dodgerblue;
 text-decoration: underline;
 }</code></pre>
<ul>
  <li>hover이펙트를 주고 싶다면 tag 이름 뒤에 :hover를 적는다.</li>
<li>transition: n초동안 애니메이션 효과를 주라는 뜻이다.(주로 0.5s를 사용)<br>
  -transition속성은 :hover가 아닌 곳에 넣어야 마우스를 올리고 뺄 때 모두 적용된다.</li>
<li>a tag는 body tag의 color를 따르지 않으므로 따로 지정해주어야한다.</li>
<li>text-decoration: none; 해서 밑줄 없앨 수 있음</li>

  <li>jQuery 사용시 주의사항: ""안이 비어있으면 제이쿼리가 작동하지 않는다. 안에 쓸 내용이 정해지지 않았다면 #none을 적어두자.</li>

<pre><code class="language-html">&lt;a href = “#none”&gt;&lt;/a&gt;</code></pre>
 </ul>

<p>📌hover 사용 버튼 생성 예시</p>
<p>▶️html</p>
<pre><code class="language-html">&lt;a href = &quot;http://www.naver.com&quot;&gt;네이버&lt;/a&gt;</code></pre>
<p>▶️css</p>
<pre><code class="language-css">a{ 
    color: #333;
    text-decoration: none;
    border: 1px solid #ccc;
    width: 120px;
    display: inline-block;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    transition: 0.5s;
 }
  a:hover{
      background-color: #000;
    color: #fff;
 }</code></pre>
<h3 id="💡순서를-만드는-가상클래스">💡순서를 만드는 가상클래스</h3>
<p>📌목적: class name을 일일이 사용하지 않고 원하는 요소를 선택하고 싶을 때 사용한다.(간결한html, 짧은css를 위해)
e.g.) nth-child, nth-of-type</p>
<p>▶️html  </p>
<pre><code class="language-html">&lt;div classs = “box”&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>▶️css</p>
<pre><code class="language-css">.box{
    border: 5px solid #000;
    text-align: center;
}

.box div{
    border: 5px solid #000;
    margin: 10px;
    width: 200px;
    height: 200px;
    display: inline-block;
}
.box div:nth-child(2){
    color: red;
}</code></pre>
<ul>    
<li>text-align: center;을 부모요소에 넣어줘야 가운데로 간다. 또, 이 경우 margin auto는 절대 적용되지 않는다.
<li>nth child는 tag의 종류를 가리지 않아서 여러 개의 div들 위에 갑자기 h2 태그를 추가하면 요소가 하나씩 밀린다. 
따라서 이럴땐 .box div:nth-of-type()사용한다. 그러면 css가 해당 요소의 type을 확인한다. 
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[CSS box model]]></title>
            <link>https://velog.io/@shining_arrow/CSS-box-model</link>
            <guid>https://velog.io/@shining_arrow/CSS-box-model</guid>
            <pubDate>Sat, 26 Mar 2022 08:00:48 GMT</pubDate>
            <description><![CDATA[<h3 id="💡css박스모델">💡css박스모델</h3>
<h4 id="📌box-model">📌Box model</h4>
<ul>

  <li>border-style: 테두리 스타일 지정</li>
-value: solid dashed dotted double groove inset outset
  <li>border-width: 테두리 두께 지정(주로 px로 넣음)</li>
-value: px % thin medium thick
  <li>border-color: 테두리 색상 지정</li>
value: color<br>
-한번에 여러 테두리 속성을 할당할 때는 다음과 같은 식으로 작성한다. 각 속성을 쓰는 순서는 상관이 없다. 


<pre><code class="language-css"> border: 2px solid blue;</code></pre>
<p>-border 의 디폴트 상태는 none이다. 따라서 border-bottom 이나 border-top을 사용하면 해당 부분에만 border가 생기게 된다. 그냥 border만을 작성하면 상하좌우 모든 부분에 경계가 생긴다.</p>
<p>-border-bottom: none; 을 사용하면 border-bottom이 border를 덮어써서 border-bottome만 border가 사라지게 된다.</p>
  <li>border-radius: 엘리먼트 코너 둥글게 하기</li>
value: px %
(%도 꽤 자주 씀)<br>
코너를 개별적으로 둥글게 하는 방법:<br>

<pre><code class="language-css">border-top-left-radius: px %;
border-top-left-radius: px %;
border-top-left-radius: px %;
border-top-left-radius: px %;</code></pre>
<p>  다른 방법:</p>
<pre><code class="language-css">border-radius: - - - -;</code></pre>
<p>-4가지 값: 좌상-&gt;우상-&gt;우하-&gt;좌하 방향.
-1가지 값: 모든 모서리에 적용
-float-left: box들을 가로배치할 때 사용한다.</p>
</ul>

<h4 id="📌margin-padding-속성의-크기-지정">📌Margin, padding 속성의 크기 지정</h4>
<ol>
<li>크기 값을 사용하는 경우: 양쪽에 동일한 크기 값이 적용
2.
두 개의 크기 값을 사용하는 경우: 위쪽 및 아래쪽, 왼쪽 및 오른쪽</li>
<li>크기 값 4개: 상, 우, 하, 좌 순서(top, right, left, bottom)
#</li>
</ol>
<li>padding, border를 적용함에 따라 너비가 늘어나는 것을 방지하고 싶은 경우: </li>

<pre><code class="language-css">box-sizing: border-box;</code></pre>
<h4 id="📌그림자-효과">📌그림자 효과</h4>
<ul>
  <li>
    속성: box-shadow: inset [offset-x offset-y blur color] </li>
  -4가지 요소를 모두 써야함(필수)<br>
  -그림자 효과 예시<br>     

<pre><code>box-shadow: 5px 5px 20px black;
box-shadow: 0px 0px 20px red;
box-shadow: 10px 10px 0 blue;
box-shadow: inset 0px 0px 100px black;</code></pre><p> -inset 값을 주면 shadow가 안쪽으로 퍼진다.
    ▶️offset-x: 수평 그림자의 offset값(+값이 증가할수록 왼-&gt;오 이동하는 것)
    ▶️offset-y: 수직 그림자의 offset값(+값이 증가할수록 위-&gt;아래 이동하는 것)
    ▶️blur: 그림자 가장자리를 부드럽게 처리하는 정도(기본값 o)
    ▶️color: 색상 지정
    ▶️inset: 안쪽 그림자</p>
  <li>속성: text-shadow: [offset-x offset-y blur-radius color]</li>
▶️text-shadow는 감싸고 있는 박스가 있더라도 텍스트 자체에 shadow를 준다.<br>
▶️offset-x: 그림자의 수평 거리를 정합니다.(필수)<br>
▶️offset-y: 그림자의 수직 거리를 정합니다.(필수)<br>
▶️blur-radius: 흐림 정도를 정합니다. (선택: 값을 정하지 않으면 o)<br>
 ▶️color: 색상을 정합니다. (t선택: 값을 정하지 않으면 텍스트 색상)<br>
▶️하나의 텍스트에 여러 개의 text shadow를 넣을 수 있다. 단, 두개의 크기가 같으면 중첩되어 보이지 않으니 주의한다. <br>


<pre><code class="language-css">text-shadow: 5px 5px 0 dodgerblue, 10px 10px 0 red;</code></pre>
<p>▶️text shadow는 inset을 쓸 수 없다. </p>
  </ul>

<p>#</p>
<h3 id="💡html의-인라인요소-블록요소-인라인블록-중요">💡HTML의 인라인요소, 블록요소, 인라인블록 (중요!!)</h3>
<h4 id="📌인라인-요소-텍스트-서식을-만드는-대부분의-요소">📌인라인 요소: 텍스트 서식을 만드는 대부분의 요소</h4>
<ul>
  <li>한 줄에 여러개 배치</li>
  <li>기본 너비값은 컨텐츠의 너비값</li>
  <li>크기값을 가질 수 없음</li>
  <li>상하 마진은 가질 수 없음</li>
  <li>span, a, small, big, em, u, s, del, br, q, b, strong, mark, sub, sup, video, audio</li>
</ul>

<p>▶️크기값을 가질 수 없어서 width와 height값을 임의로 설정해도 작동하지 않는다.</p>
<h4 id="📌블록-요소-레이아웃을-잡는-요소">📌블록 요소: 레이아웃을 잡는 요소</h4>
<ul>
  <li>한 줄에 한개만 배치</li>
  <li>기본 너비값은 100%</li>
  <li>크기값을 가질 수 있음</li>
  <li>상하좌우 마진을 가질 수 있음</li>
  <li>div, table, figure, figcaption, header, nav, footer, section, article, aside, p, blockquote, ul, ol, li, td, th, form, hr, h1~h6</li>
</ul>

<p>▶️기본 너비값이 100%이므로 width: 100%는 따로 넣어줄 필요가 없다.
▶️한 줄에 하나만 배치 가능!!! 두 개가 한 줄에 배치될 수 없다. </p>
<h4 id="📌인라인-블록-요소-인라인요소와-블록요소의-특징을-둘-다-가짐">📌인라인 블록 요소: 인라인요소와 블록요소의 특징을 둘 다 가짐.</h4>
<ul>
  <li>한 줄에 여러개 배치</li>
  <li>기본 너비값은 컨텐츠의 너비값</li>
  <li>크기값을 가질 수 있음</li>
  <li>상하 마진은 가질 수 있음</li>
  <li>img, input태그들, button, fontawesome</li>
</ul>

<h4 id="📌태생과-다른-요소로-변환-display-속성-사용">📌태생과 다른 요소로 변환: display 속성 사용</h4>
<ul>
  <li>display 속성에 주로 사용하는 값: block, inline-block, inline, none, flex</li>
<li>inline인 a tag를 block 속성으로 강제로 바꿀 수 있음: 

<pre><code class="language-css">a{
    color: red;
    text-decoration: none;
    border: 1px solid red;
    display: block;
    width: 300px;
    margin:5px;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
}</code></pre>
<p>▶️a tag를 block요소로 바뀌었기 때문에 이제부터는 width와 margin을 얼마든지 넣을 수 있다.
▶️버튼을 만들었는데 세 개를 나란히 배치하고 싶다면? : 여기서 display를 inline-block;으로 바꾼다.</p>
</ul>


<p>#</p>
<h3 id="💡css로-가로-배치하기float">💡CSS로 가로 배치하기(float)</h3>
<h4 id="📌float-속성">📌float 속성</h4>
<ul>
  <li>float속성은 inline/block/inline-block에 모두 적용된다.</li>
<li>margin-auto는 block요소에만 적용된다. (inline 및 inline-block에는 적용되지 않음)</li>
<li>css 레이아웃을 하는 경우 부모요소에는 높이값을 주지 않는다. 자식요소에만 주고 자식이 늘어나면 자연스럽게 부모도 늘어난다.</li>

<p>(사진2)</p>
<li>Float: none; 이더라도 왼쪽으로 배치되었지만 float:left;는 아니다.
<li>html요소는 기본적으로 위치를 조정하지 않으면 왼쪽에 붙는다.
<li>자식요소에 float값을 주면 부모요소가 늘어나지 않는 이유: 자식요소에 float 속성이 사용되면 부모요소는 자식요소가 없다고 판단해 높이값을 잃는다. 높이값을 찾아주려면<br> 1)부모의 height값을 자식 크기에 맞게 주거나<br> 2)overflow: hidden; 을 사용한다. <br>전자는 자식요소 크기가 바뀔떄마다 바꿔줘야 한다는 단점이 있다. 
<li>span에도 float-left; 등이 적용된다.

 </ul>]]></description>
        </item>
        <item>
            <title><![CDATA[Basic CSS Overview]]></title>
            <link>https://velog.io/@shining_arrow/Basic-CSS-Overview</link>
            <guid>https://velog.io/@shining_arrow/Basic-CSS-Overview</guid>
            <pubDate>Fri, 25 Mar 2022 15:04:13 GMT</pubDate>
            <description><![CDATA[<h3 id="💡css-기본-문법">💡CSS 기본 문법</h3>
<ul>
  <li>selector</li>
  <li>property 혹은 attribute</li>
  <li>value</li>

<pre><code class="language-css">selector{
  property1: value1;
  property2: value2;
}</code></pre>
  <li>CSS작성 팁: html의 계층 구조에 따라 css를 순서대로 작성한다.
</ul>

<h3 id="💡css선택자">💡CSS선택자</h3>
<h4 id="선택자-종류">&lt;선택자 종류&gt;</h4>
<p>📌태그 선택자</p>
<pre><code class="language-css">p{
    text-align: center;
    color: red;
}</code></pre>
<p>📌클래스 선택자(.)</p>
<pre><code class="language-css">.center{
    text-align: center;
    color: red;
}</code></pre>
<p>📌아이디 선택자(#)</p>
<pre><code class="language-css">#center{
    text-align: center;
    color: red;
}</code></pre>
<p>📌태그와 함께 쓰는 선택자</p>
<pre><code class="language-css">p.center{
    text-align: center;
    color: red;
}</code></pre>
<p>▶️p태그 선택자와 .center 클래스 선택자를 함께 쓴 것이다. 
p태그 중 center 클래스를 가지는 것에만 스타일이 적용된다.</p>
<p>📌그룹 선택자
두 개의 선택자의 css코드가 완벽히 일치하면 다음과 같이 표현할 수 있다:</p>
<pre><code class="language-css">h1, p{
    text-align: center;
    color: red;
}</code></pre>
<p>📌하위 선택자
p 태그 안에 들어있는 태그에 스타일을 적용하고 싶을 때 사용한다.
(이 경우 p태그의 하위 요소인 span 태그에 적용하고 싶을 때)</p>
<pre><code class="language-css">p span{
    text-align: center;
    color: red;
}</code></pre>
<p>📌전체 선택자(global selector)
html의 모든 요소를 선택할 때 사용한다. (대부분의 경우 사용하지 않음)</p>
<pre><code class="language-css">*{
    Font-size: 14px;
    Line-height: 24px;
}
</code></pre>
<p>📌css주석
원하는 부분을 선택한 후 ctrl + / 누르면 주석이 생성된다. 다시 누르면 주석이 해제된다.
Indent를 유지하면서 주석을 달고 싶은 경우 ctrl+shift+ / 누른다.</p>
<pre><code class="language-css">/*This is a single-line comment*/</code></pre>
<p>📌html 주석</p>
<pre><code class="language-html">&lt;!--주석내용--&gt;</code></pre>
<h3 id="💡css적용-우선순위">💡CSS적용 우선순위</h3>
<ol>
<li>!important Style-css 속성 끝에 작성</li>
<li>Inline style –html에 작성</li>
<li>ID selector style</li>
<li>class selector style</li>
<li>tag selector style<blockquote>
<p>css 코드 작성 순서에 관계없이 위의 위계를 따라 스타일이 적용된다.</p>
</blockquote>
</li>
</ol>
<p>▶️내용이 요소의 크기를 벗어났을 때 감추기</p>
<pre><code class="language-css">overflow: hidden; </code></pre>
<p>#</p>
<p>▶️스크롤할 때 배경 이미지 부착 여부를 지정: 움직이지 않고 고정</p>
<pre><code class="language-css">background-attachment: fixed;</code></pre>
<h3 id="💡css-기본-서식-스타일">💡CSS 기본 서식 스타일</h3>
<ul>
  <li>font-size: 텍스트의 크기 지정<br>
    -value: px em pt % rem<br>
      -rem은 반응형 웹 만들 때 사용한다.


  <li>font-weight: 글꼴 두께<br>
    -100-900 bold bolder lighter normal(400=normal, 700=bold)<br>
       -기본적으로 굵은 글씨체를 원래대로 얇게 만들려면 font-weight: normal; 

<pre><code class="language-css">font-weight: normal;</code></pre>
  <li>line-height: 줄 간격을 지정하는 특성 </li>
  -일반적으로 em 단위를 사용(1.6em 가장 많이 사용)한다.<br>
  -보통 body 태그에 포함한다.<br>
  -value: px em pt % rem(rem은 반응형 웹 만들 때 사용)
  <li>font-family: 글꼴을 지정하는 속성</li>
  -value: font name<br>
  <li>font-style: 문자 스타일(ex. 기울림체)</li>
  -value: normal italic oblique<br>
  <li>color: 글꼴 색을 지정하는 속성</li>
  -value: color name #000000 rgb(0,0,0) rgba(0,0,0,0.5)<br>
    -rgba의 마지막은 투명도를 지정하는 요소이다.
  <li>text-decoration: 텍스트 줄 표시/제거</li>
  -text-decoration: none; 을 사용해 기본적으로 밑줄이 쳐서 나타나는 a tag의 밑줄을 없앨수도 있다.<br>
  -value: none underline(밑줄), overline(윗줄), line-through(취소선)<br>
  <li>text-transform: 텍스트를 대문자 및 소문자로 변환</li>
  -value: none capitalize(단어의 첫글자를 대문자화), uppercase(모든 글자 대문자화), lowercase(모든 글자 소문자화)<br>
  <li>text-align: 문자 정렬 방법을 지정하는 속성</li>
  -value: center left right justify(양쪽을 균등하게 배치)<br>
  <li>text-shadow: 텍스트 그림자 효과</li>
  -value(1): x축 거리,y축 거리, 퍼짐 거리 정도, 색상 <br>
    ▶️값 4개 모두 지정해야 함<br>
  -value(2): none<br>

<li>list style: list의 bullet point를 프로그래머가 원하는 아이콘으로 넣을 수 있다.</li>

<p>▶️before 가상클래스를 사용해 원하는 bullet-point 넣기</p>
<pre><code class="language-css">.class li:before{
    Content: ‘임티’;
} </code></pre>
</ul>


<h3 id="💡html-부모요소-vs-자식요소-css-자손선택자-vs-자식선택자">💡HTML 부모요소 vs 자식요소, CSS 자손선택자 vs 자식선택자</h3>
<ul>
  <li>자식은 바로 밑의 요소인 것이다. 그보다 하위 요소는 '자식'이 아닌 '자손'이다.</li>
 <li>자손선택자는 스페이스 사용, 자식선택자는 >(child selector)사용
 <li>자손선택자는 해당 하위 요소 전체를 가리킨다. 
 <li>바로 아래 계층의 자식만을 선택하고 싶다면 >를 선택해야 한다.<br>
▶️  html 

<pre><code class="language-html">&lt;div class=”box”&gt;
    &lt;div&gt;
        &lt;div&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>▶️css</p>
<pre><code>.box{
    Border: 1px solid red;
    Width: 400px;
    Height: 400px;
}
.box &gt; div{
    Border: 1px solid blue;
    Width: 200px;
    Height: 200px;
    Padding: 20px;
}
.box &gt; div div{
    Width: 50px;
    Height: 50px;
    Background-color: #000;
}</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[Basic HTML Overview]]></title>
            <link>https://velog.io/@shining_arrow/Basic-HTML-Overview</link>
            <guid>https://velog.io/@shining_arrow/Basic-HTML-Overview</guid>
            <pubDate>Mon, 21 Mar 2022 13:15:27 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p>인프런의 HTML+CSS+JS 실전 퍼블리싱 강의를 듣고 정리한 게시물입니다.</p>
</blockquote>
<h3 id="💡html5-핵심-태그-사용법문단-텍스트-서식">💡HTML5 핵심 태그 사용법(문단, 텍스트 서식)</h3>
<ul>
  <li> 제목 표시하기: h1~h6 </li>
  <li> 문단, 줄 바꿈: p, br </li>
  <li> 글자 굵게 표시하기: b, strong </li>
          -strong만 시각장애인에게 '강조하라는 의미'가 전달된다.
  <li> 글자 <em>기울림</em> 표시하기: em, i </li>
  <li> 글자 <u>밑줄</u> 표시하기: u </li>
  <li> 글자 취소선 표시하기: s, del </li>
          -del만 시각장애인에게 '취소선' 의미가 전달된다.
  <li> 큰 글자, 작은 글자 표시하기: big, small </li>
          -html기본 폰트 크기는 16pixel인데, 이 기본 pixel을 기준으로 조금 크게
          조금 작게 만든다.
  <li> 위 첨자, 아래 첨자: sup, sub </li>
  -순서(1<sup>st</sup>)나 화학식(H<sub>2</sub>O) 표현할 때 사용된다.
  <li> 형광펜 배경색 글자: mark </li>
  <li> 수평선 넣기: hr </li>
  <li>html은 대소문자 구분을 하지 않는다.  </li>  
</ul>  

<br>

<h3 id="💡목록-만들기">💡목록 만들기</h3>
<ul>
  <li>순서가 있는 목록: ol(ordered list) > li</li>
  <li>순서가 없는 목록: ul(unordered list) > li</li>
      -대부분 ul을 사용한다.
  <li>중첩된 목록을 만드는 경우에는 부모 리스트의 마감 태그 안쪽에 중첩된 자식 리스트를 작성해야 한다. <br>


<blockquote>
<pre><code></code></pre></blockquote>
<ol>
        <li>방콕 쇼핑 리스트</li>
        <li>방콕에서 반드시 들러야 할 베스트
            <ul>
                <li>씨암(Siam)</li>
                <li>카오산 로드(Khaosan Road)</li>
            </ul>
        </li>
        <li>방콕 맛집 리스트</li>
        <li>방콕 관광 리스트</li>
    </ol>
```

</ul>

<br>

<h3 id="💡링크-이미지">💡링크, 이미지</h3>
<ul>
  <li>외부 링크나 파일 링크하기: a(anchor tag)</li>  



<p>  ▶️링크를 클릭하면 현재 페이지에서 바로 링크 걸린 페이지로 넘어가게 하기</p>
<blockquote>
<pre><code class="language-html">&lt;a href=&quot;http://www.naver.com&quot;&gt;Naver&lt;/a&gt;</code></pre>
</blockquote>
<pre><code>
  ▶️링크를 클릭하면 새 페이지에서 링크 걸린 페이지 열기 (target=&quot;_blank&quot;)
&gt;   ```
  &lt;a href=&quot;http://www.naver.com&quot; target=&quot;_blank&quot;&gt;Naver&lt;/a&gt;</code></pre><p>  ▶️링크에 마우스를 올리면 글씨가 나타나게 하기</p>
<blockquote>
<pre><code>&lt;a href=&quot;http://www.naver.com&quot; title=&quot;네이버 사이트로 이동&quot;&gt;Naver&lt;/a&gt;</code></pre></blockquote>
<pre><code>

  &lt;li&gt;이미지 첨부하기: img&lt;/li&gt;


&gt;   ```html
&lt;img src=&quot;http://placecorgi.com&quot; alt=&quot;an adorable puppy&quot;&gt;</code></pre><pre><code>  +) img는 마감 태그가 없다!</code></pre> <li>이미지를 a 태그로 감싸기

<blockquote>
<pre><code>   &lt;a href=&quot;http://www.naver.com&quot;&gt;&lt;img src=&quot;http://placecorgi.com&quot; alt=&quot;an adorable puppy&quot;&gt;&lt;/a&gt;</code></pre></blockquote>
<p>```</p>
</ul>]]></description>
        </item>
    </channel>
</rss>