Skip to content

Commit 30a6224

Browse files
Major update: ready for optimization tests
1 parent 9fc6742 commit 30a6224

21 files changed

Lines changed: 77 additions & 67 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ cd DeepLearningWithProtoDUNE
1111

1212
### Download the dataset
1313
```
14-
# 320x320 inputs
15-
wget -O input_files.zip https://www.dropbox.com/sh/3529klxprjgswlv/AAAuD-HN3oOzpY1-rlkaokt8a?dl=1
14+
# 320x320 inputs; min 2000 beam hits
15+
wget -O input_files.zip https://www.dropbox.com/sh/a00fbuye3i1c0sj/AACeI2l-iEpIoeDbDBtogjJKa?dl=1
1616
unzip input_files.zip -d input_files
1717
rm -rf input_files.zip
1818
```

analyze_model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from keras import backend as K
77
from keras.models import load_model
88
from tools.plotting_tools import plot_feature_label_prediction
9+
from tools.loss_metrics_tools import intersection_over_union, mean_iou, focal_loss
910
from tools.data_tools import DataSequence, get_data_generator, preprocess_feature, preprocess_label
10-
from tools.loss_metrics_tools import intersection_over_union, mean_iou, weighted_categorical_crossentropy, focal_loss
1111

1212
def argument_parser():
1313
ap = argparse.ArgumentParser()
@@ -79,8 +79,7 @@ def main():
7979

8080
# Get the model
8181
model_path = os.path.join("saved_models", "model_and_weights.hdf5")
82-
model = load_model(model_path, custom_objects={"loss": weighted_categorical_crossentropy(WEIGHTS),
83-
"loss": focal_loss(),
82+
model = load_model(model_path, custom_objects={"loss": focal_loss(),
8483
"mean_iou": mean_iou})
8584

8685
# Make comparision plots

calculate_weights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main():
3939
for index, weight in class_weights.items():
4040
weights[index].append(weight)
4141

42-
ranges = [(0.5,1.5), (100, 225), (5, 35)]
42+
ranges = [(0.5,1.5), (100, 500), (5, 35)]
4343
plot_path = os.path.join("plots", "extra", "weights_median.pdf")
4444
plot_weights_median(weights, ranges, CLASS_NAMES, plot_path)
4545
print("\nDone! Plot with median weights for each class is saved at {}!\n".format(plot_path))

configurations/fnal_tev_configuration.ini

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ IMAGE_DEPTH = 1
55

66
CLASS_NAMES = Background Beam Not-Beam
77

8-
FEATURE_FILE_TRAINING = /data/arbint/input_files/training
9-
LABEL_FILE_TRAINING = /data/arbint/input_files/training
8+
FEATURE_FILE_TRAINING = /data/arbint/input_files/training/feature.csv
9+
LABEL_FILE_TRAINING = /data/arbint/input_files/training/label.csv
1010

11-
FEATURE_FILE_VALIDATION = /data/arbint/input_files/validation
12-
LABEL_FILE_VALIDATION = /data/arbint/input_files/validation
11+
FEATURE_FILE_VALIDATION = /data/arbint/input_files/validation/feature.csv
12+
LABEL_FILE_VALIDATION = /data/arbint/input_files/validation/label.csv
1313

14-
FEATURE_FILE_TESTING = /data/arbint/input_files/testing
15-
LABEL_FILE_TESTING = /data/arbint/input_files/testing
14+
FEATURE_FILE_TESTING = /data/arbint/input_files/testing/feature.csv
15+
LABEL_FILE_TESTING = /data/arbint/input_files/testing/label.csv
1616

1717
WEIGHTS = 1.0 1.0 1.0
1818
BATCH_SIZE = 2
1919

2020
[TRAINING]
21-
NUM_TRAINING = 1835
22-
NUM_VALIDATION = 171
23-
NUM_TESTING = 38
24-
NUM_EPOCHS = 50
21+
NUM_TRAINING = 2637
22+
NUM_VALIDATION = 246
23+
NUM_TESTING = 62
24+
NUM_EPOCHS = 150
2525

2626
[DEVELOPMENT]
2727
NUM_TRAINING = 40

configurations/hpc1_configuration.ini

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ IMAGE_DEPTH = 1
55

66
CLASS_NAMES = Background Beam Not-Beam
77

8-
FEATURE_FILE_TRAINING = /scratch/arbint/input_files/training
9-
LABEL_FILE_TRAINING = /scratch/arbint/input_files/training
8+
FEATURE_FILE_TRAINING = /scratch/arbint/input_files/training/feature.csv
9+
LABEL_FILE_TRAINING = /scratch/arbint/input_files/training/label.csv
1010

11-
FEATURE_FILE_VALIDATION = /scratch/arbint/input_files/validation
12-
LABEL_FILE_VALIDATION = /scratch/arbint/input_files/validation
11+
FEATURE_FILE_VALIDATION = /scratch/arbint/input_files/validation/feature.csv
12+
LABEL_FILE_VALIDATION = /scratch/arbint/input_files/validation/label.csv
1313

14-
FEATURE_FILE_TESTING = /scratch/arbint/input_files/testing
15-
LABEL_FILE_TESTING = /scratch/arbint/input_files/testing
14+
FEATURE_FILE_TESTING = /scratch/arbint/input_files/testing/feature.csv
15+
LABEL_FILE_TESTING = /scratch/arbint/input_files/testing/label.csv
1616

1717
WEIGHTS = 1.0 1.0 1.0
1818
BATCH_SIZE = 1
1919

2020
[TRAINING]
21-
NUM_TRAINING = 1835
22-
NUM_VALIDATION = 171
23-
NUM_TESTING = 38
21+
NUM_TRAINING = 2637
22+
NUM_VALIDATION = 246
23+
NUM_TESTING = 62
2424
NUM_EPOCHS = 150
2525

2626
[DEVELOPMENT]

configurations/local_configuration.ini

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ IMAGE_DEPTH = 1
55

66
CLASS_NAMES = Background Beam Not-Beam
77

8-
FEATURE_FILE_TRAINING = input_files/training
9-
LABEL_FILE_TRAINING = input_files/training
8+
FEATURE_FILE_TRAINING = input_files/training/feature.csv
9+
LABEL_FILE_TRAINING = input_files/training/label.csv
1010

11-
FEATURE_FILE_VALIDATION = input_files/validation
12-
LABEL_FILE_VALIDATION = input_files/validation
11+
FEATURE_FILE_VALIDATION = input_files/validation/feature.csv
12+
LABEL_FILE_VALIDATION = input_files/validation/label.csv
1313

14-
FEATURE_FILE_TESTING = input_files/testing
15-
LABEL_FILE_TESTING = input_files/testing
14+
FEATURE_FILE_TESTING = input_files/testing/feature.csv
15+
LABEL_FILE_TESTING = input_files/testing/label.csv
1616

1717
WEIGHTS = 1.0 1.0 1.0
1818
BATCH_SIZE = 1
1919

2020
[TRAINING]
21-
NUM_TRAINING = 1835
22-
NUM_VALIDATION = 171
23-
NUM_TESTING = 38
21+
NUM_TRAINING = 2637
22+
NUM_VALIDATION = 246
23+
NUM_TESTING = 62
2424
NUM_EPOCHS = 150
2525

2626
[DEVELOPMENT]
27-
NUM_TRAINING = 20
28-
NUM_VALIDATION = 10
27+
NUM_TRAINING = 40
28+
NUM_VALIDATION = 20
2929
NUM_TESTING = 10
30-
NUM_EPOCHS = 2
30+
NUM_EPOCHS = 3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fnal_tev_configuration.ini
1+
local_configuration.ini
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef CONSTANTS_H
2+
#define CONSTANTS_H
3+
4+
namespace ProtoDuneDL
5+
{
6+
enum Labels
7+
{
8+
Background = 0,
9+
Beam = 1,
10+
NotBeam = 2,
11+
};
12+
13+
const unsigned int WiresPerPlane[3] = {1148, 1148, 480}; // Plane: U, V, W
14+
const unsigned int WiresOffsetPerTPC[3] = {400, 400, 480};
15+
const unsigned int GlobalWiresPerPlane[3] = {1948, 1948, 1440}; // 2 * WiresOffsetPerTPC + WiresPerPlane
16+
const unsigned int TDCsPerPlane[3] = {6000, 6000, 6000};
17+
18+
const unsigned int MaxPlanes = 3;
19+
const unsigned int MaxWires = 448;
20+
const unsigned int MaxTDCs = 448;
21+
}
22+
#endif
0 Bytes
Binary file not shown.
2.04 KB
Binary file not shown.

0 commit comments

Comments
 (0)