Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bayesian Convolutional Neural Network | Chan`s Jupyter #80

Open
utterances-bot opened this issue May 10, 2022 · 13 comments
Open

Bayesian Convolutional Neural Network | Chan`s Jupyter #80

utterances-bot opened this issue May 10, 2022 · 13 comments

Comments

@utterances-bot
Copy link

Bayesian Convolutional Neural Network | Chan`s Jupyter

In this post, we will create a Bayesian convolutional neural network to classify the famous MNIST handwritten digits. This will be a probabilistic model, designed to capture both aleatoric and epistemic uncertainty. You will test the uncertainty quantifications against a corrupted version of the dataset. This is the assignment of lecture “Probabilistic Deep Learning with Tensorflow 2” from Imperial College London.

https://goodboychan.github.io/python/coursera/tensorflow_probability/icl/2021/08/26/01-Bayesian-Convolutional-Neural-Network.html

Copy link

I got following error

Load and inspect the MNIST dataset

(x_train, y_train, y_train_oh), (x_test, y_test, y_test_oh) = load_data('MNIST')
inspect_images(data=x_train, num_images=8)

error and how recover it
FileNotFoundError Traceback (most recent call last)
in ()
1 # Load and inspect the MNIST dataset
2
----> 3 (x_train, y_train, y_train_oh), (x_test, y_test, y_test_oh) = load_data('MNIST')
4 inspect_images(data=x_train, num_images=8)

1 frames
/usr/local/lib/python3.7/dist-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
415 own_fid = False
416 else:
--> 417 fid = stack.enter_context(open(os_fspath(file), "rb"))
418 own_fid = True
419

FileNotFoundError: [Errno 2] No such file or directory: 'dataset/MNIST/x_train.npy'

@Yasanthi1974
Copy link

Yasanthi1974 commented May 10, 2022 via email

Copy link
Owner

Hi,
I check out the file that occurs the error, but it exists. Maybe you run this notebook on colab or specific environment(different folder tree) Check out your exact path for numpy dataset (x_train.npy)

@Yasanthi1974
Copy link

Yasanthi1974 commented May 10, 2022 via email

@goodboychan
Copy link
Owner

did you check this file?
these are same as mine.

@Yasanthi1974
Copy link

Yasanthi1974 commented May 11, 2022 via email

@Yasanthi1974
Copy link

Yasanthi1974 commented May 12, 2022 via email

Copy link
Owner

goodboychan commented May 12, 2022

I just borrow dataset from original course. But you can use np.save()[https://numpy.org/doc/stable/reference/generated/numpy.save.html] to generate .npy file.

@Yasanthi1974
Copy link

Yasanthi1974 commented May 23, 2022 via email

@goodboychan
Copy link
Owner

I cannot help you unless enough dataset information is offered. Sorry.

Copy link

hello,I want to ask you that the difference between DenseVariational and DenseReparameterization

Copy link
Owner

I think that the difference between them is to define the kernel and bias. They both output variational inference as the dense layer does, but DenseVariational try to fit a "surrogate" posterior to the distribution, and DenseReparametrization assumes the kernel and/or the bias are drawn from distributions with reparametrization estimator. there is more detailed mention about the difference here Check this out.

@Yasanthi1974
Copy link

Yasanthi1974 commented Jul 29, 2022 via email

@goodboychan goodboychan reopened this Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants