Alt-R
or click the "x"Department of Chemistry & Physics
College of Sciences and Mathematics
Re:Teaching PHY/BSA 3895: "Deep Learning and AI Ethics," Fall 2021.
Scholarship of Teaching & Learning Symposium, Belmont University, April 28, 2021
I like & teach machine learning (ML), esp. deep learning (DL). Lots of ML is classification. How humans & machines do it differently is the topic of my popular-level eBook-in-progess that uses interactive visualizations (instead of "math").
*see my blog post "Naughty by Numbers: Classifications at Christmas"
I said "no math," but:
${\rm softmax}(x_i) = {e^{x_i} \over \sum\limits_j e^{x_j}} $.
3D gives you all of softmax's complexity & you can still picture it!
Data/sound viz has been an big part of my career, further influenced by Yang Hann Kim's 2016 Rossing Prize Lecture in Acoustics Education on viz in teaching STEM.
In 3D the representations are exact!
For teaching via visualization and running on Google Colab, and leveraging fast.ai.
Traditionally, we use triplets of numbers to denote 3 classes.
"Ground truth" values are "one-hot encoded":
cat: (1,0,0) dog: (0,1,0) horse: (0,0,1)
Model predictics class probabilities for images:
"Embedding": treat each triplet as the (x,y,z) coordinates of a point in 3D space:
# All the 3D plots in this talk are interactive. Use your mouse to rotate, etc!
TrianglePlot3D_Plotly(data, targ=None, labels=labels*2, show_bounds=False).do_plot()
Let's plot LOTS of points...
prob, targ = calc_prob(n=400)
TrianglePlot3D_Plotly(prob, targ=None, labels=labels, show_bounds=False).do_plot()
Let's color them by their target value / label, and show class boundaries:
TrianglePlot3D_Plotly(prob, targ=targ, labels=labels, show_bounds=True).do_plot()
Since points lie in a plane, we can change coord's & plot in 2D instead
(mouse hover = show image!)
urls = exhibit_urls(targ, labels)
TrianglePlot2D_Bokeh(prob, targ=targ, labels=labels, show_bounds=True, urls=urls).do_plot()
Loss: distance from target (continuous)
Accuracy: % of points on the correct side of decision boundary (discontinuous)
plot = TrianglePlot3D_Plotly(prob3, targ=targ4, labels=labels+['bird'], show_labels=True, show_axes=False, poles_included=True)
plot.fig.update_layout(scene_camera=dict( eye=dict(x=1.5, y=1, z=0.7)))
plot.do_plot()
...map similar points near each other, dissimilar points far away. => Clusters:
clusters = plot_clusters()
Like attracts like; "Opposites" repel:
Tends to group things in "semantically meaningful" ways.
Identical twin network branches map to points ("feature vectors") in N-dim space:
Example of a Siamese Network (source: Sundin et al)
Traditional vs. zero(/few)-shot methods: which one wins? It depends.
From high-scoring Kaggle competition entry using "entity embeddings":
"Entity embedding not only reduces memory usage and speeds up neural networks compared with one-hot encoding, but more importantly by mapping similar values close to each other in the embedding space it reveals the intrinsic properties of the categorical variables."
Let's look at "PETS," via my mod of FastAI's tutorial on Siamese Networks...
mrspuff
lib TODO:Thanks to Zach Mueller, Tanishq Abraham and Isaac Flath for help with fastai!