Skip to content
Snippets Groups Projects
Commit fd22e0ca authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Fixed bug in ouput evaluation for ANN model.

parent bc1150e6
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ TODO: Adjust TCs for wavelet detectors (sliding window over all cells instead of ...@@ -6,6 +6,7 @@ TODO: Adjust TCs for wavelet detectors (sliding window over all cells instead of
TODO: Adjust Boxplot approach (adjacent cells, outer fence, etc.) TODO: Adjust Boxplot approach (adjacent cells, outer fence, etc.)
TODO: Give detailed description of wavelet detection TODO: Give detailed description of wavelet detection
TODO: Load ANN state and config in reset -> Done TODO: Load ANN state and config in reset -> Done
TODO: Fix bug in output calculation -> Done
""" """
import numpy as np import numpy as np
...@@ -303,9 +304,9 @@ class ArtificialNeuralNetwork(TroubledCellDetector): ...@@ -303,9 +304,9 @@ class ArtificialNeuralNetwork(TroubledCellDetector):
for cell in range(num_ghost_cells, len(projection[0])-num_ghost_cells)])) for cell in range(num_ghost_cells, len(projection[0])-num_ghost_cells)]))
# Determine troubled cells # Determine troubled cells
model_output = torch.round(self._model(input_data.float())) model_output = torch.argmax(self._model(input_data.float()), dim=1)
return [cell for cell in range(len(model_output)) return [cell for cell in range(len(model_output))
if model_output[cell, 0] == torch.tensor([1])] if model_output[cell] == torch.tensor([0])]
class WaveletDetector(TroubledCellDetector): class WaveletDetector(TroubledCellDetector):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment