Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Add test and guard for circular model weight assignment. #285

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

bileschi
Copy link
Contributor

@bileschi bileschi commented Aug 9, 2018

Description

Fixes tfjs#465 "Manually setting weights for mode" in the case of setting weights to weights the model already owns. Previously the TFJS infrastructure was discarding needed weights.

Adds unit tests covering the behavior (fit model, assign weights to weights the model already owns, check the weights).


For repository owners only:

BUG: fixes tfjs-union#465


This change is Reviewable

Copy link
Contributor

@caisq caisq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @bileschi, @caisq, and @ericdnielsen)


src/variables.ts, line 98 at r1 (raw file):

    if (this.val.id !== newVal.id) {
      this.val.assign(newVal);

You can move the following if statement into this if statement, because if it is the same tensor, there is no need to apply the constraint again.

@bileschi
Copy link
Contributor Author

bileschi commented Aug 9, 2018


src/variables.ts, line 98 at r1 (raw file):

Previously, caisq (Shanqing Cai) wrote…
    if (this.val.id !== newVal.id) {
      this.val.assign(newVal);

You can move the following if statement into this if statement, because if it is the same tensor, there is no need to apply the constraint again.

Thanks for the review :)

Done.

@bileschi bileschi merged commit 934134f into master Aug 9, 2018
@bileschi bileschi deleted the set_weights_bug branch August 9, 2018 18:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants