Skip to content

Commit

Permalink
Mpd_classification_reporterge branch '20201008_landmarkv2' of github.…
Browse files Browse the repository at this point in the history
…com:3springs/deep_ml_curriculum into 20201008_landmarkv2
  • Loading branch information
wassname committed Oct 13, 2020
2 parents 7435a24 + 5a95008 commit 27fb846
Show file tree
Hide file tree
Showing 6 changed files with 1,707 additions and 463 deletions.
657 changes: 463 additions & 194 deletions notebooks/c02_Intro_to_NN_Part_2/Intro_to_NN_Part_2.ipynb

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions notebooks/c02_Intro_to_NN_Part_2/Intro_to_NN_Part_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@
# Credits to researchers at Georgia Tech, Agile Geoscience
# License CCbySA
#
# In this notebook, we will be using the landmass dataset, which have been preprocessed already. In this dataset, we have images of 4 different types of landmass: 'Chaotic Horizon', 'Fault', 'Horizon', 'Salt Dome'.
# In this notebook, we will be using the landmass dataset, which have been preprocessed already. In this dataset, we have images of 4 different types of landmass: ['Discontinuous', 'Faulted', 'Continuous', 'Salt'].
#
# This is an example of [seismic data](https://en.wikipedia.org/wiki/Reflection_seismology) which is a way of using seismic to image the structure of the Earth, below the surface. These waves are similar to sounds waves in air. The lines represent changes in density below the surface.
#
# We will train a CNN to learn how to classify images into those 4 groups.

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device

# +
# Let's import the Patches
Expand Down Expand Up @@ -157,6 +158,10 @@
print("Class:", landmassf3_train.classes[y])
x

# Note that this is an unbalanced dataset, so we expect an accuracy of at least 52%, this is out baseline
labels = pd.Series(landmassf3_train.train_labels).replace(dict(enumerate(landmassf3_train.classes)))
labels.value_counts() / len(landmassf3_train)

landmassf3_train.classes

# Source: [Neural Networks](https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html#sphx-glr-beginner-blitz-neural-networks-tutorial-py)
Expand Down Expand Up @@ -400,8 +405,8 @@ def forward(self, x):

convnet = BetterCNN().to(device)
optimizer = torch.optim.Adam(convnet.parameters(), lr=learning_rate)
model = train(convnet, x_train, y_train, criterion, optimizer)
test(model, x_test, y_test)
convnet = train(convnet, x_train, y_train, criterion, optimizer)
test(convnet, x_test, y_test)

from deep_ml_curriculum.torchsummaryX import summary
# We can also summarise the number of parameters in each layer
Expand Down
766 changes: 579 additions & 187 deletions notebooks/c03_Finetuning/Finetuning.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 27fb846

Please sign in to comment.