Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jul 7, 2020
1 parent 99b4811 commit d949114
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
7 changes: 6 additions & 1 deletion guides/customizing_what_happens_in_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ def train_step(self, data):
# Just use `fit` as usual -- you can use callbacks, etc.
x = np.random.random((1000, 32))
y = np.random.random((1000, 1))
model.fit(x, y, epochs=3)
model.fit(x, y, epochs=1)

"""
Note that with this setup, you will need to manually call `reset_states()` on your
metrics after each epoch, or between training and evaluation.
"""

"""
## Supporting `sample_weight` & `class_weight`
Expand Down
4 changes: 2 additions & 2 deletions templates/api/metrics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A metric is a function that is used to judge the performance of your model.

Metric functions are similar to loss functions, except that the results from evaluating a metric are not used when training the model.
Note that you may use any loss functions as a metric function.
Note that you may use any loss function as a metric.


## Available metrics
Expand Down Expand Up @@ -176,7 +176,7 @@ class BinaryTruePositives(tf.keras.metrics.Metric):
return self.true_positives

def reset_states(self):
self.true_positive.assign(0)
self.true_positives.assign(0)

m = BinaryTruePositives()
m.update_state([0, 1, 1, 1], [0, 1, 0, 0])
Expand Down
2 changes: 1 addition & 1 deletion theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-61785484-1', 'keras.io');
ga('create', 'UA-61785484-1', 'auto');
ga('send', 'pageview');
</script>

Expand Down
28 changes: 23 additions & 5 deletions theme/css/docs.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body {
font-family: 'Open Sans', sans-serif;
font-size: 0.93rem
font-size: 0.95rem
}

h1,
Expand Down Expand Up @@ -88,6 +88,14 @@ blockquote {
#dropdown-nav {
display: none;
}
.nav-link {
font-size: 1rem;
}
.nav-sublink {
font-size: 0.9rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
@media screen and (max-width: 1342px) {
.k-nav {
width: 17rem;
Expand All @@ -100,6 +108,12 @@ blockquote {
}
}
@media screen and (max-width: 840px) {
body {
font-size: 1rem;
}
pre {
font-size: 100%;
}
.k-page {
width: 100%;
min-width: 375px;
Expand Down Expand Up @@ -139,6 +153,14 @@ blockquote {
padding: 2%;
padding-top: 1%;
}
.nav-link {
font-size: 1.1rem;
}
.nav-sublink {
font-size: 1rem;
padding-top: 0.6rem;
padding-bottom: 0.6rem;
}
}

.k-outline {
Expand Down Expand Up @@ -230,16 +252,12 @@ blockquote {
.nav-pills .nav-link {
border-radius: 0;
border-top: 1px solid #ddd;
font-size: 1rem;
background-color: #f7f6f6;
color: #d00000;
}
.nav-pills .nav-sublink {
font-size: 0.85rem;
padding-left: 1.5rem;
padding-right: 0.8rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
background-color: white;
color: black;
text-decoration: none;
Expand Down
1 change: 0 additions & 1 deletion theme/css/monokai.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.codehilite {
padding: 1rem;
margin-bottom: 1rem;
font-size: 0.9rem;
padding-bottom: 0.01rem;
}
.k-shell code{
Expand Down
10 changes: 10 additions & 0 deletions theme/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
<!-- Custom styles for this template -->
<link href="css/landing.css" rel="stylesheet">

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-61785484-1', 'auto');
ga('send', 'pageview');
</script>

</head>

<body>
Expand Down

0 comments on commit d949114

Please sign in to comment.