Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Merge requests
!318
Resolve "release v1.4.0"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "release v1.4.0"
release_v1.4.0
into
master
Overview
0
Commits
229
Pipelines
3
Changes
1
Merged
Ghost User
requested to merge
release_v1.4.0
into
master
3 years ago
Overview
0
Commits
229
Pipelines
3
Changes
1
Expand
Closes
#317 (closed)
Edited
3 years ago
by
Ghost User
0
0
Merge request reports
Viewing commit
658f4ddf
Prev
Next
Show latest version
1 file
+
14
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
658f4ddf
first draft of callback
· 658f4ddf
Felix Kleinert
authored
3 years ago
mlair/model_modules/keras_extensions.py
+
14
−
0
Options
@@ -8,6 +8,7 @@ import math
import
pickle
from
typing
import
Union
,
List
from
typing_extensions
import
TypedDict
from
time
import
time
import
numpy
as
np
from
keras
import
backend
as
K
@@ -111,6 +112,19 @@ class LearningRateDecay(History):
return
K
.
get_value
(
self
.
model
.
optimizer
.
lr
)
class
TimingCallback
(
Callback
):
def
__init__
(
self
):
self
.
logs
=
[]
self
.
starttime
=
None
super
().
__init__
()
def
on_epoch_begin
(
self
,
logs
=
{}):
self
.
starttime
=
time
()
def
on_epoch_end
(
self
,
logs
=
{}):
self
.
logs
.
append
(
time
()
-
self
.
starttime
)
class
ModelCheckpointAdvanced
(
ModelCheckpoint
):
"""
Enhance the standard ModelCheckpoint class by additional saves of given callbacks.
Loading