יסודות בינה מלאכותית : 06-RB29 – יסודות בינה מלאכותית אימון בינה מלאכותית YOLO
תרגיל כיתה 1 יצירת תמונה מטקסט
ננסה להבין בסוף התרגיל :
מדוע בינה מלאכותית יוצרת תמונה לא צנוע כשאר מבקשים אישה יפיפיה ?
מה זה אומר על רשת האינטרנט שלנו – אישה יפיפיה -ואיך זה עשוי להשפיע על בינה מלאוכתית בעתיד ומעמד האישה בעיני ילדים לרעה
pink tiger girl beautiful women Israeli riding on a motor
- צור בעצרת כלי של בינה מלאוכתית תמונה בעזרת התכונות הבאות
1.2 https://gemini.google.com/app
השתמש בטקסטים הבאים להשוואה או כל טסקט אחר רק שיהיה אותו טסטק בכל התוכנות
Israeli solder riding on a ATV
pink tiger girl beautiful women Israeli riding on a motor
השתמש באותו טסקט להשוואה לפי בחירתך
ניתוח נתונים בפייתון – הכנה לשימוש בעזרת בינה מלאוכתית
tansorflow
הפעלת אנקונדה
הפעל את התוכנה
בקשו עזרה מהמרצה – תוכנה קצת מסובכת
- בחר את את התוכנה Jupyter notebook
2.העתק את הקוד הבא , הורד את הקובץ CSV
01-06-2018 לספריה מתאימה ושנה את הקוד בהתאים
הצגת עמודה מקובץ CSV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import pandas as pd import matplotlib.pyplot as plt file_path = r'D:\TEMP5\01-06-2018.CSV' # Read only first column, first 500 rows, no headers df = pd.read_csv(file_path, header=None, usecols=[0], nrows=500) # Convert to integer (if needed - remove if data is already integer) df[0] = pd.to_numeric(df[0], errors='coerce') # Print first few rows to check print(df.head()) # Plot first column plt.plot(df.index, df[0]) # Add title and grid plt.title('First Column (Rows 0-499)') plt.xlabel('T Index') plt.ylabel('Volt') plt.grid(True) # Show plot plt.show() |
פלט
הצגת שורה מקובץ CSV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import pandas as pd import matplotlib.pyplot as plt file_path = r'D:\TEMP5\01-06-2018.CSV' # Read only the first row first_row = pd.read_csv(file_path, header=None, nrows=1).iloc[0] # Print first row print(first_row) # Plot first row plt.plot(first_row.index, first_row.values) # Add title and grid plt.title('First Row Plot') plt.xlabel('Column Index') plt.ylabel('Value') plt.grid(True) # Show plot plt.show() |
פלט
הצגת מספר עמודות על גרף מתוך CSV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import pandas as pd import matplotlib.pyplot as plt file_path = r'D:\TEMP5\01-06-2018.CSV' # Read only columns 0, 1, 10, 20, 30, 40 - first 500 rows, no headers df = pd.read_csv(file_path, header=None, usecols=[0,200], nrows=500) # Convert all columns to numeric (in case the file has some text noise) df = df.apply(pd.to_numeric, errors='coerce') # Plot each column plt.figure(figsize=(12, 6)) for col in df.columns: plt.plot(df.index, df[col], label=f'Column {col}') # Add title, legend and grid plt.title('Columns 0,50, 100 - Rows 0-499') plt.xlabel('Row Index') plt.ylabel('Value') plt.legend() plt.grid(True) # Show plot plt.show() |
העשרה : עיבוד נתונים מתקדם – בדיקת מגמת ניסוי ומסקנות גרפיות
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import pandas as pd import matplotlib.pyplot as plt file_path = r'D:\TEMP5\01-06-2018.CSV' # Read columns 1 to 200 and rows 20 to 200 df = pd.read_csv(file_path, header=None, usecols=range(1, 201)) # Take only rows 20 to 200 (Python index: 20 to 200 is 20:201) df = df.iloc[110:150] # Calculate amplitude (max - min) for each column amp = df.max() - df.min() # Convert to list for plotting amp_values = amp.values # Plot amplitude array plt.figure(figsize=(12, 6)) plt.plot(range(1, 201), amp_values) plt.title('Amplitude for Columns 1 to 200 (Rows 20 to 200)') plt.xlabel('Column Index') plt.ylabel('Amplitude (Max - Min)') plt.grid(True) plt.show() |
הוספת קו מגמה חיתוך ומיקוד נתונים
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import pandas as pd import matplotlib.pyplot as plt import numpy as np file_path = r'D:\TEMP5\01-06-2018.CSV' # Read columns 1 to 200 and rows 20 to 200 df = pd.read_csv(file_path, header=None, usecols=range(1, 201)) # Take only rows 20 to 200 df = df.iloc[110:150] # Calculate amplitude (max - min) for each column amp = df.max() - df.min() # Convert to array for easier processing amp_values = amp.values # Calculate 16-point moving average smoothed_amp = np.convolve(amp_values, np.ones(20)/20, mode='same') # Plot both plt.figure(figsize=(12, 6)) # Raw amplitude (blue) plt.plot(range(1, 201), amp_values, label='Amplitude') # Smoothed amplitude (red) plt.plot(range(1, 201), smoothed_amp, label='Smoothed (16pt Moving Average)', color='red', linewidth=2) # Set Y-axis limits plt.ylim(2500, 3500) # Labels and grid plt.title('Amplitude for Columns 1 to 200 (Rows 20 to 200)') plt.xlabel('Column Index') plt.ylabel('Amplitude (Max - Min)') plt.legend() plt.grid(True) # Show plot plt.show() |
תרגיל כיתה 2 : ניתוח קובץ מדעי מניסוי מעבדה CSV
נתון קובץ מדעי מניסוי מעבדה הורד אותו למחשב 01-06-2018
- בנה בעזרת בינה מלאכותית קוד בשפת פייתון שפתוח את הקובץ , מציג את 80 השורות הראשונות של עמודה מספר 1 משורה 120 עד 200
ומציג אותם בגרף
2. הצג על הגרף עמודה 0 , 200