שבוע 4 — תכנות מונחה-AI
הפרדיגמה החדשה של מחקר מדעי:
שאלה ארכאולוגית → פרומפט ל-AI → קוד Python → תוצאה
עצה
גשו ל:
colab.research.google.com
היכנסו עם חשבון Google שלכם.
פרומפט גרוע: > “תכתוב קוד לניתוח מטבעות”
פרומפט טוב:
I have a TPS file with 8 landmarks from 20 Roman coins.
I want to:
1. Load the TPS file into numpy arrays
2. Perform Generalized Procrustes Analysis
3. Plot the aligned landmarks overlaid
Please write Python code for Google Colab with comments explaining each step.
# קוד שנוצר על ידי Claude — יישור פרוקרוסטס
import numpy as np
from morphops import procrustes_alignment
# טעינת נתונים (20 מטבעות × 8 ציוני דרך × 2 קואורדינטות)
landmarks = np.load("hadrian_landmarks.npy")
print(f"צורת הנתונים: {landmarks.shape}")
# יישור פרוקרוסטס
aligned, mean_shape, _ = procrustes_alignment(landmarks)
# ויזואליזציה
import matplotlib.pyplot as plt
from bidi.algorithm import get_display
rtl = get_display
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
# לפני יישור
for specimen in landmarks:
axes[0].scatter(specimen[:, 0], specimen[:, 1],
alpha=0.3, c='blue', s=20)
axes[0].set_title(rtl("לפני יישור פרוקרוסטס"))
# אחרי יישור
for specimen in aligned:
axes[1].scatter(specimen[:, 0], specimen[:, 1],
alpha=0.3, c='red', s=20)
axes[1].set_title(rtl("אחרי יישור פרוקרוסטס"))
plt.tight_layout()
plt.show()פתחו Colab חדש ובקשו מ-Claude:
Write Python code to:
1. Create 5 random 2D shapes (8 points each)
2. Plot them all in different colors
3. Show how different their centroid positions are
Include all imports and comments.
עצה
העתיקו את הקוד שקיבלתם ל-Colab והריצו. מה קיבלתם?
צורה בזמן — שי גורדין, אוניברסיטת אריאל