Skip to content

Python projects for the course 'Probabilistic Artificial Intelligence' (Prof. Krause) @eth Zurich

Notifications You must be signed in to change notification settings

ischollETH/probabilistic-artificial-intelligence-ETH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

probabilistic-artificial-intelligence-ETH

Python projects for the course 'Probabilistic Artificial Intelligence' (Prof. Krause) 2021 @ ETH Zurich. All of the projects have outperformed the requested score baseline by far and therefore passed all the tests, resulting in an overall project grade of 6/6.

Credit for the project setup and skeleton codes goes to Prof. Krause and his teaching assistants (course website).

Task 0: Bayesian Inference

Simple introductory exercise computing posterior probabilities based on different scaling hypothesis spaces.

Task 1: Gaussian Process Regression

Task implementing a gaussian process regression in order to infer air pollution in different places based on spatial data. The KFold method by sklearn has been used in order to cope with the very large amount of data. This allowed to approximate an otherwise hard to compute model posterior. The following visualizes some predictions of the fitted model:

Task 2: Bayesian Neural Nets

Task implementing a Bayesian Neural Network, employing Univariate and Multivariate Gaussians and using negative log-likelihood as well as the Kullback-Leibler divergence for loss calculations. The usecase was training and testing on the rotated MNIST dataset as well as the fashion MNIST dataset. Such a network not only achieves good prediction accuracies, but at the same time will also compute a certainty for its predictions, which can be very useful for many usecases in order to know how much the prediction results can be relied upon. First, some excerpts of the performance on the rotated MNIST dataset can be observed, where either the network was not confident in its prediction (and therefore sometimes wrong, too) or very confident (and correct); respectively some ambiguous data samples where the ground truth is not known for sure:

Further, some similar excerpts of the results on the fashion MNIST dataset can also be observed:

Task 3: Bayesian Optimization

Task implementing a Bayesian Optimization (minimization) algorithm using Gaussian Processes for the constraint and objective function. All three common acquisition functions following the paper by Snoek et al. (2012) were tested: Probability of Improvement (PI), Expected Improvement (EI) and Lower Confidence Bound (LCB). This allows to tune hyperparameters all the while constraints are active. The best results were observed when using EI, and in the following visualizations of the posteriors of both the constraint as well as objective function are shown:

Task 4: Reinforcement Learning (RL)

Task implementing a Reinforcement Learning (RL) algorithm that, by practicing on a simulator, learns a control policy for a lunar lander. The approaches used and studied were (1) using only policy gradients, (2) using rewards-to-go on top and (3) generalized advantage estimation as a baseline. The latter two are used to reduce the variance of the policy gradients by ignoring noisy or pooling noisy rewards from the past which were not a consequence of the action under consideration. The following shows some resulting runs of the simulation after training, where the lunar lander is supposed to land between the yellow flags without crashing:

About

Python projects for the course 'Probabilistic Artificial Intelligence' (Prof. Krause) @eth Zurich

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages