-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fully connected layer structure and neural network abc
- Loading branch information
1 parent
ada03f7
commit 88e8bf4
Showing
2 changed files
with
106 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
quantum_image_processing/models/neural_networks/neural_network.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Neural Network Abstract Base Class""" | ||
|
||
from __future__ import annotations | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class NeuralNetwork(ABC): | ||
""" | ||
Abstract base class for all neural network structures. | ||
These structures consist of data encoding/embedding, | ||
forward pass (consisting of layers such as convolutional, | ||
pooling, etc.), backward pass (for training purposes), | ||
and finally a measurement stage. | ||
""" | ||
|
||
@abstractmethod | ||
def forward_pass(self): | ||
""" | ||
Implements a forward pass in a neural network. | ||
""" | ||
return NotImplementedError | ||
|
||
@abstractmethod | ||
def backward_pass(self): | ||
""" | ||
Implements a backward pass in a neural network. | ||
""" | ||
return NotImplementedError |