Académique Documents
Professionnel Documents
Culture Documents
dataset={‘cle1’:[1,2,3], ‘cle2’:[4,5,6]}
import pandas as pd
df=pd.dataframe.from_dict[dataset)
df[col1],head() = df[col1]
statistique : min() max() mean() //moy var() //variance sum() count() value_counts() // comptr les
occurrences uniques
TPU des processeur tres rapides et puissants pour czlculer dans des matrices a haute dimention :
tensor (ps : tensorflow) = tensor processing unit
colab offre une bonne infrastructure pour les tpu
+
bon a savoir : transfer learning , GAN, TPU, GPT-2 , fastAI
AI 1950
ML 1980
DL 2010
AI c est plutot aspect philosophique : la capacite des machines a etre egales a lhomme
ML machin capable d apprendre pour resoudre un prob sans avoir besoin de programmer sa solution
expliciitement
partie de ml which focus on architectures de plusieurs couche de res de neuronnes
unsupervised : clustering & dimention regression (no label : on utilise unsupervised quand on a pas
bcp d info sur datast) => classifier ddans des grp c puissant il ne demande pas bcp innfo mais
demand bcp d attention pour assurer a coherence des grp
limiyts : 2015 : an AI HR engine recruiting male more than females in important positions
2019 : 10times less accurate woith black faces
from fastai,vision import *
from fastai,metrics import error_rate
import warnings
warnings,filterwarnings(« ignore », category=UserWarning, module= « torch,nn,functional »)
folder = « downloads »
path = Path(‘/contents/downloads’)
dest = path
dest,mkdir(parents= True, exist_ok =True)
path.ls()
classes
path.ls()
for c in classes :
print(c)
verify_images(path/c, dlete=True, max_size=500) //verif bonne taille
fnames = get_image_files(path_img)
fnames[:5]
nop.random.seed(2)
pat = r’/([^/]+)_\d+.jpg$’
np.random.seed(42)
data= ImageDataBunch,from_name_re(path_img, fnames, pat, ds_tfms=get_transforms(), size=224,
bs=64).normalize(imagenet_stats)
data.classes
data.show_batch(rows=4 , figsize=(8,10))
print(data.classes)
len(data.classes),data.c
//ordre shih houni
we need to see the categories that the model most confused with one another
to see the predicted values was reasonable or not => the classifier is working correctly or not
when we plot the confusion matrix the distribution is heavily skewed : the model makees the same
mistakes over and over aganin but rarely confuses other categories which is normal
interp = ClassificationInterpretation.from_larner(learn)
interp.plot_confusion_matrix(figsize=(8,5), dpi=120)
verifier labels des images dont la prediction st eronee : tnjm el label ghalet
doc(interp.plot_top_losses)
interp.plot_confusion_matrix(figsize=(12,12), dpi=60)
matrice de confusion pour pres ou le model a commis plus d erreur
les erreurs dans le diagonale sont bonnes et on espere qu elles soient eleves et lses autres sont les
confusions
intrp.most_confused(min_val=2)
learn.unfreeze()
learn.fit_one_cycle(1)
learn.load(‘stage-1’) ;
learn.lr_find()
learn.recorder.plot()
learn.unfreeze()
learn.fit_one_cycle(2, max_lr=slice(le-6, le-4))