# บทนำสู่ปัญญาประดิษฐ์ ## Introduction to Artificial Intelligence **ผู้จัดทำ:** อรรถพล คงหวาน --- # Outline 1. ความหมายและนิยามของปัญญาประดิษฐ์ 2. ประวัติและวิวัฒนาการของ AI 3. สาขาต่าง ๆ ของ AI 4. ประเภทของ AI: Weak AI vs Strong AI 5. ตัวแทนอัจฉริยะและสิ่งแวดล้อม 6. จริยธรรมและผลกระทบของ AI 7. เครื่องมือและการเตรียมความพร้อม 8. สรุปโดยรวม --- # 1. ความหมายและนิยามของปัญญาประดิษฐ์ ## Definition of AI --- ## ปัญญาประดิษฐ์คืออะไร? **ปัญญาประดิษฐ์ (Artificial Intelligence: AI)** คือ สาขาวิชาทางวิทยาการคอมพิวเตอร์ที่มุ่งเน้นการสร้างระบบหรือเครื่องจักรที่สามารถแสดงพฤติกรรมอัจฉริยะ โดยสามารถ: - **รับรู้ (Perceive)** สิ่งแวดล้อม - **เรียนรู้ (Learn)** จากประสบการณ์ - **ตัดสินใจ (Decide)** - **กระทำ (Act)** เพื่อบรรลุเป้าหมาย --- ## 4 แนวทางหลักในการนิยาม AI | แนวทาง | คำอธิบาย | ตัวอย่าง | |--------|----------|----------| | **Thinking Humanly** | ระบบที่คิดเหมือนมนุษย์ | Cognitive Science, Neural Networks | | **Thinking Rationally** | ระบบที่คิดอย่างมีเหตุผล | Logic-based AI, Expert Systems | | **Acting Humanly** | ระบบที่กระทำเหมือนมนุษย์ | Turing Test, Chatbots | | **Acting Rationally** | ระบบที่กระทำอย่างมีเหตุผล | Rational Agents, Optimization | --- ## การทดสอบทัวริง (Turing Test) **Alan Turing** เสนอในปี 1950 > หากมนุษย์ไม่สามารถแยกแยะได้ว่ากำลังสนทนากับมนุษย์หรือเครื่องจักร แสดงว่าเครื่องจักรนั้นผ่านการทดสอบ ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#98971a', 'tertiaryColor': '#d79921', 'primaryTextColor': '#ebdbb2', 'secondaryTextColor': '#282828'}}}%% flowchart LR A["ผู้ถาม"] -->|"ส่งคำถาม"| B["หน้าจอ"] B -->|"รับคำตอบ"| A C["มนุษย์"] -->|"ตอบ"| B D["เครื่องจักร"] -->|"ตอบ"| B ``` --- ## ความสามารถที่ต้องมีเพื่อผ่าน Turing Test - **การประมวลผลภาษาธรรมชาติ (NLP)** - สื่อสารเป็นภาษามนุษย์ได้ - **การแทนความรู้ (Knowledge Representation)** - จัดเก็บข้อมูลและความรู้ - **การให้เหตุผลอัตโนมัติ (Automated Reasoning)** - ใช้ความรู้ตอบคำถามและหาข้อสรุป - **การเรียนรู้ของเครื่อง (Machine Learning)** - ปรับตัวจากประสบการณ์ --- # 2. ประวัติและวิวัฒนาการของ AI ## History and Evolution of AI --- ## ไทม์ไลน์การพัฒนา AI (ภาพรวม) ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#98971a', 'tertiaryColor': '#d79921'}}}%% flowchart LR A["ยุคบุกเบิก
1943-1956"] --> B["ยุคทอง
1956-1974"] B --> C["AI Winter
1974-1993"] C --> D["ยุคฟื้นฟู
1993-2011"] D --> E["ยุคปัจจุบัน
2012-Now"] ``` --- ## ยุคบุกเบิก (1943-1956) | ปี | เหตุการณ์ | ความสำคัญ | |----|----------|-----------| | 1943 | McCulloch-Pitts Model | โมเดลคณิตศาสตร์แรกของเซลล์ประสาท | | 1950 | Turing Test | มาตรฐานการวัดความฉลาดของเครื่อง | | 1956 | Dartmouth Conference | **กำเนิดคำว่า AI** อย่างเป็นทางการ | --- ## ยุคทอง (1956-1974) | ปี | เหตุการณ์ | ความสำคัญ | |----|----------|-----------| | 1958 | LISP | ภาษาโปรแกรมสำหรับ AI โดย John McCarthy | | 1966 | ELIZA | Chatbot ตัวแรก | | 1969 | SHAKEY | หุ่นยนต์เคลื่อนที่ตัวแรก | --- ## ยุค AI Winter (1974-1993) - **1974:** ขาดเงินทุน ผลลัพธ์ไม่เป็นไปตามคาด - **1980s:** Expert Systems (ระบบผู้เชี่ยวชาญ) ได้รับความนิยม - **1987:** AI Winter ครั้งที่ 2 - ตลาดล่มสลาย > ช่วงเวลาที่ความสนใจและเงินทุนสำหรับ AI ลดลงอย่างมาก --- ## ยุคฟื้นฟู (1993-2011) | ปี | เหตุการณ์ | ความสำคัญ | |----|----------|-----------| | 1997 | Deep Blue vs Kasparov | AI ชนะแชมป์หมากรุกโลก | | 2006 | Deep Learning | Geoffrey Hinton ฟื้นคืนชีพ Neural Networks | | 2011 | IBM Watson | ชนะ Jeopardy! | --- ## ยุคปัจจุบัน (2012-Now) | ปี | เหตุการณ์ | ความสำคัญ | |----|----------|-----------| | 2012 | AlexNet | การปฏิวัติ Deep Learning ใน Image Recognition | | 2016 | AlphaGo | ชนะแชมป์โกะระดับโลก | | 2017 | Transformer | สถาปัตยกรรมพื้นฐานของ LLMs | | 2022 | ChatGPT | AI สนทนาเข้าถึงมวลชน | | 2024 | AI Agents | Multimodal AI | --- # 3. สาขาต่าง ๆ ของ AI ## Branches of AI --- ## ภาพรวมสาขาของ AI ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#98971a'}}}%% mindmap root((AI)) Machine Learning Computer Vision NLP Robotics Expert Systems Speech Recognition ``` --- ## Machine Learning (ML) **การเรียนรู้ของเครื่อง** คือ สาขาย่อยของ AI ที่มุ่งเน้นการพัฒนาอัลกอริทึมที่สามารถ: - **เรียนรู้รูปแบบ (Pattern)** จากข้อมูล - **ทำนาย (Predict)** หรือตัดสินใจ - โดย **ไม่ต้องเขียนโปรแกรมอย่างชัดเจน** --- ## ประเภทหลักของ Machine Learning | ประเภท | คำอธิบาย | ตัวอย่าง | |--------|----------|----------| | **Supervised Learning** | เรียนรู้จากข้อมูลที่มี Label | Classification, Regression | | **Unsupervised Learning** | ค้นหารูปแบบจากข้อมูลไม่มี Label | Clustering, Dimensionality Reduction | | **Reinforcement Learning** | เรียนรู้จากการลองผิดลองถูก | Game AI, Robotics | --- ## ตัวอย่าง: Classification ด้วย scikit-learn ```python from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import accuracy_score # โหลดข้อมูล Iris Dataset iris = load_iris() X, y = iris.data, iris.target # แบ่งข้อมูล 80% train, 20% test X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42) # สร้างและฝึกโมเดล model = DecisionTreeClassifier(max_depth=3) model.fit(X_train, y_train) # วัดความแม่นยำ accuracy = accuracy_score(y_test, model.predict(X_test)) print(f"ความแม่นยำ: {accuracy:.2%}") ``` --- ## Computer Vision **การมองเห็นด้วยคอมพิวเตอร์** คือ สาขาที่ทำให้คอมพิวเตอร์สามารถ **ตีความและเข้าใจภาพ** หรือวิดีโอ งานหลัก: - **Image Classification** - จำแนกประเภทภาพ - **Object Detection** - ตรวจจับและระบุตำแหน่งวัตถุ - **Semantic Segmentation** - แบ่งส่วนภาพตามความหมาย - **Face Recognition** - จดจำใบหน้า - **OCR** - อ่านตัวอักษรจากภาพ --- ## ตัวอย่าง: Edge Detection ด้วย OpenCV ```python import cv2 def detect_edges(image_path, threshold1=100, threshold2=200): """ตรวจจับขอบภาพด้วย Canny Edge Detection""" # อ่านภาพเป็น Grayscale image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) # ลด Noise ด้วย Gaussian Blur blurred = cv2.GaussianBlur(image, (5, 5), 0) # ตรวจจับขอบด้วย Canny Algorithm edges = cv2.Canny(blurred, threshold1, threshold2) return edges ``` --- ## Natural Language Processing (NLP) **การประมวลผลภาษาธรรมชาติ** คือ สาขาที่ทำให้คอมพิวเตอร์สามารถ **เข้าใจ ตีความ และสร้างภาษามนุษย์** ได้ ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#98971a', 'tertiaryColor': '#d79921'}}}%% flowchart LR A["ข้อความดิบ"] --> B["Tokenization"] B --> C["Preprocessing"] C --> D["Feature Extraction"] D --> E["Model"] E --> F["Output"] ``` --- ## งานหลักใน NLP - **Text Classification** - จำแนกหมวดหมู่ข้อความ - **Sentiment Analysis** - วิเคราะห์ความรู้สึก - **Named Entity Recognition (NER)** - ระบุชื่อเฉพาะ - **Machine Translation** - แปลภาษา - **Question Answering** - ตอบคำถาม - **Text Summarization** - สรุปข้อความ --- ## Robotics (หุ่นยนต์) **Robotics** คือ สาขาที่ผสมผสาน AI กับวิศวกรรมเครื่องกล เพื่อสร้าง **เครื่องจักรอัตโนมัติ** องค์ประกอบหลัก: - **Perception (การรับรู้)** - เซ็นเซอร์, กล้อง, LiDAR - **Planning (การวางแผน)** - Path Planning, Motion Planning - **Control (การควบคุม)** - Actuators, Motors - **Learning (การเรียนรู้)** - ปรับตัวจากประสบการณ์ --- # 4. ประเภทของ AI ## Weak AI vs Strong AI --- ## Narrow AI (Weak AI) **AI แบบแคบ** คือ ระบบที่ถูกออกแบบและฝึกมาเพื่อทำ **งานเฉพาะทาง** เพียงอย่างเดียว ตัวอย่าง: - **Siri, Alexa, Google Assistant** - ผู้ช่วยเสียง - **Netflix, YouTube Recommendations** - ระบบแนะนำ - **Tesla Autopilot** - ระบบขับขี่อัตโนมัติ - **ChatGPT, Claude** - ระบบสนทนา - **DeepL, Google Translate** - แปลภาษา --- ## General AI (Strong AI / AGI) **Artificial General Intelligence (AGI)** คือ ระบบ AI สมมติที่มีความสามารถทาง **สติปัญญาเทียบเท่ามนุษย์** - สามารถเรียนรู้และทำงานได้ **ทุกประเภท** - ถ่ายโอนความรู้ข้ามโดเมนได้ - มีความเข้าใจเชิงลึก - **ยังไม่มีอยู่จริงในปัจจุบัน** --- ## เปรียบเทียบ Narrow AI vs General AI | ลักษณะ | Narrow AI | General AI | |--------|-----------|------------| | ขอบเขตงาน | งานเฉพาะทาง | งานทั่วไปทุกประเภท | | การเรียนรู้ | จำกัดเฉพาะโดเมน | ถ่ายโอนความรู้ข้ามโดเมน | | ความเข้าใจ | ไม่มีความเข้าใจจริง | มีความเข้าใจเชิงลึก | | จิตสำนึก | ไม่มี | อาจมี (ยังเป็นที่ถกเถียง) | | สถานะ | **มีอยู่ในปัจจุบัน** | **ยังไม่มีอยู่จริง** | --- ## Super AI (ASI) **Artificial Superintelligence (ASI)** คือ แนวคิดเชิงทฤษฎีของ AI ที่มีความฉลาด **เหนือกว่ามนุษย์ทุกด้าน** ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#98971a', 'secondaryColor': '#d79921', 'tertiaryColor': '#cc241d'}}}%% flowchart TB A["Narrow AI (ANI)
งานเฉพาะทาง"] --> B["General AI (AGI)
เทียบเท่ามนุษย์"] B --> C["Super AI (ASI)
เหนือมนุษย์"] D["เราอยู่ที่นี่ ➡️"] -.-> A ``` --- # 5. ตัวแทนอัจฉริยะและสิ่งแวดล้อม ## Intelligent Agents and Environment --- ## นิยามของตัวแทน (Agent) **ตัวแทน (Agent)** คือ สิ่งใดก็ตามที่สามารถ: - **รับรู้ (Perceive)** สิ่งแวดล้อมผ่านเซ็นเซอร์ - **กระทำ (Act)** ต่อสิ่งแวดล้อมผ่านแอคชูเอเตอร์ **ตัวแทนอัจฉริยะ (Intelligent Agent)** คือ ตัวแทนที่กระทำอย่าง **มีเหตุผล (Rational)** เพื่อบรรลุเป้าหมายที่ดีที่สุด --- ## โครงสร้างของตัวแทน ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#d79921', 'tertiaryColor': '#cc241d'}}}%% flowchart LR subgraph Environment E["สถานะโลก"] end subgraph Agent S["Sensors"] --> P["Percepts"] P --> D["Decision"] D --> A["Actions"] A --> Act["Actuators"] end E -->|"รับรู้"| S Act -->|"กระทำ"| E ``` --- ## Agent Function ฟังก์ชันของตัวแทน (Agent Function) สามารถแสดงได้ดังนี้:
f
:
P
∗
→
A
โดยที่: - **f** = ฟังก์ชันตัวแทน (Agent Function) - **P*** = ลำดับของการรับรู้ทั้งหมด (Percept Sequence) - **A** = การกระทำ (Action) --- ## Agent Structure **Agent = Architecture + Program** | องค์ประกอบ | คำอธิบาย | ตัวอย่าง | |------------|----------|----------| | **Architecture** | แพลตฟอร์มทางกายภาพ | คอมพิวเตอร์, หุ่นยนต์, สมาร์ทโฟน | | **Program** | ซอฟต์แวร์ที่ทำให้เกิดพฤติกรรม | อัลกอริทึม AI, โมเดล ML | --- ## ประเภทของตัวแทน (Types of Agents) ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#98971a', 'secondaryColor': '#689d6a', 'tertiaryColor': '#458588'}}}%% flowchart TB A["Simple Reflex
ตอบสนองอย่างง่าย"] --> B["Model-Based
มีโมเดลภายใน"] B --> C["Goal-Based
มีเป้าหมาย"] C --> D["Utility-Based
มีฟังก์ชัน Utility"] D --> E["Learning Agent
เรียนรู้ได้"] F["ความซับซ้อนเพิ่มขึ้น ⬆️"] ``` --- ## 1. Simple Reflex Agent - ตอบสนองตามกฎ **if-then** อย่างง่าย - **ไม่มีความจำ** ตัดสินใจจากการรับรู้ปัจจุบันเท่านั้น - เหมาะกับสิ่งแวดล้อมที่ **Fully Observable** --- ## ตัวอย่าง: Simple Reflex Vacuum Agent ```python class SimpleReflexVacuumAgent: def __init__(self): self.location = 'A' def act(self, percept): location, status = percept if status == 'Dirty': # กฎ 1: สกปรก → ดูดฝุ่น return 'Suck' elif location == 'A': # กฎ 2: ห้อง A → ไปขวา return 'Right' else: # กฎ 3: ห้อง B → ไปซ้าย return 'Left' ``` --- ## 2. Model-Based Reflex Agent - มี **โมเดลภายในของโลก (Internal Model)** - **ติดตามสถานะ** ที่มองไม่เห็น - เหมาะกับสิ่งแวดล้อมที่ **Partially Observable** --- ## 3. Goal-Based Agent - มี **เป้าหมาย (Goal)** ที่ต้องบรรลุ - **วางแผน** เพื่อไปถึงเป้าหมาย - พิจารณาผลกระทบของการกระทำในอนาคต --- ## 4. Utility-Based Agent - มี **ฟังก์ชัน Utility** วัดความพึงพอใจ - เลือกการกระทำที่ให้ **Utility สูงสุด** - จัดการกับ **Trade-offs** ระหว่างเป้าหมายต่างๆ ได้ --- ## 5. Learning Agent - **เรียนรู้** และปรับปรุงประสิทธิภาพจากประสบการณ์ - มี **Learning Element** สำหรับปรับปรุง - มี **Performance Element** สำหรับเลือกการกระทำ --- ## คุณสมบัติของสิ่งแวดล้อม (1/2) | คุณสมบัติ | คำอธิบาย | |----------|----------| | **Fully vs Partially Observable** | เห็นสถานะทั้งหมดหรือบางส่วน | | **Deterministic vs Stochastic** | ผลลัพธ์แน่นอนหรือไม่แน่นอน | | **Episodic vs Sequential** | แต่ละ Episode แยกกันหรือต่อเนื่อง | --- ## คุณสมบัติของสิ่งแวดล้อม (2/2) | คุณสมบัติ | คำอธิบาย | |----------|----------| | **Static vs Dynamic** | สิ่งแวดล้อมนิ่งหรือเปลี่ยนแปลง | | **Discrete vs Continuous** | สถานะแยกส่วนหรือต่อเนื่อง | | **Single vs Multi-Agent** | ตัวแทนเดียวหรือหลายตัว | --- ## ตัวอย่างการจำแนกสิ่งแวดล้อม | งาน | Observable | Deterministic | Episodic | Static | Discrete | Agents | |-----|------------|---------------|----------|--------|----------|--------| | หมากรุก | Fully | Yes | No | Yes | Yes | Multi | | ขับรถ | Partially | No | No | No | No | Multi | | Sudoku | Fully | Yes | Yes | Yes | Yes | Single | --- # 6. จริยธรรมและผลกระทบของ AI ## Ethics and Impact of AI --- ## ประเด็นจริยธรรมหลัก ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588'}}}%% mindmap root((จริยธรรม AI)) ความเป็นธรรม ความโปร่งใส ความเป็นส่วนตัว ความรับผิดชอบ ความปลอดภัย ผลกระทบสังคม ``` --- ## ความเป็นธรรม (Fairness) - **Bias ในข้อมูล** - ข้อมูลฝึกไม่สมดุลหรือมีอคติ - **การเลือกปฏิบัติ** - ผลลัพธ์ที่ไม่เป็นธรรมต่อกลุ่มบางกลุ่ม - **ความเท่าเทียม** - ทุกคนควรได้รับการปฏิบัติอย่างเท่าเทียม --- ## แหล่งที่มาของ Bias ใน AI | ประเภท Bias | คำอธิบาย | |-------------|----------| | **Data Bias** | ข้อมูลฝึกไม่สมดุลหรือมีอคติ | | **Selection Bias** | การเลือกข้อมูลไม่เป็นตัวแทน | | **Confirmation Bias** | การออกแบบที่สนับสนุนความเชื่อเดิม | | **Measurement Bias** | การวัดที่ไม่ถูกต้อง | --- ## ตัวอย่าง: การตรวจสอบ Fairness ```python def calculate_fairness_metrics(y_true, y_pred, sensitive_attr): """คำนวณเมทริกความเป็นธรรมของโมเดล""" results = {} for group in np.unique(sensitive_attr): mask = sensitive_attr == group # คำนวณ True Positive Rate (TPR) tn, fp, fn, tp = confusion_matrix( y_true[mask], y_pred[mask]).ravel() tpr = tp / (tp + fn) if (tp + fn) > 0 else 0 results[group] = {'TPR': tpr, 'PPR': np.mean(y_pred[mask])} return results ``` --- ## ความโปร่งใสและอธิบายได้ (XAI) **Explainable AI (XAI)** คือ แนวทางที่ทำให้ผู้ใช้สามารถ **เข้าใจและตรวจสอบ** การตัดสินใจของระบบได้ **ปัญหา Black Box:** - Deep Learning มีความซับซ้อนสูง - ไม่รู้ว่าทำไม AI ถึงตัดสินใจแบบนั้น - ส่งผลต่อความไว้วางใจ --- ## เทคนิค XAI ที่นิยม - **LIME** - Local Interpretable Model-agnostic Explanations - **SHAP** - SHapley Additive exPlanations - **Attention Visualization** - แสดงส่วนที่โมเดลให้ความสนใจ - **Feature Importance** - ลำดับความสำคัญของ Features --- ## ผลกระทบต่อสังคมและเศรษฐกิจ | ด้าน | ผลกระทบเชิงบวก | ผลกระทบเชิงลบ | |-----|----------------|----------------| | **การจ้างงาน** | สร้างอาชีพใหม่ | งานบางประเภทถูกแทนที่ | | **การศึกษา** | Personalized Learning | ความเหลื่อมล้ำในการเข้าถึง | | **สุขภาพ** | การวินิจฉัยแม่นยำขึ้น | ความเป็นส่วนตัวของข้อมูล | --- ## ผลกระทบต่อสังคมและเศรษฐกิจ (ต่อ) | ด้าน | ผลกระทบเชิงบวก | ผลกระทบเชิงลบ | |-----|----------------|----------------| | **ความปลอดภัย** | ตรวจจับภัยคุกคาม | การใช้ในทางที่ผิด | | **สิ่งแวดล้อม** | เพิ่มประสิทธิภาพพลังงาน | การใช้พลังงานในการฝึก AI | --- ## หลักการจริยธรรม AI (7 หลักการ) 1. **ความเป็นธรรม (Fairness)** - ไม่เลือกปฏิบัติ 2. **ความโปร่งใส (Transparency)** - อธิบายได้ 3. **ความเป็นส่วนตัว (Privacy)** - ปกป้องข้อมูล 4. **ความปลอดภัย (Safety)** - ไม่ก่อให้เกิดอันตราย 5. **ความรับผิดชอบ (Accountability)** - มีผู้รับผิดชอบ 6. **ความทนทาน (Robustness)** - ทำงานได้อย่างน่าเชื่อถือ 7. **การควบคุมโดยมนุษย์ (Human Oversight)** - มนุษย์ยังเป็นผู้ตัดสินใจ --- # 7. เครื่องมือและการเตรียมความพร้อม ## Tools and Environment Setup --- ## Python Environment Setup **Anaconda** เป็น Distribution ที่รวมเครื่องมือสำหรับ Data Science และ AI ```bash # 1. สร้าง Conda Environment conda create -n ai_course python=3.11 # 2. เปิดใช้งาน Environment conda activate ai_course # 3. ติดตั้ง Libraries พื้นฐาน pip install numpy pandas matplotlib seaborn ``` --- ## ติดตั้ง ML/DL Libraries ```bash # Machine Learning pip install scikit-learn # Deep Learning Frameworks pip install tensorflow torch torchvision # Jupyter Notebook pip install jupyter notebook ``` --- ## ตรวจสอบการติดตั้ง ```python import sys print(f"Python Version: {sys.version}") import numpy as np import pandas as pd import sklearn print(f"NumPy: {np.__version__}") print(f"Pandas: {pd.__version__}") print(f"Scikit-learn: {sklearn.__version__}") ``` --- ## Google Colab **Google Colab** เป็นบริการ Jupyter Notebook บนคลาวด์ที่ให้บริการ **GPU และ TPU ฟรี** ข้อดี: - ไม่ต้องติดตั้งอะไรบนเครื่อง - เข้าถึง GPU/TPU ฟรี - รวมกับ Google Drive ได้ - แชร์และทำงานร่วมกันได้ง่าย --- ## การใช้งาน Google Colab ```python # ตรวจสอบ GPU ที่มีใน Colab !nvidia-smi # เชื่อมต่อกับ Google Drive from google.colab import drive drive.mount('/content/drive') # อัปโหลด/ดาวน์โหลดไฟล์ from google.colab import files uploaded = files.upload() files.download('model.h5') ``` --- ## Git & GitHub **Git** เป็นระบบ Version Control สำหรับจัดการ Source Code ```bash # ตั้งค่า Git git config --global user.name "Your Name" git config --global user.email "your.email@example.com" # คำสั่งพื้นฐาน git init # สร้าง Repository git clone
# Clone Repository git add . # เพิ่มไฟล์ git commit -m "msg" # Commit git push origin main # Push ขึ้น Remote ``` --- ## Visual Studio Code **VS Code** เป็น IDE ที่นิยมสำหรับการพัฒนา AI/ML **Extensions แนะนำ:** - **Python** - รองรับ Python อย่างเต็มที่ - **Jupyter** - รัน Notebook ใน VS Code - **Pylance** - IntelliSense ที่ดีขึ้น - **GitLens** - เพิ่มความสามารถ Git - **GitHub Copilot** - AI ช่วยเขียนโค้ด --- # 8. สรุปโดยรวม ## Summary --- ## สรุปบทเรียน ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#458588', 'secondaryColor': '#98971a', 'tertiaryColor': '#d79921'}}}%% flowchart LR A["นิยาม AI"] --> B["ประวัติ AI"] B --> C["สาขาของ AI"] C --> D["ประเภท AI"] D --> E["Intelligent Agents"] E --> F["จริยธรรม AI"] F --> G["เครื่องมือ"] ``` --- ## ประเด็นสำคัญที่ได้เรียนรู้ - **นิยาม AI** - ระบบที่แสดงพฤติกรรมอัจฉริยะ - **ประวัติ AI** - ตั้งแต่ 1943 จนถึงปัจจุบัน - **สาขาของ AI** - ML, CV, NLP, Robotics - **ประเภท AI** - Narrow vs General vs Super - **Intelligent Agents** - Perceive → Decide → Act - **จริยธรรม AI** - Fairness, Transparency, Safety - **เครื่องมือ** - Python, Colab, Git, VS Code --- ## ทักษะพื้นฐานที่ควรมี **1. คณิตศาสตร์** - พีชคณิตเชิงเส้น (Linear Algebra) - แคลคูลัส (Calculus) - ความน่าจะเป็นและสถิติ (Probability & Statistics) **2. การเขียนโปรแกรม** - Python เป็นหลัก - โครงสร้างข้อมูลและอัลกอริทึม **3. ความคิดเชิงวิเคราะห์** - การแก้ปัญหาอย่างเป็นระบบ --- # 9. เอกสารอ้างอิง ## References --- ## หนังสือหลัก 1. Russell, S., & Norvig, P. (2021). **Artificial Intelligence: A Modern Approach** (4th ed.). Pearson. 2. Goodfellow, I., Bengio, Y., & Courville, A. (2016). **Deep Learning**. MIT Press. 3. Mitchell, T. M. (1997). **Machine Learning**. McGraw-Hill. --- ## แหล่งเรียนรู้ออนไลน์ - [Stanford CS221: Artificial Intelligence](https://stanford-cs221.github.io/) - [MIT 6.034: Artificial Intelligence](https://ocw.mit.edu/courses/6-034-artificial-intelligence-fall-2010/) - [Coursera: Machine Learning by Andrew Ng](https://www.coursera.org/learn/machine-learning) - [Fast.ai: Practical Deep Learning](https://www.fast.ai/) --- ## เอกสารเชิงจริยธรรม - IEEE Global Initiative on Ethics of Autonomous and Intelligent Systems - EU Guidelines for Trustworthy AI - Anthropic Research on AI Safety --- # คำถาม - ข้อสงสัย