Update README.md

This commit is contained in:
David Rotermund 2022-05-01 01:34:45 +02:00 committed by GitHub
parent 3e5ab1ccff
commit 0980a4ced7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

108
README.md
View file

@ -31,83 +31,137 @@ The SbS.py autodetectes if the required C++ .so modules are in the same director
## Variables ## Variables
```
epsilon_xy epsilon_xy
```
```
epsilon_0 epsilon_0
```
```
epsilon_t epsilon_t
```
```
weights weights
```
```
kernel_size kernel_size
```
```
stride stride
```
```
dilation dilation
```
```
padding padding
```
```
output_size output_size
```
```
number_of_spikes number_of_spikes
```
```
number_of_cpu_processes number_of_cpu_processes
```
```
number_of_neurons number_of_neurons
```
```
number_of_input_neurons number_of_input_neurons
```
```
h_initial h_initial
```
```
alpha_number_of_iterations alpha_number_of_iterations
```
## Constructor ## Constructor
```
def **__init__**( def **__init__**(
self, self,
number_of_input_neurons: int, number_of_input_neurons: int,
number_of_neurons: int, number_of_neurons: int,
input_size: list[int], input_size: list[int],
forward_kernel_size: list[int], forward_kernel_size: list[int],
number_of_spikes: int, number_of_spikes: int,
epsilon_t: torch.Tensor, epsilon_t: torch.Tensor,
epsilon_xy_intitial: float = 0.1, epsilon_xy_intitial: float = 0.1,
epsilon_0: float = 1.0, epsilon_0: float = 1.0,
weight_noise_amplitude: float = 0.01, weight_noise_amplitude: float = 0.01,
is_pooling_layer: bool = False, is_pooling_layer: bool = False,
strides: list[int] = [1, 1], strides: list[int] = [1, 1],
dilation: list[int] = [0, 0], dilation: list[int] = [0, 0],
padding: list[int] = [0, 0], padding: list[int] = [0, 0],
alpha_number_of_iterations: int = 0, alpha_number_of_iterations: int = 0,
number_of_cpu_processes: int = 1, number_of_cpu_processes: int = 1,
) -> None: ) -> None:
```
## Methods ## Methods
```
def **initialize_weights**( def **initialize_weights**(
self, self,
is_pooling_layer: bool = False, is_pooling_layer: bool = False,
noise_amplitude: float = 0.01, noise_amplitude: float = 0.01,
) -> None: ) -> None:
```
For the generation of the initital weights. Switches between normal initial random weights and pooling weights. For the generation of the initital weights. Switches between normal initial random weights and pooling weights.
--- ---
```
def **initialize_epsilon_xy**( def **initialize_epsilon_xy**(
self, self,
eps_xy_intitial: float, eps_xy_intitial: float,
) -> None: ) -> None:
```
Creates initial epsilon xy matrices. Creates initial epsilon xy matrices.
--- ---
```
def **set_h_init_to_uniform**(self) -> None: def **set_h_init_to_uniform**(self) -> None:
```
--- ---
```
def **backup_epsilon_xy**(self) -> None: def **backup_epsilon_xy**(self) -> None:
def **restore_epsilon_xy**(self) -> None: def **restore_epsilon_xy**(self) -> None:
def **backup_weights(self)** -> None: def **backup_weights(self)** -> None:
def **restore_weights(self)** -> None: def **restore_weights(self)** -> None:
```
--- ---
```
def **threshold_epsilon_xy**(self, threshold: float) -> None: def **threshold_epsilon_xy**(self, threshold: float) -> None:
def **threshold_weights**(self, threshold: float) -> None: def **threshold_weights**(self, threshold: float) -> None:
```
--- ---
```
def **mean_epsilon_xy**(self) -> None: def **mean_epsilon_xy**(self) -> None:
```
--- ---
```
def **norm_weights**(self) -> None: def **norm_weights**(self) -> None:
```
# Parameters in JSON file # Parameters in JSON file