diff --git a/README.md b/README.md
index 458ee77cd..c02ab72a6 100644
--- a/README.md
+++ b/README.md
@@ -383,9 +383,11 @@ Recommended prereading: Chapters 1-2 (linear algebra) and chapter 3 (statistics)
- Hastie et al sections 9.1 and 9.2. Geron's text chapter 6 (Decision trees) and chapter 8 on PCA and Clustering
### Week 45 November 8-12
-- Lab Wednesday: Work on project 2, project 3 available Friday 12th. Deadline project 2 is November 15.
+- Lab Wednesday: Work on project 2, project 3 available Friday 12th. Deadline project 2 is November 20.
- Lecture Thursday: Decision Trees and Ensemble methods, Bagging and Voting
+ - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureNovember11.mp4?vrtx=view-as-webpage
- Lecture Friday: Ensemble Methods, Random Forests, Boosting and gradient boosting
+ - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureNovember12.mp4?vrtx=view-as-webpage
- Reading recommendations:
- See lecture notes for week 45 at https://compphysics.github.io/MachineLearning/doc/web/course.html.
- Decision Trees: Geron's chapter 6 covers decision trees while ensemble models, voting and bagging are discussed in chapter 7.
@@ -394,11 +396,12 @@ Recommended prereading: Chapters 1-2 (linear algebra) and chapter 3 (statistics)
### Week 46 November 15-19
- Lab Wednesday: Work on project 3
-- Lecture Thursday: Ensemble Methods, Random Forests, Boosting and gradient boosting
-- Lecture Friday: Support Vector machines
+- Lecture Thursday: Support Vector machines. Summary Ensemble Methods, Random Forests, Boosting and gradient boosting
+- Lecture Friday: Workshop on project 3
- Reading recommendations:
- See lecture notes for week 46 at https://compphysics.github.io/MachineLearning/doc/web/course.html.
- Hastie et al chapter 12
+ - Bishop chapter 7.1 and 7.2
### Week 47 November 22-26
- Lab Wednesday: Work on project 3
diff --git a/doc/HandWrittenNotes/2021/NotesNovember12.pdf b/doc/HandWrittenNotes/2021/NotesNovember12.pdf
new file mode 100644
index 000000000..f18c4e16d
Binary files /dev/null and b/doc/HandWrittenNotes/2021/NotesNovember12.pdf differ
diff --git a/doc/LectureNotes/schedule.md b/doc/LectureNotes/schedule.md
index 9333732d7..2c066d3aa 100644
--- a/doc/LectureNotes/schedule.md
+++ b/doc/LectureNotes/schedule.md
@@ -154,7 +154,9 @@ For the reading assignments we use the following abbreviations:
### Week 45 November 8-12
- Lab Wednesday: Work on project 2, project 3 available. Deadline project 2 is November 15.
- Lecture Thursday: Ensemble methods, bagging and random forests
+ - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureNovember11.mp4?vrtx=view-as-webpage
- Lecture Friday: Boosting and gradient boosting
+ - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureNovember12.mp4?vrtx=view-as-webpage
- Reading recommendations:
- See lecture notes for week 45 at https://compphysics.github.io/MachineLearning/doc/web/course.html.
- Hastie et al chapter 10
diff --git a/doc/Projects/2020/Project3/html/._Project3-bs000.html b/doc/Projects/2020/Project3/html/._Project3-bs000.html
new file mode 100644
index 000000000..47e28dced
--- /dev/null
+++ b/doc/Projects/2020/Project3/html/._Project3-bs000.html
@@ -0,0 +1,440 @@
+
+
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+
+
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so.
+
+
For Boosting, feel also free to write your own codes.
+
+
+
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
+
The estimates you used and tested in projects 1 and 2 should also be included, that is the \( R2 \)-score, MSE, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks..
+
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
The basic structure of your project
+
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
+
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
+
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
+
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
+
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
+
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
+
+
For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
+
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+We are looking at a one-dimensional
+problem
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
+
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
+
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
+
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
+
+
Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+
Part d) Solving eigenvalue problems
+
+
Follow the discussion in the work of Yi et al. in the article from
+Computers and Mathematics with Applications 47, 1155 (2004), and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric \( 6\times 6 \) matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
+
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Introduction to numerical projects
+
+
Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+
+
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
Include the source code of your program. Comment your program properly.
+
If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
Try to give an interpretation of you results in your answers to the problems.
+
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
+
Introduction to numerical projects
+
+
Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+
+
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
Include the source code of your program. Comment your program properly.
+
If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
Try to give an interpretation of you results in your answers to the problems.
+
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
+
Format for electronic delivery of report and programs
+
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+
+
Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
+
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via pip as
+
See below for a discussion of tensorflow and scikit-learn.
+
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+for a seamless installation of additional software via for example
+
+
+
brew install python3
+
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use pip as well and simply install Python as
+
+
+
sudo apt-get install python3 (or python for python2.7)
+
+
etc etc.
+
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+
+
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
+
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+
+
Popular software packages written in Python for ML are
These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
-
-The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
-
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so.
-
-For Boosting, feel also free to write your own codes.
+
For Boosting, feel also free to write your own codes.
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
@@ -188,66 +186,47 @@ For Boosting, feel also free to write your own codes.
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
-All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks..
-
-We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks..
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
The basic structure of your project
-
-This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
-
The basic structure of your project
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
-
-Here follows a set up on how to structure your report and analyze the data you have opted for.
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
-
Part a)
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
-
-The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
-
Part b)
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
-
-You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
-
-
Part c)
-
-
-Then describe your algorithm and its implementation and tests you have performed.
-
-
Part d)
-
-
-Then presents your results and findings, link with existing literature and more.
-
-
Part e)
-
-
-Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
-
-
Solving partial differential equations with neural networks
-
-
-For this variant of project 3, we will assume that you have some
+
For this variant of project 3, we will assume that you have some
background in the solution of partial differential equations using
finite difference schemes. We will study the solution of the diffusion
equation in one dimension using a standard explicit scheme and neural
networks to solve the same equations.
+
-
-For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
-
-For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
-
Part a), setting up the problem
-
-
-The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
We are looking at a one-dimensional
problem
+
with initial conditions, i.e., the conditions at \( t=0 \),
$$
\begin{equation*}
u(x,0)= \sin{(\pi x)} \hspace{0.5cm} 0 < x < L,
\end{equation*}
$$
-with \( L=1 \) the length of the \( x \)-region of interest. The
+
with \( L=1 \) the length of the \( x \)-region of interest. The
boundary conditions are
+
$$
\begin{equation*}
@@ -287,18 +267,18 @@ u(L,t)= 0 \hspace{0.5cm} t \ge 0.
\end{equation*}
$$
-The function \( u(x,t) \) can be the temperature gradient of a rod.
-As time increases, the velocity approaches a linear variation with \( x \).
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
-
-We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
-Write down the algorithm and the equations you need to implement.
-Find also the analytical solution to the problem.
+
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
-
Part b)
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
-
-Implement the explicit scheme algorithm and perform tests of the solution
-for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
-
-
-Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
-
Part c) Neural networks
-
-
-Study now the lecture notes on solving ODEs and PDEs with neural
+
Study now the lecture notes on solving ODEs and PDEs with neural
network and use either your own code from project 2 or the
functionality of tensorflow/keras to solve the same equation as in
part b). Discuss your results and compare them with the standard
explicit scheme. Include also the analytical solution and compare with
that.
+
+
Part d) Solving eigenvalue problems
-
Part d) Solving eigenvalue problems
-
-
-Follow the discussion in the work of Yi et al. in the article from
+
Follow the discussion in the work of Yi et al. in the article from
Computers and Mathematics with Applications 47, 1155 (2004), and
use your differential equation solver with neural networks, set up a
simple square, real and symmetric \( 6\times 6 \) matrix and find the
eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
-
Part e)
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Introduction to numerical projects
-
-Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
-
-
Introduction to numerical projects
-
-
-Here follows a brief recipe and recommendation on how to write a report for each
+
Here follows a brief recipe and recommendation on how to write a report for each
project.
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
@@ -369,12 +343,11 @@ project.
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
Introduction to numerical projects
-
Introduction to numerical projects
-
-
-Here follows a brief recipe and recommendation on how to write a report for each
+
Here follows a brief recipe and recommendation on how to write a report for each
project.
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
@@ -387,63 +360,51 @@ project.
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
Format for electronic delivery of report and programs
-
Format for electronic delivery of report and programs
-
-
-The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
-
-Finally,
+
Finally,
we encourage you to collaborate. Optimal working groups consist of
-2-3 students. You can then hand in a common report.
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
-
Software and needed installations
-
-
-If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
we recommend that you install the following Python packages via pip as
-
+
See below for a discussion of tensorflow and scikit-learn.
-
-See below for a discussion of tensorflow and scikit-learn.
-
-
-For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
for a seamless installation of additional software via for example
-
+
brew install python3
-
-For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
you can use pip as well and simply install Python as
-
+
sudo apt-get install python3 (or python for python2.7)
+
etc etc.
-etc etc.
-
-
-If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
-
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
-
-Popular software packages written in Python for ML are
+
Popular software packages written in Python for ML are
-
-These are all freely available at their respective GitHub sites. They
+
These are all freely available at their respective GitHub sites. They
encompass communities of developers in the thousands or more. And the number
of code developers and contributors keeps increasing.
-
-
+
@@ -464,25 +423,18 @@ of code developers and contributors keeps increasing.
-
-The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
-
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so.
-
-For Boosting, feel also free to write your own codes.
+
For Boosting, feel also free to write your own codes.
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
@@ -137,66 +217,47 @@ For Boosting, feel also free to write your own codes.
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
-All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks..
-
-We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks..
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
The basic structure of your project
-
-This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
-
The basic structure of your project
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
-
-Here follows a set up on how to structure your report and analyze the data you have opted for.
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
-
Part a)
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
-
-The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
-
Part b)
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
-
-You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
-
-
Part c)
-
-
-Then describe your algorithm and its implementation and tests you have performed.
-
-
Part d)
-
-
-Then presents your results and findings, link with existing literature and more.
-
-
Part e)
-
-
-Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
-
-
Solving partial differential equations with neural networks
-
-
-For this variant of project 3, we will assume that you have some
+
For this variant of project 3, we will assume that you have some
background in the solution of partial differential equations using
finite difference schemes. We will study the solution of the diffusion
equation in one dimension using a standard explicit scheme and neural
networks to solve the same equations.
+
-
-For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
-
-For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
-
Part a), setting up the problem
-
-
-The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
We are looking at a one-dimensional
problem
+
with initial conditions, i.e., the conditions at \( t=0 \),
$$
\begin{equation*}
u(x,0)= \sin{(\pi x)} \hspace{0.5cm} 0 < x < L,
\end{equation*}
$$
-with \( L=1 \) the length of the \( x \)-region of interest. The
+
with \( L=1 \) the length of the \( x \)-region of interest. The
boundary conditions are
+
$$
\begin{equation*}
@@ -236,18 +298,18 @@ u(L,t)= 0 \hspace{0.5cm} t \ge 0.
\end{equation*}
$$
-The function \( u(x,t) \) can be the temperature gradient of a rod.
-As time increases, the velocity approaches a linear variation with \( x \).
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
-
-We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
-Write down the algorithm and the equations you need to implement.
-Find also the analytical solution to the problem.
+
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
-
Part b)
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
-
-Implement the explicit scheme algorithm and perform tests of the solution
-for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
-
-
-Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
-
Part c) Neural networks
-
-
-Study now the lecture notes on solving ODEs and PDEs with neural
+
Study now the lecture notes on solving ODEs and PDEs with neural
network and use either your own code from project 2 or the
functionality of tensorflow/keras to solve the same equation as in
part b). Discuss your results and compare them with the standard
explicit scheme. Include also the analytical solution and compare with
that.
+
+
Part d) Solving eigenvalue problems
-
Part d) Solving eigenvalue problems
-
-
-Follow the discussion in the work of Yi et al. in the article from
+
Follow the discussion in the work of Yi et al. in the article from
Computers and Mathematics with Applications 47, 1155 (2004), and
use your differential equation solver with neural networks, set up a
simple square, real and symmetric \( 6\times 6 \) matrix and find the
eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
-
Part e)
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Introduction to numerical projects
-
-Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
-
-
Introduction to numerical projects
-
-
-Here follows a brief recipe and recommendation on how to write a report for each
+
Here follows a brief recipe and recommendation on how to write a report for each
project.
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
@@ -318,12 +374,11 @@ project.
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
Introduction to numerical projects
-
Introduction to numerical projects
-
-
-Here follows a brief recipe and recommendation on how to write a report for each
+
Here follows a brief recipe and recommendation on how to write a report for each
project.
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
@@ -336,63 +391,51 @@ project.
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
Format for electronic delivery of report and programs
-
Format for electronic delivery of report and programs
-
-
-The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
-
-Finally,
+
Finally,
we encourage you to collaborate. Optimal working groups consist of
-2-3 students. You can then hand in a common report.
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
-
Software and needed installations
-
-
-If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
we recommend that you install the following Python packages via pip as
-
+
See below for a discussion of tensorflow and scikit-learn.
-
-See below for a discussion of tensorflow and scikit-learn.
-
-
-For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
for a seamless installation of additional software via for example
-
+
brew install python3
-
-For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
you can use pip as well and simply install Python as
-
+
sudo apt-get install python3 (or python for python2.7)
+
etc etc.
-etc etc.
-
-
-If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
-
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
-
-Popular software packages written in Python for ML are
+
Popular software packages written in Python for ML are
-
-These are all freely available at their respective GitHub sites. They
+
These are all freely available at their respective GitHub sites. They
encompass communities of developers in the thousands or more. And the number
of code developers and contributors keeps increasing.
-
-
-
-
-
diff --git a/doc/Projects/2020/Project3/ipynb/Project3.ipynb b/doc/Projects/2020/Project3/ipynb/Project3.ipynb
index a84d561d2..87b64320c 100644
--- a/doc/Projects/2020/Project3/ipynb/Project3.ipynb
+++ b/doc/Projects/2020/Project3/ipynb/Project3.ipynb
@@ -2,23 +2,48 @@
"cells": [
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4eefd1b6",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "\n",
- "# Project 3 on Machine Learning, deadline December 16\n",
- "\n",
- " \n",
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "60bedd95",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Project 3 on Machine Learning, deadline December 17, 2021\n",
"**[Data Analysis and Machine Learning FYS-STK3155/FYS4155](http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html)**, Department of Physics, University of Oslo, Norway\n",
"\n",
- "Date: **Dec 11, 2020**\n",
- "\n",
- "Copyright 1999-2020, [Data Analysis and Machine Learning FYS-STK3155/FYS4155](http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html). Released under CC Attribution-NonCommercial 4.0 license\n",
- "\n",
- "\n",
- "\n",
- "\n",
- "# Paths for project 3\n",
+ "Date: **Nov 13, 2021**\n",
"\n",
+ "Copyright 1999-2021, [Data Analysis and Machine Learning FYS-STK3155/FYS4155](http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html). Released under CC Attribution-NonCommercial 4.0 license"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4c0f2617",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Paths for project 3"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6d6a33a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Defining the data sets to analyze yourself\n",
"\n",
"For project 3, you can propose own data sets that relate to your research interests or just use existing data sets from say\n",
@@ -45,33 +70,88 @@
"\n",
"We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.. \n",
"\n",
- "This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides [from week 43](https://compphysics.github.io/MachineLearning/doc/pub/week43/html/week43.html) and/or the textbook by [Yadav et al](https://www.springer.com/gp/book/9789401798150).\n",
- "\n",
+ "This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides [from week 43](https://compphysics.github.io/MachineLearning/doc/pub/week43/html/week43.html) and/or the textbook by [Yadav et al](https://www.springer.com/gp/book/9789401798150)."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "93851dd6",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## The basic structure of your project\n",
"\n",
- "Here follows a set up on how to structure your report and analyze the data you have opted for.\n",
- "\n",
+ "Here follows a set up on how to structure your report and analyze the data you have opted for."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d43e8960",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part a)\n",
"\n",
- "The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.\n",
- "\n",
+ "The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e8204f03",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part b)\n",
"\n",
- "You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.\n",
- "\n",
- "\n",
+ "You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dbc59b86",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part c)\n",
"\n",
- "Then describe your algorithm and its implementation and tests you have performed.\n",
- "\n",
+ "Then describe your algorithm and its implementation and tests you have performed."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dcff5b58",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part d)\n",
"\n",
- "Then presents your results and findings, link with existing literature and more.\n",
- "\n",
+ "Then presents your results and findings, link with existing literature and more."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "70e05a5c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part e)\n",
"\n",
- "Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature. \n",
- "\n",
+ "Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7899934c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Solving partial differential equations with neural networks\n",
"\n",
"For this variant of project 3, we will assume that you have some\n",
@@ -82,8 +162,16 @@
"\n",
"For the explicit scheme, you can study for example chapter 10 of the lecture notes in [Computational Physics](https://github.com/CompPhysics/ComputationalPhysics/blob/master/doc/Lectures/lectures2015.pdf) or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by [Kristine Baluka Hein](https://compphysics.github.io/MachineLearning/doc/pub/odenn/html/odenn-bs.html) at this course are highly recommended.\n",
"\n",
- "For the machine learning part you can use your own code from project 2 or the functionality of for example **Tensorflow/Keras**.. \n",
- "\n",
+ "For the machine learning part you can use your own code from project 2 or the functionality of for example **Tensorflow/Keras**.."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "054d1255",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part a), setting up the problem\n",
"\n",
"The physical problem can be that of the temperature gradient in a rod of length $L=1$ at $x=0$ and $x=1$.\n",
@@ -93,7 +181,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f0a14045",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial^2 u(x,t)}{\\partial x^2} =\\frac{\\partial u(x,t)}{\\partial t}, t> 0, x\\in [0,L]\n",
@@ -102,14 +193,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c115bb19",
+ "metadata": {
+ "editable": true
+ },
"source": [
"or"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6f297b9e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u_{xx} = u_t,\n",
@@ -118,14 +215,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b7eecb41",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with initial conditions, i.e., the conditions at $t=0$,"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b7ae63ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u(x,0)= \\sin{(\\pi x)} \\hspace{0.5cm} 0 < x < L,\n",
@@ -134,7 +237,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1536c36b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $L=1$ the length of the $x$-region of interest. The \n",
"boundary conditions are"
@@ -142,7 +248,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a4b5e85c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u(0,t)= 0 \\hspace{0.5cm} t \\ge 0,\n",
@@ -151,14 +260,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "017a9c0e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "47b0930b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u(L,t)= 0 \\hspace{0.5cm} t \\ge 0.\n",
@@ -167,7 +282,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5d12978d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The function $u(x,t)$ can be the temperature gradient of a rod.\n",
"As time increases, the velocity approaches a linear variation with $x$. \n",
@@ -177,7 +295,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "99a443e1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u_t\\approx \\frac{u(x,t+\\Delta t)-u(x,t)}{\\Delta t}=\\frac{u(x_i,t_j+\\Delta t)-u(x_i,t_j)}{\\Delta t}\n",
@@ -186,14 +307,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "efb9d4ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e4701f46",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u_{xx}\\approx \\frac{u(x+\\Delta x,t)-2u(x,t)+u(x-\\Delta x,t)}{\\Delta x^2},\n",
@@ -202,14 +329,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7a568111",
+ "metadata": {
+ "editable": true
+ },
"source": [
"or"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4ae11074",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"u_{xx}\\approx \\frac{u(x_i+\\Delta x,t_j)-2u(x_i,t_j)+u(x_i-\\Delta x,t_j)}{\\Delta x^2}.\n",
@@ -218,20 +351,38 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3b111fdd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Write down the algorithm and the equations you need to implement.\n",
- "Find also the analytical solution to the problem. \n",
- "\n",
+ "Find also the analytical solution to the problem."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b107a067",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part b)\n",
"\n",
"Implement the explicit scheme algorithm and perform tests of the solution \n",
"for $\\Delta x=1/10$, $\\Delta x=1/100$ using $\\Delta t$ as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that $\\Delta t/\\Delta x^2 \\leq 1/2$. \n",
"\n",
"Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved\n",
- "and $u(x,t_2)$ is almost linear, close to the stationary state.\n",
- "\n",
- "\n",
+ "and $u(x,t_2)$ is almost linear, close to the stationary state."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7e62077c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part c) Neural networks\n",
"\n",
"Study now the lecture notes on solving ODEs and PDEs with neural\n",
@@ -239,22 +390,44 @@
"functionality of tensorflow/keras to solve the same equation as in\n",
"part b). Discuss your results and compare them with the standard\n",
"explicit scheme. Include also the analytical solution and compare with\n",
- "that.\n",
- "\n",
- "\n",
+ "that."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2176774a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part d) Solving eigenvalue problems\n",
"\n",
"Follow the discussion in the work of Yi *et al.* in the article from\n",
"[Computers and Mathematics with Applications 47, 1155 (2004)](https://www.sciencedirect.com/science/article/pii/S0898122104901101), and\n",
"use your differential equation solver with neural networks, set up a\n",
"simple square, real and symmetric $6\\times 6$ matrix and find the\n",
- "eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.\n",
- "\n",
+ "eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9b623633",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"### Part e)\n",
"\n",
- "Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods. \n",
- "\n",
- "\n",
+ "Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "30a12295",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Introduction to numerical projects\n",
"\n",
"Here follows a brief recipe and recommendation on how to write a report for each\n",
@@ -276,8 +449,16 @@
"\n",
" * Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.\n",
"\n",
- " * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.\n",
- "\n",
+ " * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "46f47751",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Introduction to numerical projects\n",
"\n",
"Here follows a brief recipe and recommendation on how to write a report for each\n",
@@ -299,8 +480,16 @@
"\n",
" * Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.\n",
"\n",
- " * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.\n",
- "\n",
+ " * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e0329054",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Format for electronic delivery of report and programs\n",
"\n",
"The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:\n",
@@ -313,10 +502,16 @@
"\n",
"Finally, \n",
"we encourage you to collaborate. Optimal working groups consist of \n",
- "2-3 students. You can then hand in a common report. \n",
- "\n",
- "\n",
- "\n",
+ "2-3 students. You can then hand in a common report."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e3f10246",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Software and needed installations\n",
"\n",
"If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages, \n",
@@ -360,5 +555,5 @@
],
"metadata": {},
"nbformat": 4,
- "nbformat_minor": 4
+ "nbformat_minor": 5
}
diff --git a/doc/Projects/2020/Project3/ipynb/ipynb-Project3-src.tar.gz b/doc/Projects/2020/Project3/ipynb/ipynb-Project3-src.tar.gz
index 9e8559144..cc3e00964 100644
Binary files a/doc/Projects/2020/Project3/ipynb/ipynb-Project3-src.tar.gz and b/doc/Projects/2020/Project3/ipynb/ipynb-Project3-src.tar.gz differ
diff --git a/doc/Projects/2020/Project3/pdf/Project3.p.tex b/doc/Projects/2020/Project3/pdf/Project3.p.tex
index 6a1f7637e..044cbbf02 100644
--- a/doc/Projects/2020/Project3/pdf/Project3.p.tex
+++ b/doc/Projects/2020/Project3/pdf/Project3.p.tex
@@ -1,12 +1,12 @@
%%
%% Automatically generated file from DocOnce source
-%% (https://github.com/hplgit/doconce/)
-%%
+%% (https://github.com/doconce/doconce/)
+%% doconce format latex Project3.do.txt --print_latex_style=trac --latex_admon=paragraph
%%
% #ifdef PTEX2TEX_EXPLANATION
%%
%% The file follows the ptex2tex extended LaTeX format, see
-%% ptex2tex: http://code.google.com/p/ptex2tex/
+%% ptex2tex: https://code.google.com/p/ptex2tex/
%%
%% Run
%% ptex2tex myfile
@@ -14,7 +14,7 @@
%% doconce ptex2tex myfile
%%
%% to turn myfile.p.tex into an ordinary LaTeX file myfile.tex.
-%% (The ptex2tex program: http://code.google.com/p/ptex2tex)
+%% (The ptex2tex program: https://code.google.com/p/ptex2tex)
%% Many preprocess options can be added to ptex2tex or doconce ptex2tex
%%
%% ptex2tex -DMINTED myfile
@@ -79,14 +79,14 @@ final, % draft: marks overfull hboxes, figures with paths
% Ensure copyright on titlepage (article style) and chapter pages (book style)
\fancypagestyle{plain}{
\fancyhf{}
- \fancyfoot[C]{{\footnotesize \copyright\ 1999-2020, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
% \renewcommand{\footrulewidth}{0mm}
\renewcommand{\headrulewidth}{0mm}
}
% Ensure copyright on titlepages with \thispagestyle{empty}
\fancypagestyle{empty}{
\fancyhf{}
- \fancyfoot[C]{{\footnotesize \copyright\ 1999-2020, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
\renewcommand{\footrulewidth}{0mm}
\renewcommand{\headrulewidth}{0mm}
}
@@ -129,7 +129,7 @@ final, % draft: marks overfull hboxes, figures with paths
\begin{center}
{\LARGE\bf
\begin{spacing}{1.25}
-Project 3 on Machine Learning, deadline December 16
+Project 3 on Machine Learning, deadline December 17, 2021
\end{spacing}
}
\end{center}
@@ -149,7 +149,7 @@ Project 3 on Machine Learning, deadline December 16
% --- begin date ---
\begin{center}
-Dec 11, 2020
+Nov 13, 2021
\end{center}
% --- end date ---
@@ -205,7 +205,6 @@ The first part deals with structuring and reading the data, much along the same
\paragraph{Part b).}
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
-
\paragraph{Part c).}
Then describe your algorithm and its implementation and tests you have performed.
@@ -283,7 +282,6 @@ for $\Delta x=1/10$, $\Delta x=1/100$ using $\Delta t$ as dictated by the stabi
Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved
and $u(x,t_2)$ is almost linear, close to the stationary state.
-
\paragraph{Part c) Neural networks.}
Study now the lecture notes on solving ODEs and PDEs with neural
network and use either your own code from project 2 or the
@@ -292,7 +290,6 @@ part b). Discuss your results and compare them with the standard
explicit scheme. Include also the analytical solution and compare with
that.
-
\paragraph{Part d) Solving eigenvalue problems.}
Follow the discussion in the work of Yi \emph{et al.} in the article from
\href{{https://www.sciencedirect.com/science/article/pii/S0898122104901101}}{Computers and Mathematics with Applications 47, 1155 (2004)}, and
@@ -303,7 +300,6 @@ eigenvalues. Compare with the solution from numerical diagonalization with stand
\paragraph{Part e).}
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
-
\subsection{Introduction to numerical projects}
Here follows a brief recipe and recommendation on how to write a report for each
@@ -373,8 +369,6 @@ Finally,
we encourage you to collaborate. Optimal working groups consist of
2-3 students. You can then hand in a common report.
-
-
\subsection{Software and needed installations}
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
@@ -430,9 +424,6 @@ encompass communities of developers in the thousands or more. And the number
of code developers and contributors keeps increasing.
-
-
-
% ------------------- end of main content ---------------
% #ifdef PREAMBLE
diff --git a/doc/Projects/2020/Project3/pdf/Project3.pdf b/doc/Projects/2020/Project3/pdf/Project3.pdf
index 54358200b..4353dafc0 100644
Binary files a/doc/Projects/2020/Project3/pdf/Project3.pdf and b/doc/Projects/2020/Project3/pdf/Project3.pdf differ
diff --git a/doc/Projects/2020/Project3/pdf/Project3.tex b/doc/Projects/2020/Project3/pdf/Project3.tex
index 7bb5aa7fa..599d6f39f 100644
--- a/doc/Projects/2020/Project3/pdf/Project3.tex
+++ b/doc/Projects/2020/Project3/pdf/Project3.tex
@@ -1,7 +1,7 @@
%%
%% Automatically generated file from DocOnce source
-%% (https://github.com/hplgit/doconce/)
-%%
+%% (https://github.com/doconce/doconce/)
+%% doconce format latex Project3.do.txt --print_latex_style=trac --latex_admon=paragraph
%%
@@ -54,14 +54,14 @@ final, % draft: marks overfull hboxes, figures with paths
% Ensure copyright on titlepage (article style) and chapter pages (book style)
\fancypagestyle{plain}{
\fancyhf{}
- \fancyfoot[C]{{\footnotesize \copyright\ 1999-2020, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
% \renewcommand{\footrulewidth}{0mm}
\renewcommand{\headrulewidth}{0mm}
}
% Ensure copyright on titlepages with \thispagestyle{empty}
\fancypagestyle{empty}{
\fancyhf{}
- \fancyfoot[C]{{\footnotesize \copyright\ 1999-2020, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
\renewcommand{\footrulewidth}{0mm}
\renewcommand{\headrulewidth}{0mm}
}
@@ -103,7 +103,7 @@ final, % draft: marks overfull hboxes, figures with paths
\begin{center}
{\LARGE\bf
\begin{spacing}{1.25}
-Project 3 on Machine Learning, deadline December 16
+Project 3 on Machine Learning, deadline December 17, 2021
\end{spacing}
}
\end{center}
@@ -123,7 +123,7 @@ Project 3 on Machine Learning, deadline December 16
% --- begin date ---
\begin{center}
-Dec 11, 2020
+Nov 13, 2021
\end{center}
% --- end date ---
@@ -179,7 +179,6 @@ The first part deals with structuring and reading the data, much along the same
\paragraph{Part b).}
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
-
\paragraph{Part c).}
Then describe your algorithm and its implementation and tests you have performed.
@@ -257,7 +256,6 @@ for $\Delta x=1/10$, $\Delta x=1/100$ using $\Delta t$ as dictated by the stabi
Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved
and $u(x,t_2)$ is almost linear, close to the stationary state.
-
\paragraph{Part c) Neural networks.}
Study now the lecture notes on solving ODEs and PDEs with neural
network and use either your own code from project 2 or the
@@ -266,7 +264,6 @@ part b). Discuss your results and compare them with the standard
explicit scheme. Include also the analytical solution and compare with
that.
-
\paragraph{Part d) Solving eigenvalue problems.}
Follow the discussion in the work of Yi \emph{et al.} in the article from
\href{{https://www.sciencedirect.com/science/article/pii/S0898122104901101}}{Computers and Mathematics with Applications 47, 1155 (2004)}, and
@@ -277,7 +274,6 @@ eigenvalues. Compare with the solution from numerical diagonalization with stand
\paragraph{Part e).}
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
-
\subsection*{Introduction to numerical projects}
Here follows a brief recipe and recommendation on how to write a report for each
@@ -347,8 +343,6 @@ Finally,
we encourage you to collaborate. Optimal working groups consist of
2-3 students. You can then hand in a common report.
-
-
\subsection*{Software and needed installations}
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
@@ -404,9 +398,6 @@ encompass communities of developers in the thousands or more. And the number
of code developers and contributors keeps increasing.
-
-
-
% ------------------- end of main content ---------------
\end{document}
diff --git a/doc/Projects/2021/Project3/html/._Project3-bs000.html b/doc/Projects/2021/Project3/html/._Project3-bs000.html
new file mode 100644
index 000000000..dccf24e20
--- /dev/null
+++ b/doc/Projects/2021/Project3/html/._Project3-bs000.html
@@ -0,0 +1,457 @@
+
+
+
+
+
+
+
+Project 3 on Machine Learning, deadline December 17, 2021
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+
+
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Adversarial Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as Principal Component Analysis and k-means Clustering.
+
+
For Boosting, feel also free to write your own codes.
+
+
+
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
+
The estimates you used and tested in projects 1 and 2 should also be included, that is the \( R2 \)-score, MSE, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.
+
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
+
Note: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise.
+
The basic structure of your project
+
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
+
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
+
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
+
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
+
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
+
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
+
+
For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
+
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+We are looking at a one-dimensional
+problem
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
+
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
+
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
+
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
+
+
Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+
Part d) Solving eigenvalue problems
+
+
Follow the discussion in the work of Yi et al. in the article from
+Computers and Mathematics with Applications 47, 1155 (2004), and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric \( 6\times 6 \) matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
+
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Additonal (optional) exercise, adding 30 more points to final score
+
+
This exercise can be done independently of the other tasks. Here you
+can also choose the data set you want to use. Furthermore, you can use
+your codes from projects 1 and 2 as well as the codes here or simply use
+libraries like Scikit-Learn, Tensorflow or similar.
+
+
+
Your task is to perform an analysis of the bias-variance tradeoff
+using at least three of the main sets of algorithms we have discussed in this
+course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.
+
+
+
You
+are free to choose between bootstrap for resampling (recommended) or
+cross-validation in order to get the best possible estimates. The
+methods you could study are Linear Regression (OLS, Ridge and Lasso),
+deep learning (feed forward neural networks and/or recurrent neural
+networks), Ensemble methods (decision trees, bagging, random forests
+and boosting) and support vector machines.
+
+
+
Study the bias-variance tradeoff for at least three of these sets of
+algorithms for a data set of your choice as function of the complexity
+of your model. Comment and discuss the results. Discuss the pros and
+cons of the various methods. Are there some methods which provide both
+low variance and low bias?
+
+
+
Hint: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree.
+
Introduction to numerical projects
+
+
Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+
+
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
Include the source code of your program. Comment your program properly.
+
If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
Try to give an interpretation of you results in your answers to the problems.
+
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
+
Format for electronic delivery of report and programs
+
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+
+
Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
+
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via pip as
+
See below for a discussion of tensorflow and scikit-learn.
+
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+for a seamless installation of additional software via for example
+
+
+
brew install python3
+
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use pip as well and simply install Python as
+
+
+
sudo apt-get install python3 (or python for python2.7)
+
+
etc etc.
+
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+
+
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
+
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+
+
Popular software packages written in Python for ML are
These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+
+
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Adversarial Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as Principal Component Analysis and k-means Clustering.
+
+
For Boosting, feel also free to write your own codes.
+
+
+
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
+
The estimates you used and tested in projects 1 and 2 should also be included, that is the \( R2 \)-score, MSE, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.
+
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
+
Note: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise.
+
The basic structure of your project
+
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
+
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
+
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
+
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
+
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
+
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
+
+
For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
+
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+We are looking at a one-dimensional
+problem
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
+
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
+
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
+
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
+
+
Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+
Part d) Solving eigenvalue problems
+
+
Follow the discussion in the work of Yi et al. in the article from
+Computers and Mathematics with Applications 47, 1155 (2004), and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric \( 6\times 6 \) matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
+
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Additonal (optional) exercise, adding 30 more points to final score
+
+
This exercise can be done independently of the other tasks. Here you
+can also choose the data set you want to use. Furthermore, you can use
+your codes from projects 1 and 2 as well as the codes here or simply use
+libraries like Scikit-Learn, Tensorflow or similar.
+
+
+
Your task is to perform an analysis of the bias-variance tradeoff
+using at least three of the main sets of algorithms we have discussed in this
+course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.
+
+
+
You
+are free to choose between bootstrap for resampling (recommended) or
+cross-validation in order to get the best possible estimates. The
+methods you could study are Linear Regression (OLS, Ridge and Lasso),
+deep learning (feed forward neural networks and/or recurrent neural
+networks), Ensemble methods (decision trees, bagging, random forests
+and boosting) and support vector machines.
+
+
+
Study the bias-variance tradeoff for at least three of these sets of
+algorithms for a data set of your choice as function of the complexity
+of your model. Comment and discuss the results. Discuss the pros and
+cons of the various methods. Are there some methods which provide both
+low variance and low bias?
+
+
+
Hint: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree.
+
Introduction to numerical projects
+
+
Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+
+
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
Include the source code of your program. Comment your program properly.
+
If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
Try to give an interpretation of you results in your answers to the problems.
+
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
+
Format for electronic delivery of report and programs
+
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+
+
Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
+
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via pip as
+
See below for a discussion of tensorflow and scikit-learn.
+
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+for a seamless installation of additional software via for example
+
+
+
brew install python3
+
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use pip as well and simply install Python as
+
+
+
sudo apt-get install python3 (or python for python2.7)
+
+
etc etc.
+
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+
+
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
+
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+
+
Popular software packages written in Python for ML are
These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+
+
Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among linear regression (including Ridge and Lasso), Logistic Regression, Neural Networks, Convolution Neural Networks, Recurrent Neural Networks, Adversarial Neural Networks, Support Vector Machines and Decision Trees, Random Forests, Bagging and Boosting. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into convolutional neural networks or recurrent neural networks, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as Principal Component Analysis and k-means Clustering.
+
+
For Boosting, feel also free to write your own codes.
+
+
+
For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of Scikit-Learn, Tensorflow, etc.
+
The estimates you used and tested in projects 1 and 2 should also be included, that is the \( R2 \)-score, MSE, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+
+
All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+
We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.
+
+
This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides from week 43 and/or the textbook by Yadav et al.
+
+
Note: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise.
+
The basic structure of your project
+
+
Here follows a set up on how to structure your report and analyze the data you have opted for.
+
Part a)
+
+
The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
Part b)
+
+
You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
Part c)
+
+
Then describe your algorithm and its implementation and tests you have performed.
+
Part d)
+
+
Then presents your results and findings, link with existing literature and more.
+
Part e)
+
+
Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
Solving partial differential equations with neural networks
+
+
For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+
+
For the explicit scheme, you can study for example chapter 10 of the lecture notes in Computational Physics or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by Kristine Baluka Hein at this course are highly recommended.
+
+
For the machine learning part you can use your own code from project 2 or the functionality of for example Tensorflow/Keras..
+
Part a), setting up the problem
+
+
The physical problem can be that of the temperature gradient in a rod of length \( L=1 \) at \( x=0 \) and \( x=1 \).
+We are looking at a one-dimensional
+problem
+
The function \( u(x,t) \) can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with \( x \).
+
+
+
We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+
Part b)
+
+
Implement the explicit scheme algorithm and perform tests of the solution
+for \( \Delta x=1/10 \), \( \Delta x=1/100 \) using \( \Delta t \) as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that \( \Delta t/\Delta x^2 \leq 1/2 \).
+
+
+
Study the solutions at two time points \( t_1 \) and \( t_2 \) where \( u(x,t_1) \) is smooth but still significantly curved
+and \( u(x,t_2) \) is almost linear, close to the stationary state.
+
+
Part c) Neural networks
+
+
Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+
Part d) Solving eigenvalue problems
+
+
Follow the discussion in the work of Yi et al. in the article from
+Computers and Mathematics with Applications 47, 1155 (2004), and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric \( 6\times 6 \) matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+
Part e)
+
+
Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
Additonal (optional) exercise, adding 30 more points to final score
+
+
This exercise can be done independently of the other tasks. Here you
+can also choose the data set you want to use. Furthermore, you can use
+your codes from projects 1 and 2 as well as the codes here or simply use
+libraries like Scikit-Learn, Tensorflow or similar.
+
+
+
Your task is to perform an analysis of the bias-variance tradeoff
+using at least three of the main sets of algorithms we have discussed in this
+course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.
+
+
+
You
+are free to choose between bootstrap for resampling (recommended) or
+cross-validation in order to get the best possible estimates. The
+methods you could study are Linear Regression (OLS, Ridge and Lasso),
+deep learning (feed forward neural networks and/or recurrent neural
+networks), Ensemble methods (decision trees, bagging, random forests
+and boosting) and support vector machines.
+
+
+
Study the bias-variance tradeoff for at least three of these sets of
+algorithms for a data set of your choice as function of the complexity
+of your model. Comment and discuss the results. Discuss the pros and
+cons of the various methods. Are there some methods which provide both
+low variance and low bias?
+
+
+
Hint: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree.
+
Introduction to numerical projects
+
+
Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+
+
+
Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
Include the source code of your program. Comment your program properly.
+
If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
Try to give an interpretation of you results in your answers to the problems.
+
Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+
+
Format for electronic delivery of report and programs
+
+
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Upload only the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+
+
Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+
Software and needed installations
+
+
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via pip as
+
See below for a discussion of tensorflow and scikit-learn.
+
+
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows
+for a seamless installation of additional software via for example
+
+
+
brew install python3
+
+
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use pip as well and simply install Python as
+
+
+
sudo apt-get install python3 (or python for python2.7)
+
+
etc etc.
+
+
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+
+
Anaconda Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system conda
+
Enthought canopy is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+
+
Popular software packages written in Python for ML are
These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
+
+
+
diff --git a/doc/Projects/2021/Project3/ipynb/Project3.ipynb b/doc/Projects/2021/Project3/ipynb/Project3.ipynb
new file mode 100644
index 000000000..3fb613d09
--- /dev/null
+++ b/doc/Projects/2021/Project3/ipynb/Project3.ipynb
@@ -0,0 +1,567 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "e6c08da8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0309e266",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Project 3 on Machine Learning, deadline December 17, 2021\n",
+ "**[Data Analysis and Machine Learning FYS-STK3155/FYS4155](http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html)**, Department of Physics, University of Oslo, Norway\n",
+ "\n",
+ "Date: **Nov 14, 2021**\n",
+ "\n",
+ "Copyright 1999-2021, [Data Analysis and Machine Learning FYS-STK3155/FYS4155](http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html). Released under CC Attribution-NonCommercial 4.0 license"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cedebbe4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Paths for project 3"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9038e49a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Defining the data sets to analyze yourself\n",
+ "\n",
+ "For project 3, you can propose own data sets that relate to your research interests or just use existing data sets from say\n",
+ "1. [Kaggle](https://www.kaggle.com/datasets) \n",
+ "\n",
+ "2. The [University of California at Irvine (UCI) with its machine learning repository](https://archive.ics.uci.edu/ml/index.php).\n",
+ "\n",
+ "3. Or other sources.\n",
+ "\n",
+ "The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:\n",
+ "1. Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among **linear regression (including Ridge and Lasso)**, **Logistic Regression**, **Neural Networks**, **Convolution Neural Networks**, **Recurrent Neural Networks**, **Adversarial Neural Networks**, **Support Vector Machines** and **Decision Trees, Random Forests, Bagging and Boosting**. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into **convolutional neural networks** or **recurrent neural networks**, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as **Principal Component Analysis** and **k-means Clustering**.\n",
+ "\n",
+ "For Boosting, feel also free to write your own codes.\n",
+ "\n",
+ "1. For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of **Scikit-Learn**, **Tensorflow**, etc. \n",
+ "\n",
+ "2. The estimates you used and tested in projects 1 and 2 should also be included, that is the $R2$-score, **MSE**, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.\n",
+ "\n",
+ "3. Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.\n",
+ "\n",
+ "4. If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article? \n",
+ "\n",
+ "5. A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.\n",
+ "\n",
+ "All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..\n",
+ "\n",
+ "We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.\n",
+ "\n",
+ "This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides [from week 43](https://compphysics.github.io/MachineLearning/doc/pub/week42/html/week42.html) and/or the textbook by [Yadav et al](https://www.springer.com/gp/book/9789401798150).\n",
+ "\n",
+ "**Note**: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "89190c80",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The basic structure of your project\n",
+ "\n",
+ "Here follows a set up on how to structure your report and analyze the data you have opted for."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b2944795",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part a)\n",
+ "\n",
+ "The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5d7f5f66",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part b)\n",
+ "\n",
+ "You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "55083a27",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part c)\n",
+ "\n",
+ "Then describe your algorithm and its implementation and tests you have performed."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "26bb3996",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part d)\n",
+ "\n",
+ "Then presents your results and findings, link with existing literature and more."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "99cbbdf4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part e)\n",
+ "\n",
+ "Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1cf8305f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving partial differential equations with neural networks\n",
+ "\n",
+ "For this variant of project 3, we will assume that you have some\n",
+ "background in the solution of partial differential equations using\n",
+ "finite difference schemes. We will study the solution of the diffusion\n",
+ "equation in one dimension using a standard explicit scheme and neural\n",
+ "networks to solve the same equations.\n",
+ "\n",
+ "For the explicit scheme, you can study for example chapter 10 of the lecture notes in [Computational Physics](https://github.com/CompPhysics/ComputationalPhysics/blob/master/doc/Lectures/lectures2015.pdf) or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by [Kristine Baluka Hein](https://compphysics.github.io/MachineLearning/doc/pub/odenn/html/odenn-bs.html) at this course are highly recommended.\n",
+ "\n",
+ "For the machine learning part you can use your own code from project 2 or the functionality of for example **Tensorflow/Keras**.."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c76618e8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part a), setting up the problem\n",
+ "\n",
+ "The physical problem can be that of the temperature gradient in a rod of length $L=1$ at $x=0$ and $x=1$.\n",
+ "We are looking at a one-dimensional\n",
+ "problem"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ac2c5732",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{\\partial^2 u(x,t)}{\\partial x^2} =\\frac{\\partial u(x,t)}{\\partial t}, t> 0, x\\in [0,L]\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ead9d520",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "or"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8db95bf3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u_{xx} = u_t,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2f93712e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with initial conditions, i.e., the conditions at $t=0$,"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "62a0980a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u(x,0)= \\sin{(\\pi x)} \\hspace{0.5cm} 0 < x < L,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "28f54a78",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $L=1$ the length of the $x$-region of interest. The \n",
+ "boundary conditions are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e0068e8b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u(0,t)= 0 \\hspace{0.5cm} t \\ge 0,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9ae2916",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "88e71606",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u(L,t)= 0 \\hspace{0.5cm} t \\ge 0.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "69bc12e7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The function $u(x,t)$ can be the temperature gradient of a rod.\n",
+ "As time increases, the velocity approaches a linear variation with $x$. \n",
+ "\n",
+ "We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fa2123d5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u_t\\approx \\frac{u(x,t+\\Delta t)-u(x,t)}{\\Delta t}=\\frac{u(x_i,t_j+\\Delta t)-u(x_i,t_j)}{\\Delta t}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "27474b17",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1c4da408",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u_{xx}\\approx \\frac{u(x+\\Delta x,t)-2u(x,t)+u(x-\\Delta x,t)}{\\Delta x^2},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "06021617",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "or"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b845d906",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "u_{xx}\\approx \\frac{u(x_i+\\Delta x,t_j)-2u(x_i,t_j)+u(x_i-\\Delta x,t_j)}{\\Delta x^2}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6c3956bc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Write down the algorithm and the equations you need to implement.\n",
+ "Find also the analytical solution to the problem."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "15d51aa1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part b)\n",
+ "\n",
+ "Implement the explicit scheme algorithm and perform tests of the solution \n",
+ "for $\\Delta x=1/10$, $\\Delta x=1/100$ using $\\Delta t$ as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that $\\Delta t/\\Delta x^2 \\leq 1/2$. \n",
+ "\n",
+ "Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved\n",
+ "and $u(x,t_2)$ is almost linear, close to the stationary state."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "356b0ce1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part c) Neural networks\n",
+ "\n",
+ "Study now the lecture notes on solving ODEs and PDEs with neural\n",
+ "network and use either your own code from project 2 or the\n",
+ "functionality of tensorflow/keras to solve the same equation as in\n",
+ "part b). Discuss your results and compare them with the standard\n",
+ "explicit scheme. Include also the analytical solution and compare with\n",
+ "that."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5254f0ec",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part d) Solving eigenvalue problems\n",
+ "\n",
+ "Follow the discussion in the work of Yi *et al.* in the article from\n",
+ "[Computers and Mathematics with Applications 47, 1155 (2004)](https://www.sciencedirect.com/science/article/pii/S0898122104901101), and\n",
+ "use your differential equation solver with neural networks, set up a\n",
+ "simple square, real and symmetric $6\\times 6$ matrix and find the\n",
+ "eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fb586020",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Part e)\n",
+ "\n",
+ "Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8f43137a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Additonal (optional) exercise, adding 30 more points to final score\n",
+ "\n",
+ "This exercise can be done independently of the other tasks. Here you\n",
+ "can also choose the data set you want to use. Furthermore, you can use\n",
+ "your codes from projects 1 and 2 as well as the codes here or simply use\n",
+ "libraries like **Scikit-Learn**, **Tensorflow** or similar.\n",
+ "\n",
+ "Your task is to perform an analysis of the bias-variance tradeoff\n",
+ "using at least three of the main sets of algorithms we have discussed in this\n",
+ "course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.\n",
+ "\n",
+ "You\n",
+ "are free to choose between bootstrap for resampling (recommended) or\n",
+ "cross-validation in order to get the best possible estimates. The\n",
+ "methods you could study are Linear Regression (OLS, Ridge and Lasso),\n",
+ "deep learning (feed forward neural networks and/or recurrent neural\n",
+ "networks), Ensemble methods (decision trees, bagging, random forests\n",
+ "and boosting) and support vector machines.\n",
+ "\n",
+ "Study the bias-variance tradeoff for at least three of these sets of\n",
+ "algorithms for a data set of your choice as function of the complexity\n",
+ "of your model. Comment and discuss the results. Discuss the pros and\n",
+ "cons of the various methods. Are there some methods which provide both\n",
+ "low variance and low bias?\n",
+ "\n",
+ "**Hint**: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5efcf1de",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Introduction to numerical projects\n",
+ "\n",
+ "Here follows a brief recipe and recommendation on how to write a report for each\n",
+ "project.\n",
+ "\n",
+ " * Give a short description of the nature of the problem and the eventual numerical methods you have used.\n",
+ "\n",
+ " * Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.\n",
+ "\n",
+ " * Include the source code of your program. Comment your program properly.\n",
+ "\n",
+ " * If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.\n",
+ "\n",
+ " * Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.\n",
+ "\n",
+ " * Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.\n",
+ "\n",
+ " * Try to give an interpretation of you results in your answers to the problems.\n",
+ "\n",
+ " * Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.\n",
+ "\n",
+ " * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e53cd89a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Format for electronic delivery of report and programs\n",
+ "\n",
+ "The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:\n",
+ "\n",
+ " * Use Canvas to hand in your projects, log in at with your normal UiO username and password.\n",
+ "\n",
+ " * Upload **only** the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.\n",
+ "\n",
+ " * In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.\n",
+ "\n",
+ "Finally, \n",
+ "we encourage you to collaborate. Optimal working groups consist of \n",
+ "2-3 students. You can then hand in a common report."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1b49648",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Software and needed installations\n",
+ "\n",
+ "If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages, \n",
+ "we recommend that you install the following Python packages via **pip** as\n",
+ "1. pip install numpy scipy matplotlib ipython scikit-learn tensorflow sympy pandas pillow\n",
+ "\n",
+ "For Python3, replace **pip** with **pip3**.\n",
+ "\n",
+ "See below for a discussion of **tensorflow** and **scikit-learn**. \n",
+ "\n",
+ "For OSX users we recommend also, after having installed Xcode, to install **brew**. Brew allows \n",
+ "for a seamless installation of additional software via for example\n",
+ "1. brew install python3\n",
+ "\n",
+ "For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution\n",
+ "you can use **pip** as well and simply install Python as \n",
+ "1. sudo apt-get install python3 (or python for python2.7)\n",
+ "\n",
+ "etc etc. \n",
+ "\n",
+ "If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely\n",
+ "1. [Anaconda](https://docs.anaconda.com/) Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system **conda**\n",
+ "\n",
+ "2. [Enthought canopy](https://www.enthought.com/product/canopy/) is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.\n",
+ "\n",
+ "Popular software packages written in Python for ML are\n",
+ "\n",
+ "* [Scikit-learn](http://scikit-learn.org/stable/), \n",
+ "\n",
+ "* [Tensorflow](https://www.tensorflow.org/),\n",
+ "\n",
+ "* [PyTorch](http://pytorch.org/) and \n",
+ "\n",
+ "* [Keras](https://keras.io/).\n",
+ "\n",
+ "These are all freely available at their respective GitHub sites. They \n",
+ "encompass communities of developers in the thousands or more. And the number\n",
+ "of code developers and contributors keeps increasing."
+ ]
+ }
+ ],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/doc/Projects/2021/Project3/ipynb/ipynb-Project3-src.tar.gz b/doc/Projects/2021/Project3/ipynb/ipynb-Project3-src.tar.gz
new file mode 100644
index 000000000..c9332ae71
Binary files /dev/null and b/doc/Projects/2021/Project3/ipynb/ipynb-Project3-src.tar.gz differ
diff --git a/doc/Projects/2021/Project3/pdf/Project3.p.tex b/doc/Projects/2021/Project3/pdf/Project3.p.tex
new file mode 100644
index 000000000..03a195fde
--- /dev/null
+++ b/doc/Projects/2021/Project3/pdf/Project3.p.tex
@@ -0,0 +1,437 @@
+%%
+%% Automatically generated file from DocOnce source
+%% (https://github.com/doconce/doconce/)
+%% doconce format latex Project3.do.txt --print_latex_style=trac --latex_admon=paragraph
+%%
+% #ifdef PTEX2TEX_EXPLANATION
+%%
+%% The file follows the ptex2tex extended LaTeX format, see
+%% ptex2tex: https://code.google.com/p/ptex2tex/
+%%
+%% Run
+%% ptex2tex myfile
+%% or
+%% doconce ptex2tex myfile
+%%
+%% to turn myfile.p.tex into an ordinary LaTeX file myfile.tex.
+%% (The ptex2tex program: https://code.google.com/p/ptex2tex)
+%% Many preprocess options can be added to ptex2tex or doconce ptex2tex
+%%
+%% ptex2tex -DMINTED myfile
+%% doconce ptex2tex myfile envir=minted
+%%
+%% ptex2tex will typeset code environments according to a global or local
+%% .ptex2tex.cfg configure file. doconce ptex2tex will typeset code
+%% according to options on the command line (just type doconce ptex2tex to
+%% see examples). If doconce ptex2tex has envir=minted, it enables the
+%% minted style without needing -DMINTED.
+% #endif
+
+% #define PREAMBLE
+
+% #ifdef PREAMBLE
+%-------------------- begin preamble ----------------------
+
+\documentclass[%
+oneside, % oneside: electronic viewing, twoside: printing
+final, % draft: marks overfull hboxes, figures with paths
+10pt]{article}
+
+\listfiles % print all files needed to compile this document
+
+\usepackage{relsize,makeidx,color,setspace,amsmath,amsfonts,amssymb}
+\usepackage[table]{xcolor}
+\usepackage{bm,ltablex,microtype}
+
+\usepackage[pdftex]{graphicx}
+
+\usepackage[T1]{fontenc}
+%\usepackage[latin1]{inputenc}
+\usepackage{ucs}
+\usepackage[utf8x]{inputenc}
+
+\usepackage{lmodern} % Latin Modern fonts derived from Computer Modern
+
+% Hyperlinks in PDF:
+\definecolor{linkcolor}{rgb}{0,0,0.4}
+\usepackage{hyperref}
+\hypersetup{
+ breaklinks=true,
+ colorlinks=true,
+ linkcolor=linkcolor,
+ urlcolor=linkcolor,
+ citecolor=black,
+ filecolor=black,
+ %filecolor=blue,
+ pdfmenubar=true,
+ pdftoolbar=true,
+ bookmarksdepth=3 % Uncomment (and tweak) for PDF bookmarks with more levels than the TOC
+ }
+%\hyperbaseurl{} % hyperlinks are relative to this root
+
+\setcounter{tocdepth}{2} % levels in table of contents
+
+% --- fancyhdr package for fancy headers ---
+\usepackage{fancyhdr}
+\fancyhf{} % sets both header and footer to nothing
+\renewcommand{\headrulewidth}{0pt}
+\fancyfoot[LE,RO]{\thepage}
+% Ensure copyright on titlepage (article style) and chapter pages (book style)
+\fancypagestyle{plain}{
+ \fancyhf{}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+% \renewcommand{\footrulewidth}{0mm}
+ \renewcommand{\headrulewidth}{0mm}
+}
+% Ensure copyright on titlepages with \thispagestyle{empty}
+\fancypagestyle{empty}{
+ \fancyhf{}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \renewcommand{\footrulewidth}{0mm}
+ \renewcommand{\headrulewidth}{0mm}
+}
+
+\pagestyle{fancy}
+
+
+% prevent orhpans and widows
+\clubpenalty = 10000
+\widowpenalty = 10000
+
+% --- end of standard preamble for documents ---
+
+
+% insert custom LaTeX commands...
+
+\raggedbottom
+\makeindex
+\usepackage[totoc]{idxlayout} % for index in the toc
+\usepackage[nottoc]{tocbibind} % for references/bibliography in the toc
+
+%-------------------- end preamble ----------------------
+
+\begin{document}
+
+% matching end for #ifdef PREAMBLE
+% #endif
+
+\newcommand{\exercisesection}[1]{\subsection*{#1}}
+
+
+% ------------------- main content ----------------------
+
+
+
+% ----------------- title -------------------------
+
+\thispagestyle{empty}
+
+\begin{center}
+{\LARGE\bf
+\begin{spacing}{1.25}
+Project 3 on Machine Learning, deadline December 17, 2021
+\end{spacing}
+}
+\end{center}
+
+% ----------------- author(s) -------------------------
+
+\begin{center}
+{\bf \href{{http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html}}{Data Analysis and Machine Learning FYS-STK3155/FYS4155}}
+\end{center}
+
+ \begin{center}
+% List of all institutions:
+\centerline{{\small Department of Physics, University of Oslo, Norway}}
+\end{center}
+
+% ----------------- end author(s) -------------------------
+
+% --- begin date ---
+\begin{center}
+Nov 14, 2021
+\end{center}
+% --- end date ---
+
+\vspace{1cm}
+
+
+\section{Paths for project 3}
+
+\subsection{Defining the data sets to analyze yourself}
+
+For project 3, you can propose own data sets that relate to your research interests or just use existing data sets from say
+\begin{enumerate}
+\item \href{{https://www.kaggle.com/datasets}}{Kaggle}
+
+\item The \href{{https://archive.ics.uci.edu/ml/index.php}}{University of California at Irvine (UCI) with its machine learning repository}.
+
+\item Or other sources.
+\end{enumerate}
+
+\noindent
+The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+\begin{enumerate}
+\item Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among \textbf{linear regression (including Ridge and Lasso)}, \textbf{Logistic Regression}, \textbf{Neural Networks}, \textbf{Convolution Neural Networks}, \textbf{Recurrent Neural Networks}, \textbf{Adversarial Neural Networks}, \textbf{Support Vector Machines} and \textbf{Decision Trees, Random Forests, Bagging and Boosting}. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into \textbf{convolutional neural networks} or \textbf{recurrent neural networks}, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as \textbf{Principal Component Analysis} and \textbf{k-means Clustering}.
+\end{enumerate}
+
+\noindent
+For Boosting, feel also free to write your own codes.
+
+\begin{enumerate}
+\item For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of \textbf{Scikit-Learn}, \textbf{Tensorflow}, etc.
+
+\item The estimates you used and tested in projects 1 and 2 should also be included, that is the $R2$-score, \textbf{MSE}, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
+\item Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
+\item If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
+\item A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+\end{enumerate}
+
+\noindent
+All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.
+
+This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides \href{{https://compphysics.github.io/MachineLearning/doc/pub/week42/html/week42.html}}{from week 43} and/or the textbook by \href{{https://www.springer.com/gp/book/9789401798150}}{Yadav et al}.
+
+\textbf{Note}: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise.
+
+\subsection{The basic structure of your project}
+
+Here follows a set up on how to structure your report and analyze the data you have opted for.
+
+\paragraph{Part a).}
+The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
+\paragraph{Part b).}
+You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
+\paragraph{Part c).}
+Then describe your algorithm and its implementation and tests you have performed.
+
+\paragraph{Part d).}
+Then presents your results and findings, link with existing literature and more.
+
+\paragraph{Part e).}
+Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
+\subsection{Solving partial differential equations with neural networks}
+
+For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+For the explicit scheme, you can study for example chapter 10 of the lecture notes in \href{{https://github.com/CompPhysics/ComputationalPhysics/blob/master/doc/Lectures/lectures2015.pdf}}{Computational Physics} or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by \href{{https://compphysics.github.io/MachineLearning/doc/pub/odenn/html/odenn-bs.html}}{Kristine Baluka Hein} at this course are highly recommended.
+
+For the machine learning part you can use your own code from project 2 or the functionality of for example \textbf{Tensorflow/Keras}..
+
+\paragraph{Part a), setting up the problem.}
+The physical problem can be that of the temperature gradient in a rod of length $L=1$ at $x=0$ and $x=1$.
+We are looking at a one-dimensional
+problem
+
+\begin{equation*}
+ \frac{\partial^2 u(x,t)}{\partial x^2} =\frac{\partial u(x,t)}{\partial t}, t> 0, x\in [0,L]
+\end{equation*}
+or
+
+\begin{equation*}
+u_{xx} = u_t,
+\end{equation*}
+with initial conditions, i.e., the conditions at $t=0$,
+\begin{equation*}
+u(x,0)= \sin{(\pi x)} \hspace{0.5cm} 0 < x < L,
+\end{equation*}
+with $L=1$ the length of the $x$-region of interest. The
+boundary conditions are
+
+\begin{equation*}
+u(0,t)= 0 \hspace{0.5cm} t \ge 0,
+\end{equation*}
+and
+
+\begin{equation*}
+u(L,t)= 0 \hspace{0.5cm} t \ge 0.
+\end{equation*}
+The function $u(x,t)$ can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with $x$.
+
+We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
+\begin{equation*}
+u_t\approx \frac{u(x,t+\Delta t)-u(x,t)}{\Delta t}=\frac{u(x_i,t_j+\Delta t)-u(x_i,t_j)}{\Delta t}
+\end{equation*}
+and
+
+\begin{equation*}
+u_{xx}\approx \frac{u(x+\Delta x,t)-2u(x,t)+u(x-\Delta x,t)}{\Delta x^2},
+\end{equation*}
+or
+
+\begin{equation*}
+u_{xx}\approx \frac{u(x_i+\Delta x,t_j)-2u(x_i,t_j)+u(x_i-\Delta x,t_j)}{\Delta x^2}.
+\end{equation*}
+
+Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+\paragraph{Part b).}
+Implement the explicit scheme algorithm and perform tests of the solution
+for $\Delta x=1/10$, $\Delta x=1/100$ using $\Delta t$ as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that $\Delta t/\Delta x^2 \leq 1/2$.
+
+Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved
+and $u(x,t_2)$ is almost linear, close to the stationary state.
+
+\paragraph{Part c) Neural networks.}
+Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+\paragraph{Part d) Solving eigenvalue problems.}
+Follow the discussion in the work of Yi \emph{et al.} in the article from
+\href{{https://www.sciencedirect.com/science/article/pii/S0898122104901101}}{Computers and Mathematics with Applications 47, 1155 (2004)}, and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric $6\times 6$ matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+\paragraph{Part e).}
+Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
+\subsection{Additonal (optional) exercise, adding 30 more points to final score}
+
+This exercise can be done independently of the other tasks. Here you
+can also choose the data set you want to use. Furthermore, you can use
+your codes from projects 1 and 2 as well as the codes here or simply use
+libraries like \textbf{Scikit-Learn}, \textbf{Tensorflow} or similar.
+
+Your task is to perform an analysis of the bias-variance tradeoff
+using at least three of the main sets of algorithms we have discussed in this
+course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.
+
+You
+are free to choose between bootstrap for resampling (recommended) or
+cross-validation in order to get the best possible estimates. The
+methods you could study are Linear Regression (OLS, Ridge and Lasso),
+deep learning (feed forward neural networks and/or recurrent neural
+networks), Ensemble methods (decision trees, bagging, random forests
+and boosting) and support vector machines.
+
+Study the bias-variance tradeoff for at least three of these sets of
+algorithms for a data set of your choice as function of the complexity
+of your model. Comment and discuss the results. Discuss the pros and
+cons of the various methods. Are there some methods which provide both
+low variance and low bias?
+
+\textbf{Hint}: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree.
+
+\subsection{Introduction to numerical projects}
+
+Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+\begin{itemize}
+ \item Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
+ \item Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
+ \item Include the source code of your program. Comment your program properly.
+
+ \item If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
+ \item Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
+ \item Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
+ \item Try to give an interpretation of you results in your answers to the problems.
+
+ \item Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
+ \item Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+\end{itemize}
+
+\noindent
+\subsection{Format for electronic delivery of report and programs}
+
+The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
+
+\begin{itemize}
+ \item Use Canvas to hand in your projects, log in at \href{{https://www.uio.no/english/services/it/education/canvas/}}{\nolinkurl{https://www.uio.no/english/services/it/education/canvas/}} with your normal UiO username and password.
+
+ \item Upload \textbf{only} the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
+ \item In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+\end{itemize}
+
+\noindent
+Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+\subsection{Software and needed installations}
+
+If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via \textbf{pip} as
+\begin{enumerate}
+\item pip install numpy scipy matplotlib ipython scikit-learn tensorflow sympy pandas pillow
+\end{enumerate}
+
+\noindent
+For Python3, replace \textbf{pip} with \textbf{pip3}.
+
+See below for a discussion of \textbf{tensorflow} and \textbf{scikit-learn}.
+
+For OSX users we recommend also, after having installed Xcode, to install \textbf{brew}. Brew allows
+for a seamless installation of additional software via for example
+\begin{enumerate}
+\item brew install python3
+\end{enumerate}
+
+\noindent
+For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use \textbf{pip} as well and simply install Python as
+\begin{enumerate}
+\item sudo apt-get install python3 (or python for python2.7)
+\end{enumerate}
+
+\noindent
+etc etc.
+
+If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+\begin{enumerate}
+\item \href{{https://docs.anaconda.com/}}{Anaconda} Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system \textbf{conda}
+
+\item \href{{https://www.enthought.com/product/canopy/}}{Enthought canopy} is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+\end{enumerate}
+
+\noindent
+Popular software packages written in Python for ML are
+
+\begin{itemize}
+\item \href{{http://scikit-learn.org/stable/}}{Scikit-learn},
+
+\item \href{{https://www.tensorflow.org/}}{Tensorflow},
+
+\item \href{{http://pytorch.org/}}{PyTorch} and
+
+\item \href{{https://keras.io/}}{Keras}.
+\end{itemize}
+
+\noindent
+These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
+
+% ------------------- end of main content ---------------
+
+% #ifdef PREAMBLE
+\end{document}
+% #endif
+
diff --git a/doc/Projects/2021/Project3/pdf/Project3.pdf b/doc/Projects/2021/Project3/pdf/Project3.pdf
new file mode 100644
index 000000000..11b9f8821
Binary files /dev/null and b/doc/Projects/2021/Project3/pdf/Project3.pdf differ
diff --git a/doc/Projects/2021/Project3/pdf/Project3.tex b/doc/Projects/2021/Project3/pdf/Project3.tex
new file mode 100644
index 000000000..c436aa4e3
--- /dev/null
+++ b/doc/Projects/2021/Project3/pdf/Project3.tex
@@ -0,0 +1,409 @@
+%%
+%% Automatically generated file from DocOnce source
+%% (https://github.com/doconce/doconce/)
+%% doconce format latex Project3.do.txt --print_latex_style=trac --latex_admon=paragraph
+%%
+
+
+%-------------------- begin preamble ----------------------
+
+\documentclass[%
+oneside, % oneside: electronic viewing, twoside: printing
+final, % draft: marks overfull hboxes, figures with paths
+10pt]{article}
+
+\listfiles % print all files needed to compile this document
+
+\usepackage{relsize,makeidx,color,setspace,amsmath,amsfonts,amssymb}
+\usepackage[table]{xcolor}
+\usepackage{bm,ltablex,microtype}
+
+\usepackage[pdftex]{graphicx}
+
+\usepackage[T1]{fontenc}
+%\usepackage[latin1]{inputenc}
+\usepackage{ucs}
+\usepackage[utf8x]{inputenc}
+
+\usepackage{lmodern} % Latin Modern fonts derived from Computer Modern
+
+% Hyperlinks in PDF:
+\definecolor{linkcolor}{rgb}{0,0,0.4}
+\usepackage{hyperref}
+\hypersetup{
+ breaklinks=true,
+ colorlinks=true,
+ linkcolor=linkcolor,
+ urlcolor=linkcolor,
+ citecolor=black,
+ filecolor=black,
+ %filecolor=blue,
+ pdfmenubar=true,
+ pdftoolbar=true,
+ bookmarksdepth=3 % Uncomment (and tweak) for PDF bookmarks with more levels than the TOC
+ }
+%\hyperbaseurl{} % hyperlinks are relative to this root
+
+\setcounter{tocdepth}{2} % levels in table of contents
+
+% --- fancyhdr package for fancy headers ---
+\usepackage{fancyhdr}
+\fancyhf{} % sets both header and footer to nothing
+\renewcommand{\headrulewidth}{0pt}
+\fancyfoot[LE,RO]{\thepage}
+% Ensure copyright on titlepage (article style) and chapter pages (book style)
+\fancypagestyle{plain}{
+ \fancyhf{}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+% \renewcommand{\footrulewidth}{0mm}
+ \renewcommand{\headrulewidth}{0mm}
+}
+% Ensure copyright on titlepages with \thispagestyle{empty}
+\fancypagestyle{empty}{
+ \fancyhf{}
+ \fancyfoot[C]{{\footnotesize \copyright\ 1999-2021, "Data Analysis and Machine Learning FYS-STK3155/FYS4155":"http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html". Released under CC Attribution-NonCommercial 4.0 license}}
+ \renewcommand{\footrulewidth}{0mm}
+ \renewcommand{\headrulewidth}{0mm}
+}
+
+\pagestyle{fancy}
+
+
+% prevent orhpans and widows
+\clubpenalty = 10000
+\widowpenalty = 10000
+
+% --- end of standard preamble for documents ---
+
+
+% insert custom LaTeX commands...
+
+\raggedbottom
+\makeindex
+\usepackage[totoc]{idxlayout} % for index in the toc
+\usepackage[nottoc]{tocbibind} % for references/bibliography in the toc
+
+%-------------------- end preamble ----------------------
+
+\begin{document}
+
+% matching end for #ifdef PREAMBLE
+
+\newcommand{\exercisesection}[1]{\subsection*{#1}}
+
+
+% ------------------- main content ----------------------
+
+
+
+% ----------------- title -------------------------
+
+\thispagestyle{empty}
+
+\begin{center}
+{\LARGE\bf
+\begin{spacing}{1.25}
+Project 3 on Machine Learning, deadline December 17, 2021
+\end{spacing}
+}
+\end{center}
+
+% ----------------- author(s) -------------------------
+
+\begin{center}
+{\bf \href{{http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html}}{Data Analysis and Machine Learning FYS-STK3155/FYS4155}}
+\end{center}
+
+ \begin{center}
+% List of all institutions:
+\centerline{{\small Department of Physics, University of Oslo, Norway}}
+\end{center}
+
+% ----------------- end author(s) -------------------------
+
+% --- begin date ---
+\begin{center}
+Nov 14, 2021
+\end{center}
+% --- end date ---
+
+\vspace{1cm}
+
+
+\section*{Paths for project 3}
+
+\subsection*{Defining the data sets to analyze yourself}
+
+For project 3, you can propose own data sets that relate to your research interests or just use existing data sets from say
+\begin{enumerate}
+\item \href{{https://www.kaggle.com/datasets}}{Kaggle}
+
+\item The \href{{https://archive.ics.uci.edu/ml/index.php}}{University of California at Irvine (UCI) with its machine learning repository}.
+
+\item Or other sources.
+\end{enumerate}
+
+\noindent
+The approach to the analysis of these new data sets should follow to a large extent what you did in projects 1 and 2. That is:
+\begin{enumerate}
+\item Whether you end up with a regression or a classification problem, you should employ at least two of the methods we have discussed among \textbf{linear regression (including Ridge and Lasso)}, \textbf{Logistic Regression}, \textbf{Neural Networks}, \textbf{Convolution Neural Networks}, \textbf{Recurrent Neural Networks}, \textbf{Adversarial Neural Networks}, \textbf{Support Vector Machines} and \textbf{Decision Trees, Random Forests, Bagging and Boosting}. You could for example explore all of the approaches from decision trees, via bagging and voting classifiers, to random forests, boosting and finally XGboost. If you wish to venture into \textbf{convolutional neural networks} or \textbf{recurrent neural networks}, or extensions of neural networkds, feel free to do so. You can also study unsupervised methods, although we in this course have mainly paid attendtion to supervised learning. The methods we have explored as \textbf{Principal Component Analysis} and \textbf{k-means Clustering}.
+\end{enumerate}
+
+\noindent
+For Boosting, feel also free to write your own codes.
+
+\begin{enumerate}
+\item For project 3, you should feel free to use your own codes from projects 1 and 2, eventually write your own for SVMs and/or Decision trees/random forests/bagging/boosting' or use the available functionality of \textbf{Scikit-Learn}, \textbf{Tensorflow}, etc.
+
+\item The estimates you used and tested in projects 1 and 2 should also be included, that is the $R2$-score, \textbf{MSE}, confusion matrix, accuracy score, information gain, ROC and Cumulative gains curves and other, cross-validation and/or bootstrap if these are relevant.
+
+\item Similarly, feel free to explore various activations functions in deep learning and various approachs to stochastic gradient descent approaches.
+
+\item If possible, you should link the data sets with exisiting research and analyses thereof. Scientific articles which have used Machine Learning algorithms to analyze the data are highly welcome. Perhaps you can improve previous analyses and even publish a new article?
+
+\item A critical assessment of the methods with ditto perspectives and recommendations is also something you need to include.
+\end{enumerate}
+
+\noindent
+All in all, the report should follow the same pattern as the two previous ones, with abstract, introduction, methods, code, results, conclusions etc..
+
+We propose also an alternative to the above. This is a project on using machine learning methods (neural networks mainly) to the solution of ordinary differential equations and partial differential equations, with a final twist on how to diagonalize a symmetric matrix with neural networks.
+
+This is a field with a large interest recently, spanning from studies of turbulence in fluid mechanics and meteorology to the solution of quantum mechanical systems. As reading background you can use the slides \href{{https://compphysics.github.io/MachineLearning/doc/pub/week42/html/week42.html}}{from week 43} and/or the textbook by \href{{https://www.springer.com/gp/book/9789401798150}}{Yadav et al}.
+
+\textbf{Note}: Project 3 has an additional exercise which can give you an additional score of 30 (thirty) points. These are added to the total score from all projects. See below for the additional exercise.
+
+\subsection*{The basic structure of your project}
+
+Here follows a set up on how to structure your report and analyze the data you have opted for.
+
+\paragraph{Part a).}
+The first part deals with structuring and reading the data, much along the same lines as done in projects 1 and 2. Explain how the data are produced and place them in a proper context.
+
+\paragraph{Part b).}
+You need to include at least two central algorithms, or as an alternative explore methods from decisions tree to bagging, random forests and boosting. Explain the basics of the methods you have chosen to work with. This would be your theory part.
+
+\paragraph{Part c).}
+Then describe your algorithm and its implementation and tests you have performed.
+
+\paragraph{Part d).}
+Then presents your results and findings, link with existing literature and more.
+
+\paragraph{Part e).}
+Finally, here you should present a critical assessment of the methods you have studied and link your results with the existing literature.
+
+\subsection*{Solving partial differential equations with neural networks}
+
+For this variant of project 3, we will assume that you have some
+background in the solution of partial differential equations using
+finite difference schemes. We will study the solution of the diffusion
+equation in one dimension using a standard explicit scheme and neural
+networks to solve the same equations.
+
+For the explicit scheme, you can study for example chapter 10 of the lecture notes in \href{{https://github.com/CompPhysics/ComputationalPhysics/blob/master/doc/Lectures/lectures2015.pdf}}{Computational Physics} or alternative sources. For the solution of ordinary and partial differential equations using neural networks, the lectures by \href{{https://compphysics.github.io/MachineLearning/doc/pub/odenn/html/odenn-bs.html}}{Kristine Baluka Hein} at this course are highly recommended.
+
+For the machine learning part you can use your own code from project 2 or the functionality of for example \textbf{Tensorflow/Keras}..
+
+\paragraph{Part a), setting up the problem.}
+The physical problem can be that of the temperature gradient in a rod of length $L=1$ at $x=0$ and $x=1$.
+We are looking at a one-dimensional
+problem
+
+\begin{equation*}
+ \frac{\partial^2 u(x,t)}{\partial x^2} =\frac{\partial u(x,t)}{\partial t}, t> 0, x\in [0,L]
+\end{equation*}
+or
+
+\begin{equation*}
+u_{xx} = u_t,
+\end{equation*}
+with initial conditions, i.e., the conditions at $t=0$,
+\begin{equation*}
+u(x,0)= \sin{(\pi x)} \hspace{0.5cm} 0 < x < L,
+\end{equation*}
+with $L=1$ the length of the $x$-region of interest. The
+boundary conditions are
+
+\begin{equation*}
+u(0,t)= 0 \hspace{0.5cm} t \ge 0,
+\end{equation*}
+and
+
+\begin{equation*}
+u(L,t)= 0 \hspace{0.5cm} t \ge 0.
+\end{equation*}
+The function $u(x,t)$ can be the temperature gradient of a rod.
+As time increases, the velocity approaches a linear variation with $x$.
+
+We will limit ourselves to the so-called explicit forward Euler algorithm with discretized versions of time given by a forward formula and a centered difference in space resulting in
+\begin{equation*}
+u_t\approx \frac{u(x,t+\Delta t)-u(x,t)}{\Delta t}=\frac{u(x_i,t_j+\Delta t)-u(x_i,t_j)}{\Delta t}
+\end{equation*}
+and
+
+\begin{equation*}
+u_{xx}\approx \frac{u(x+\Delta x,t)-2u(x,t)+u(x-\Delta x,t)}{\Delta x^2},
+\end{equation*}
+or
+
+\begin{equation*}
+u_{xx}\approx \frac{u(x_i+\Delta x,t_j)-2u(x_i,t_j)+u(x_i-\Delta x,t_j)}{\Delta x^2}.
+\end{equation*}
+
+Write down the algorithm and the equations you need to implement.
+Find also the analytical solution to the problem.
+
+\paragraph{Part b).}
+Implement the explicit scheme algorithm and perform tests of the solution
+for $\Delta x=1/10$, $\Delta x=1/100$ using $\Delta t$ as dictated by the stability limit of the explicit scheme. The stability criterion for the explicit scheme requires that $\Delta t/\Delta x^2 \leq 1/2$.
+
+Study the solutions at two time points $t_1$ and $t_2$ where $u(x,t_1)$ is smooth but still significantly curved
+and $u(x,t_2)$ is almost linear, close to the stationary state.
+
+\paragraph{Part c) Neural networks.}
+Study now the lecture notes on solving ODEs and PDEs with neural
+network and use either your own code from project 2 or the
+functionality of tensorflow/keras to solve the same equation as in
+part b). Discuss your results and compare them with the standard
+explicit scheme. Include also the analytical solution and compare with
+that.
+
+\paragraph{Part d) Solving eigenvalue problems.}
+Follow the discussion in the work of Yi \emph{et al.} in the article from
+\href{{https://www.sciencedirect.com/science/article/pii/S0898122104901101}}{Computers and Mathematics with Applications 47, 1155 (2004)}, and
+use your differential equation solver with neural networks, set up a
+simple square, real and symmetric $6\times 6$ matrix and find the
+eigenvalues. Compare with the solution from numerical diagonalization with standard eigenvalue solvers from linear algebra.
+
+\paragraph{Part e).}
+Finally, present a critical assessment of the methods you have studied and discuss the potential for the solving differential equations and eigenvalue problems with machine learning methods.
+
+\subsection*{Additonal (optional) exercise, adding 30 more points to final score}
+
+This exercise can be done independently of the other tasks. Here you
+can also choose the data set you want to use. Furthermore, you can use
+your codes from projects 1 and 2 as well as the codes here or simply use
+libraries like \textbf{Scikit-Learn}, \textbf{Tensorflow} or similar.
+
+Your task is to perform an analysis of the bias-variance tradeoff
+using at least three of the main sets of algorithms we have discussed in this
+course. We will limit ourselves to a regression problem (fitting). However, feel free to venture into a classification problem.
+
+You
+are free to choose between bootstrap for resampling (recommended) or
+cross-validation in order to get the best possible estimates. The
+methods you could study are Linear Regression (OLS, Ridge and Lasso),
+deep learning (feed forward neural networks and/or recurrent neural
+networks), Ensemble methods (decision trees, bagging, random forests
+and boosting) and support vector machines.
+
+Study the bias-variance tradeoff for at least three of these sets of
+algorithms for a data set of your choice as function of the complexity
+of your model. Comment and discuss the results. Discuss the pros and
+cons of the various methods. Are there some methods which provide both
+low variance and low bias?
+
+\textbf{Hint}: when you use different methods, pay attention to how you represent (and understand) the complexity of the model. For example, when using decision trees you may represent the complexity of your model by the depth of the tree.
+
+\subsection*{Introduction to numerical projects}
+
+Here follows a brief recipe and recommendation on how to write a report for each
+project.
+
+\begin{itemize}
+ \item Give a short description of the nature of the problem and the eventual numerical methods you have used.
+
+ \item Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.
+
+ \item Include the source code of your program. Comment your program properly.
+
+ \item If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.
+
+ \item Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.
+
+ \item Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.
+
+ \item Try to give an interpretation of you results in your answers to the problems.
+
+ \item Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.
+
+ \item Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.
+\end{itemize}
+
+\noindent
+\subsection*{Format for electronic delivery of report and programs}
+
+The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
+
+\begin{itemize}
+ \item Use Canvas to hand in your projects, log in at \href{{https://www.uio.no/english/services/it/education/canvas/}}{\nolinkurl{https://www.uio.no/english/services/it/education/canvas/}} with your normal UiO username and password.
+
+ \item Upload \textbf{only} the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.
+
+ \item In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.
+\end{itemize}
+
+\noindent
+Finally,
+we encourage you to collaborate. Optimal working groups consist of
+2-3 students. You can then hand in a common report.
+
+\subsection*{Software and needed installations}
+
+If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,
+we recommend that you install the following Python packages via \textbf{pip} as
+\begin{enumerate}
+\item pip install numpy scipy matplotlib ipython scikit-learn tensorflow sympy pandas pillow
+\end{enumerate}
+
+\noindent
+For Python3, replace \textbf{pip} with \textbf{pip3}.
+
+See below for a discussion of \textbf{tensorflow} and \textbf{scikit-learn}.
+
+For OSX users we recommend also, after having installed Xcode, to install \textbf{brew}. Brew allows
+for a seamless installation of additional software via for example
+\begin{enumerate}
+\item brew install python3
+\end{enumerate}
+
+\noindent
+For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution
+you can use \textbf{pip} as well and simply install Python as
+\begin{enumerate}
+\item sudo apt-get install python3 (or python for python2.7)
+\end{enumerate}
+
+\noindent
+etc etc.
+
+If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
+\begin{enumerate}
+\item \href{{https://docs.anaconda.com/}}{Anaconda} Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system \textbf{conda}
+
+\item \href{{https://www.enthought.com/product/canopy/}}{Enthought canopy} is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.
+\end{enumerate}
+
+\noindent
+Popular software packages written in Python for ML are
+
+\begin{itemize}
+\item \href{{http://scikit-learn.org/stable/}}{Scikit-learn},
+
+\item \href{{https://www.tensorflow.org/}}{Tensorflow},
+
+\item \href{{http://pytorch.org/}}{PyTorch} and
+
+\item \href{{https://keras.io/}}{Keras}.
+\end{itemize}
+
+\noindent
+These are all freely available at their respective GitHub sites. They
+encompass communities of developers in the thousands or more. And the number
+of code developers and contributors keeps increasing.
+
+
+% ------------------- end of main content ---------------
+
+\end{document}
+
diff --git a/doc/pub/week34/html/._week34-bs000.html b/doc/pub/week34/html/._week34-bs000.html
index 743aee240..6c35019c1 100644
--- a/doc/pub/week34/html/._week34-bs000.html
+++ b/doc/pub/week34/html/._week34-bs000.html
@@ -1,6 +1,7 @@
@@ -8,24 +9,20 @@ Automatically generated HTML file from DocOnce source
-
Week 34: Introduction to the course, Logistics and Practicalities
-
+
-
-
-