Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course 1 (Tensorflow JS) - Week 1 - TF Deployment #92

Open
ValeriVoev opened this issue Apr 20, 2020 · 0 comments
Open

Course 1 (Tensorflow JS) - Week 1 - TF Deployment #92

ValeriVoev opened this issue Apr 20, 2020 · 0 comments

Comments

@ValeriVoev
Copy link

There is a function defined in FirstHTML.html in the Examples as follows:

async function doTraining(model){
            const history = 
                  await model.fit(xs, ys, 
                        { epochs: 500,
                          callbacks:{
                              onEpochEnd: async(epoch, logs) =>{
                                  console.log("Epoch:" 
                                              + epoch 
                                              + " Loss:" 
                                              + logs.loss);
                                  
                              }
                          }
                        });
        }

The issue is that xs and ys are globally defined variables and this function is not self-contained as is. Shouldn't xs and ys be passed as function arguments rather than as global variables?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant