Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Add gradients for tf.batchNormalization4d #959

Merged
merged 4 commits into from
Apr 17, 2018

Conversation

caisq
Copy link
Collaborator

@caisq caisq commented Apr 16, 2018

support gradients for x, mean, variance, offset and scale.

A step toward fulfilling: tensorflow/tfjs#20


This change is Reviewable

support gradients for x, mean, variance, offset and scale.

A step toward fulfilling: tensorflow/tfjs#20
@caisq caisq requested review from dsmilkov and nsthorat April 16, 2018 16:31
@caisq
Copy link
Collaborator Author

caisq commented Apr 16, 2018

cc @easadler

@dsmilkov
Copy link
Contributor

:lgtm_strong: Thank you! 2 small comments. Feel free to submit after.


Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


src/ops/batchnorm.ts, line 18 at r2 (raw file):

 */

import {rsqrt} from '..';

this was probably generated by the editor. Add explicitly the filename


src/ops/batchnorm.ts, line 199 at r2 (raw file):

    const der = (dy: Tensor) => {
      util.assert(

move these asserts to the top of the batchNorm body (outside of the der() function)


Comments from Reviewable

@dsmilkov
Copy link
Contributor

Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


src/ops/batchnorm_test.ts, line 19 at r2 (raw file):

import * as tf from '../index';
import {onesLike, scalar} from '../index';

in tests, we've been usually calling tf.method() instead of method(). not feeling too strongly.


Comments from Reviewable

@caisq
Copy link
Collaborator Author

caisq commented Apr 17, 2018

Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


src/ops/batchnorm.ts, line 18 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

this was probably generated by the editor. Add explicitly the filename

Done.


src/ops/batchnorm.ts, line 199 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

move these asserts to the top of the batchNorm body (outside of the der() function)

Done.


src/ops/batchnorm_test.ts, line 19 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

in tests, we've been usually calling tf.method() instead of method(). not feeling too strongly.

Done.


Comments from Reviewable

@tensorflow tensorflow deleted a comment from googlebot Apr 17, 2018
@dsmilkov dsmilkov merged commit 184d339 into tensorflow:master Apr 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants