Skip to content

Commit 1edd876

Browse files
committed
remove plt
1 parent 732835e commit 1edd876

File tree

9 files changed

+16
-27
lines changed

9 files changed

+16
-27
lines changed

metrics/ae/histogram.png

-377 Bytes
Loading

metrics/ae/metrics.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"acc": 0.961, "precision": 0.8536906854130053, "recall": 0.9715, "f1": 0.9087932647333957, "f2": 0.9454067730634488, "roc": 0.9560253750000001, "threshold": 0.053}
1+
{"acc": 0.8462, "precision": 0.697098976109215, "recall": 0.4085, "f1": 0.5151324085750315, "f2": 0.4453772350632359, "roc": 0.955555625, "threshold": 0.056}

metrics/ae/metrics.png

-949 Bytes
Loading

metrics/ae/roc.png

-842 Bytes
Loading

models/ae.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import os
2222
from utils import train_utils
23-
import matplotlib.pyplot as plt
2423

2524
import numpy as np
2625
import random
@@ -134,16 +133,7 @@ def train(self, in_train, in_val):
134133
kwargs['verbose'] = 1
135134
kwargs['callbacks'] = [train_utils.TimeHistory()]
136135

137-
history = self.model.fit(X_train, X_trains, **kwargs)
138-
# Plot training & validation loss values
139-
# plt.plot(history.history['loss'])
140-
# plt.plot(history.history['val_loss'])
141-
# plt.title('Model loss')
142-
# plt.ylabel('Loss')
143-
# plt.xlabel('Epoch')
144-
# plt.legend(['Train', 'Test'], loc='upper left')
145-
# # plt.show()
146-
# plt.close()
136+
history = self.model.fit(X_train, X_train, **kwargs)
147137

148138
def compute_anomaly_score(self, df):
149139
preds = self.model.predict(df)

models/bigan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from tensorflow.keras.layers import LeakyReLU, ReLU
2020
import os
2121

22-
import matplotlib.pyplot as plt
2322

2423
import numpy as np
2524
import random

models/seq2seq.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from tensorflow.keras.optimizers import Adam
1717

1818
from utils import train_utils
19-
import matplotlib.pyplot as plt
2019

2120
import numpy as np
2221
import random
@@ -169,12 +168,12 @@ def train(self, in_train, in_test):
169168
history = self.model.fit(
170169
[encoder_input_data, decoder_input_data], decoder_target_data, **kwargs)
171170
# Plot training & validation loss values
172-
plt.plot(history.history['loss'])
173-
plt.plot(history.history['val_loss'])
174-
plt.title('Model loss')
175-
plt.ylabel('Loss')
176-
plt.xlabel('Epoch')
177-
plt.legend(['Train loss', 'Val Loss'], loc='upper left')
171+
# plt.plot(history.history['loss'])
172+
# plt.plot(history.history['val_loss'])
173+
# plt.title('Model loss')
174+
# plt.ylabel('Loss')
175+
# plt.xlabel('Epoch')
176+
# plt.legend(['Train loss', 'Val Loss'], loc='upper left')
178177
# plt.show()
179178

180179
def decode_sequence(self, input_seq):

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
import logging
22-
logging.basicConfig(level=logging.DEBUG)
22+
logging.basicConfig(level=logging.INFO)
2323

2424

2525
parser = argparse.ArgumentParser(description='Process train parameters')

utils/eval_utils.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
# =============================================================================
88
#
99

10+
from multiprocessing import Queue, Pool
11+
import json
12+
import os
13+
import logging
1014
import numpy as np
1115
from sklearn.metrics import precision_recall_fscore_support
1216
from sklearn.metrics import confusion_matrix, accuracy_score, f1_score, precision_score, recall_score, fbeta_score, roc_curve, auc, roc_auc_score
1317
import pandas as pd
14-
import matplotlib.pyplot as plt
15-
import logging
16-
import os
17-
import json
18-
19-
from multiprocessing import Queue, Pool
18+
import matplotlib
19+
matplotlib.use('Agg')
2020

21+
plt = matplotlib.pyplot
2122
fig_size = (9, 6)
2223
fig_font = 15
2324
plot_params = {'legend.fontsize': 'large',

0 commit comments

Comments
 (0)