-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb7e100
commit fd82b04
Showing
96 changed files
with
2,811 additions
and
1,317 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,113 @@ | ||
''' | ||
Created on 7 Apr 2017 | ||
@author: jkiesele | ||
''' | ||
from __future__ import print_function | ||
|
||
|
||
from tensorflow.keras.callbacks import Callback, EarlyStopping,History,ModelCheckpoint,TensorBoard,ReduceLROnPlateau | ||
# loss per epoch | ||
from time import time | ||
from pdb import set_trace | ||
import json | ||
|
||
class newline_callbacks_begin(Callback): | ||
|
||
def __init__(self,outputDir): | ||
self.outputDir=outputDir | ||
self.loss=[] | ||
self.val_loss=[] | ||
self.full_logs=[] | ||
|
||
def on_epoch_end(self,epoch, epoch_logs={}): | ||
import os | ||
lossfile=os.path.join( self.outputDir, 'losses.log') | ||
print('\n***callbacks***\nsaving losses to '+lossfile) | ||
self.loss.append(epoch_logs.get('loss')) | ||
self.val_loss.append(epoch_logs.get('val_loss')) | ||
f = open(lossfile, 'w') | ||
for i in range(len(self.loss)): | ||
f.write(str(self.loss[i])) | ||
f.write(" ") | ||
f.write(str(self.val_loss[i])) | ||
f.write("\n") | ||
f.close() | ||
normed = {} | ||
for vv in epoch_logs: | ||
normed[vv] = float(epoch_logs[vv]) | ||
self.full_logs.append(normed) | ||
lossfile=os.path.join( self.outputDir, 'full_info.log') | ||
with open(lossfile, 'w') as out: | ||
out.write(json.dumps(self.full_logs)) | ||
|
||
class newline_callbacks_end(Callback): | ||
def on_epoch_end(self,epoch, epoch_logs={}): | ||
print('\n***callbacks end***\n') | ||
|
||
|
||
class Losstimer(Callback): | ||
def __init__(self, every = 5): | ||
self.points = [] | ||
self.every = every | ||
|
||
def on_train_begin(self, logs): | ||
self.start = time() | ||
|
||
def on_batch_end(self, batch, logs): | ||
if (batch % self.every) != 0: return | ||
elapsed = time() - self.start | ||
cop = {} | ||
for i, j in logs.items(): | ||
cop[i] = float(j) | ||
cop['elapsed'] = elapsed | ||
self.points.append(cop) | ||
|
||
class all_callbacks(object): | ||
def __init__(self, | ||
stop_patience=10, | ||
lr_factor=0.5, | ||
lr_patience=1, | ||
lr_epsilon=0.001, | ||
lr_cooldown=4, | ||
lr_minimum=1e-5, | ||
outputDir=''): | ||
|
||
|
||
|
||
self.nl_begin=newline_callbacks_begin(outputDir) | ||
self.nl_end=newline_callbacks_end() | ||
|
||
self.stopping = EarlyStopping(monitor='val_loss', | ||
patience=stop_patience, | ||
verbose=1, mode='min') | ||
|
||
self.reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=lr_factor, patience=lr_patience, | ||
mode='min', verbose=1, epsilon=lr_epsilon, | ||
cooldown=lr_cooldown, min_lr=lr_minimum) | ||
|
||
self.modelbestcheck=ModelCheckpoint(outputDir+"/KERAS_check_best_model.h5", | ||
monitor='val_loss', verbose=1, | ||
save_best_only=True) | ||
|
||
self.modelbestcheckweights=ModelCheckpoint(outputDir+"/KERAS_check_best_model_weights.h5", | ||
monitor='val_loss', verbose=1, | ||
save_best_only=True,save_weights_only=True) | ||
|
||
self.modelcheckperiod=ModelCheckpoint(outputDir+"/KERAS_check_model_epoch{epoch:02d}.h5", verbose=1,period=10) | ||
|
||
self.modelcheck=ModelCheckpoint(outputDir+"/KERAS_check_model_last.h5", verbose=1) | ||
|
||
self.modelcheckweights=ModelCheckpoint(outputDir+"/KERAS_check_model_last_weights.h5", verbose=1,save_weights_only=True) | ||
|
||
self.tb = TensorBoard(log_dir=outputDir+'/logs') | ||
|
||
self.history=History() | ||
self.timer = Losstimer() | ||
|
||
self.callbacks=[ | ||
self.nl_begin, | ||
self.modelbestcheck,self.modelbestcheckweights, self.modelcheck,self.modelcheckweights,self.modelcheckperiod, | ||
self.reduce_lr, self.stopping, self.nl_end, self.tb, self.history, | ||
self.timer | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+54.3 KB
(160%)
images/AE/Latent dimension of Autoencoder without classifier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+647 KB
model_2/logs/train/events.out.tfevents.1638871282.VALANTR.4396.9381.v2
Binary file not shown.
Binary file added
BIN
+40 Bytes
model_2/logs/train/events.out.tfevents.1638871286.VALANTR.profile-empty
Binary file not shown.
Binary file added
BIN
+1.75 MB
model_2/logs/train/events.out.tfevents.1638871651.VALANTR.4396.31934.v2
Binary file not shown.
Binary file added
BIN
+1.47 MB
model_2/logs/train/events.out.tfevents.1638871697.VALANTR.4396.52162.v2
Binary file not shown.
Binary file added
BIN
+1.45 MB
model_2/logs/train/events.out.tfevents.1638871760.VALANTR.4396.110022.v2
Binary file not shown.
Binary file added
BIN
+1.63 MB
model_2/logs/train/events.out.tfevents.1638872077.VALANTR.4396.130120.v2
Binary file not shown.
Binary file added
BIN
+1.88 MB
model_2/logs/train/events.out.tfevents.1638872221.VALANTR.4396.188421.v2
Binary file not shown.
Binary file added
BIN
+1.87 MB
model_2/logs/train/events.out.tfevents.1638873488.VALANTR.4396.247484.v2
Binary file not shown.
Binary file added
BIN
+2.1 MB
model_2/logs/train/events.out.tfevents.1638873584.VALANTR.4396.268325.v2
Binary file not shown.
Binary file added
BIN
+1.96 MB
model_2/logs/train/events.out.tfevents.1638873699.VALANTR.4396.290149.v2
Binary file not shown.
Binary file added
BIN
+2.02 MB
model_2/logs/train/events.out.tfevents.1638873745.VALANTR.4396.310285.v2
Binary file not shown.
Binary file added
BIN
+2.54 MB
model_2/logs/train/events.out.tfevents.1638873796.VALANTR.4396.330725.v2
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_01_26/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_01_26/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+36.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_01_26/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+20.7 KB
model_2/logs/train/plugins/profile/2021_12_07_10_01_26/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_07_37/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_07_37/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+36.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_07_37/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+20.7 KB
model_2/logs/train/plugins/profile/2021_12_07_10_07_37/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_08_23/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_08_23/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+53.5 KB
model_2/logs/train/plugins/profile/2021_12_07_10_08_23/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+29.4 KB
model_2/logs/train/plugins/profile/2021_12_07_10_08_23/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_09_26/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_09_26/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+36.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_09_26/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+20.7 KB
model_2/logs/train/plugins/profile/2021_12_07_10_09_26/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_14_45/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_14_45/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+53.5 KB
model_2/logs/train/plugins/profile/2021_12_07_10_14_45/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+29.5 KB
model_2/logs/train/plugins/profile/2021_12_07_10_14_45/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_17_12/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_17_12/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+58.8 KB
model_2/logs/train/plugins/profile/2021_12_07_10_17_12/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+32 KB
model_2/logs/train/plugins/profile/2021_12_07_10_17_12/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_38_14/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_38_14/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+41.5 KB
model_2/logs/train/plugins/profile/2021_12_07_10_38_14/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+23.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_38_14/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_39_51/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_39_51/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+46.8 KB
model_2/logs/train/plugins/profile/2021_12_07_10_39_51/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+25.7 KB
model_2/logs/train/plugins/profile/2021_12_07_10_39_51/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_41_45/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_41_45/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+36.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_41_45/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+20.6 KB
model_2/logs/train/plugins/profile/2021_12_07_10_41_45/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+3.01 KB
model_2/logs/train/plugins/profile/2021_12_07_10_42_31/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.14 KB
model_2/logs/train/plugins/profile/2021_12_07_10_42_31/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+36.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_42_31/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+20.6 KB
model_2/logs/train/plugins/profile/2021_12_07_10_42_31/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+2.97 KB
model_2/logs/train/plugins/profile/2021_12_07_10_43_24/VALANTR.input_pipeline.pb
Binary file not shown.
Empty file.
Binary file added
BIN
+4.09 KB
model_2/logs/train/plugins/profile/2021_12_07_10_43_24/VALANTR.overview_page.pb
Binary file not shown.
Binary file added
BIN
+64.3 KB
model_2/logs/train/plugins/profile/2021_12_07_10_43_24/VALANTR.tensorflow_stats.pb
Binary file not shown.
Binary file added
BIN
+34.8 KB
model_2/logs/train/plugins/profile/2021_12_07_10_43_24/VALANTR.xplane.pb
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638871287.VALANTR.4396.10840.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638871658.VALANTR.4396.33393.v2
Binary file not shown.
Binary file added
BIN
+9.17 KB
model_2/logs/validation/events.out.tfevents.1638871704.VALANTR.4396.55106.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638871767.VALANTR.4396.111481.v2
Binary file not shown.
Binary file added
BIN
+9.17 KB
model_2/logs/validation/events.out.tfevents.1638872086.VALANTR.4396.133064.v2
Binary file not shown.
Binary file added
BIN
+9.17 KB
model_2/logs/validation/events.out.tfevents.1638872232.VALANTR.4396.191606.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638873495.VALANTR.4396.249184.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638873592.VALANTR.4396.270266.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638873706.VALANTR.4396.291608.v2
Binary file not shown.
Binary file added
BIN
+1.44 KB
model_2/logs/validation/events.out.tfevents.1638873752.VALANTR.4396.311744.v2
Binary file not shown.
Binary file added
BIN
+9.17 KB
model_2/logs/validation/events.out.tfevents.1638873805.VALANTR.4396.334151.v2
Binary file not shown.