Skip to content

Commit 5bb878a

Browse files
author
Joshua Taillon
committed
Update intro and machine learning talks and PDFs
1 parent 689961c commit 5bb878a

File tree

10 files changed

+7487
-4446
lines changed

10 files changed

+7487
-4446
lines changed

talks/01_python_hs_intro/01_python_hs_intro.ipynb

Lines changed: 8 additions & 914 deletions
Large diffs are not rendered by default.
-16 KB
Binary file not shown.

talks/01_python_hs_intro/img/nist_mml_logo.svg

Lines changed: 189 additions & 189 deletions
Loading

talks/01_python_hs_intro/img/py_matlab_comparison.svg

Lines changed: 524 additions & 3090 deletions
Loading

talks/05_machine_learning/05_machine_learning.ipynb

Lines changed: 80 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -62,58 +62,6 @@
6262
"best available for the purpose.*"
6363
]
6464
},
65-
{
66-
"cell_type": "markdown",
67-
"metadata": {
68-
"slideshow": {
69-
"slide_type": "skip"
70-
}
71-
},
72-
"source": [
73-
"#### Import hyperspy"
74-
]
75-
},
76-
{
77-
"cell_type": "code",
78-
"execution_count": 22,
79-
"metadata": {
80-
"slideshow": {
81-
"slide_type": "skip"
82-
}
83-
},
84-
"outputs": [],
85-
"source": [
86-
"%matplotlib notebook\n",
87-
"import hyperspy.api as hs\n",
88-
"import numpy as np"
89-
]
90-
},
91-
{
92-
"cell_type": "markdown",
93-
"metadata": {
94-
"slideshow": {
95-
"slide_type": "skip"
96-
}
97-
},
98-
"source": [
99-
"#### Disable warnings for presentation:"
100-
]
101-
},
102-
{
103-
"cell_type": "code",
104-
"execution_count": 2,
105-
"metadata": {
106-
"slideshow": {
107-
"slide_type": "skip"
108-
}
109-
},
110-
"outputs": [],
111-
"source": [
112-
"import logging\n",
113-
"hs_logger = logging.getLogger('hyperspy') \n",
114-
"hs_logger.setLevel(logging.ERROR)"
115-
]
116-
},
11765
{
11866
"cell_type": "markdown",
11967
"metadata": {
@@ -556,12 +504,57 @@
556504
"metadata": {},
557505
"source": [
558506
"- Many algorithms exist to solve:   $\\mathbf{D}_{\\left(x,y\\right),E}=\\mathbf{W}_{\\left(x,y\\right)} \\times \\mathbf{S}_E$\n",
559-
" - Assumptions implicit in each affect their suitability for EDS, EELS, etc.\n",
560-
"\n",
507+
" - This is a highly underdetermined problem, with an infinite number of solutions\n",
508+
" - Assumptions implicit in each algorithm affect their suitability for EDS, EELS, etc."
509+
]
510+
},
511+
{
512+
"cell_type": "markdown",
513+
"metadata": {
514+
"slideshow": {
515+
"slide_type": "fragment"
516+
}
517+
},
518+
"source": [
561519
"- Primary methods (built into &nbsp;<img src='img/hyperspy.svg' width=40px style='display:inline-block;'/> HyperSpy ):\n",
562-
" - Principal component analysis (PCA) &mdash; finds non-physical spectra that describe the most variance in the datacube\n",
563-
" - Independent component analysis (ICA) &mdash; maximizes independence between spectral results\n",
564-
" - Non-negative matrix factorization (NMF) &mdash; enforces positivity in spectral components and weights"
520+
" - Principal component analysis ([PCA](https://en.wikipedia.org/wiki/Principal_component_analysis)) &mdash; finds non-physical spectra that describe the most variance in the datacube\n",
521+
" - Independent component analysis ([ICA](https://en.wikipedia.org/wiki/Independent_component_analysis)) &mdash; maximizes independence between spectral results\n",
522+
" - Non-negative matrix factorization ([NMF](https://en.wikipedia.org/wiki/Non-negative_matrix_factorization)) &mdash; enforces positivity in spectral components and weights"
523+
]
524+
},
525+
{
526+
"cell_type": "markdown",
527+
"metadata": {
528+
"slideshow": {
529+
"slide_type": "subslide"
530+
}
531+
},
532+
"source": [
533+
"## Principle component analysis + blind source separation"
534+
]
535+
},
536+
{
537+
"cell_type": "markdown",
538+
"metadata": {},
539+
"source": [
540+
"- PCA will find the spectra that describe the maximum amount of variance within the data set\n",
541+
" - These principle components (PCs) will contain the most \"information\" &mdash; but not information relevant to a microscopist\n",
542+
" - The results will look like vaguely spectral, but almost guaranteed to be non-physical"
543+
]
544+
},
545+
{
546+
"cell_type": "markdown",
547+
"metadata": {
548+
"slideshow": {
549+
"slide_type": "fragment"
550+
}
551+
},
552+
"source": [
553+
"- [Blind source separation](https://en.wikipedia.org/wiki/Signal_separation) often gives more interpretable results:\n",
554+
" - Independent component analysis (ICA):\n",
555+
" - Operates on the PCs to maximize independence between spectral results\n",
556+
" - Non-negative matrix factorization (NMF):\n",
557+
" - Decompose the matrix with constraints that match physical expectations"
565558
]
566559
},
567560
{
@@ -596,8 +589,8 @@
596589
"cell_type": "markdown",
597590
"metadata": {},
598591
"source": [
599-
"- Data collected from 0 to 360 degrees tilt in increments of 5 degrees\n",
600-
" - Dataset is 165 x 124 x 73 x 900 "
592+
"- Data collected from 0 to 360 degrees tilt in increments of 5 degrees (73 spectrum images)\n",
593+
" - Dataset is $\\left(x, y, \\theta, E\\right)$ : $\\left(165, 124, 73, 900\\right)$ &mdash; 12.2GB"
601594
]
602595
},
603596
{
@@ -676,9 +669,9 @@
676669
"cell_type": "markdown",
677670
"metadata": {},
678671
"source": [
679-
"<div class='two-cols pro-con' style='font-size:1.5em;top:0'>\n",
672+
"<div class='two-cols pro-con' style='font-size:1.3em;top:0'>\n",
680673
"\n",
681-
"<div class='col' style='max-width:45%;margin-top:8%;'>\n",
674+
"<div class='col' style='max-width:45%;margin-top:6%;'>\n",
682675
"<ul style='line-height:150%;'>\n",
683676
" <li>PCA orders components by \"described variance\"</li>\n",
684677
" <li><em>a priori</em> we know there should be three components</li>\n",
@@ -728,11 +721,32 @@
728721
"cell_type": "markdown",
729722
"metadata": {},
730723
"source": [
731-
"<center><img style=\"width:65%;\" class=\"plain\" src=\"img/andy_eds_intensities_raw_vs_PCA.svg\"/></center>\n",
724+
"<center><img style=\"width:65%;margin-top:5%;\" class=\"plain\" src=\"img/andy_eds_intensities_raw_vs_PCA.svg\"/></center>\n",
732725
"\n",
733726
"<div class=\"fig-caption-center\" style=\"height:4em; bottom:-3%;\">\n",
734727
"Line intensities extracted from model with top 3 PCA elements;<br/>\n",
735-
"Drastically enhances S/N ratio in \"loading\" maps</div>"
728+
"Drastically enhances S/N ratio in line intensity maps</div>"
729+
]
730+
},
731+
{
732+
"cell_type": "markdown",
733+
"metadata": {
734+
"slideshow": {
735+
"slide_type": "subslide"
736+
}
737+
},
738+
"source": [
739+
"## Result of PCA + BSS"
740+
]
741+
},
742+
{
743+
"cell_type": "markdown",
744+
"metadata": {},
745+
"source": [
746+
"<center><img style=\"width:70%;\" class=\"plain\" src=\"img/andy_BSS.svg\"/></center>\n",
747+
"<div class=\"fig-caption-center\" style=\"height:4em; bottom:-3%;\">\n",
748+
"One component for each element (phase)<br/>\n",
749+
"Much more interpretable results</div>"
736750
]
737751
},
738752
{
@@ -768,7 +782,9 @@
768782
"\n",
769783
"# <center>Thank you!</center>\n",
770784
"\n",
771-
"<div style='text-align:center;margin:auto;'>Onto the demo...</div>"
785+
"<div style='text-align:center;margin:auto;'>Onto the demo...<br/>Any questions?</div>\n",
786+
"\n",
787+
"<div style='text-align:center;margin:auto;margin-top:15px;'><a href=\"mailto:[email protected]\">[email protected]</a></div>"
772788
]
773789
}
774790
],
150 KB
Binary file not shown.

0 commit comments

Comments
 (0)