Code Monkey home page Code Monkey logo

Comments (5)

ralscha avatar ralscha commented on September 17, 2024

You are right. stats is not used. It's just for information and contains some statistics about the models. This information is not needed for running the model and thus not saved.
You could add console.log(stats) and see what it contains

from blog2019.

MinerNJ avatar MinerNJ commented on September 17, 2024

Ah ok thank you! Where is the accuracy of the model recorded at? Following your blog on Machine Learning with BrainJS shows your accuracy, but I wasn't able to find it in the model.json. Also, I apologize if this is not the place to ask that question.

from blog2019.

ralscha avatar ralscha commented on September 17, 2024

Good question. I don't remember from where I got the accuracy. model.json only contains the weights and when you print stats with console.log(stats); you get this information.

{                                                                          
  avgs: {                                                                  
    trainTime: 836414.5,                                                   
    testTime: 16537.25,                                                    
    iterations: 3,                                                         
    error: 0.004108120867492793                                            
  },                                                                       
  stats: { total: 210000, testSize: 52500, trainSize: 157500 },            
  sets: [                                                                  
    {                                                                      
      error: 0.00411777707088103,                                          
      misclasses: [Array],                                                 
      total: 52500,                                                        
      trainTime: 735011,                                                   
      testTime: 16787,                                                     
      iterations: 3,                                                       
      learningRate: 0.3,                                                   
      hiddenLayers: [Array],                                               
      network: [Object]                                                    
    },                                                                     
    {                                                                      
      error: 0.0042104415590232215,                                        
      misclasses: [Array],                                                 
      total: 52500,                                                        
      trainTime: 937039,                                                   
      testTime: 16581,                                                     
      iterations: 3,                                                       
      learningRate: 0.3,                                                   
      hiddenLayers: [Array],                                               
      network: [Object]                                                    
    },                                                                     
    {                                                                      
      error: 0.004051989221686814,                                         
      misclasses: [Array],                                                 
      total: 52500,                                                        
      trainTime: 828726,                                                   
      testTime: 16495,                                                     
      iterations: 3,                                                       
      learningRate: 0.3,                                                   
      hiddenLayers: [Array],                                               
      network: [Object]                                                    
    },                                                                     
    {                                                                      
      error: 0.004052275618380105,                                         
      misclasses: [Array],                                                 
      total: 52500,                                                        
      trainTime: 844882,                                                   
      testTime: 16286,                                                     
      iterations: 3,                                                       
      learningRate: 0.3,                                                   
      hiddenLayers: [Array],                                               
      network: [Object]                                                    
    }                                                                      
  ]                                                                        
}                                                                          

from blog2019.

ralscha avatar ralscha commented on September 17, 2024

Oh. I remember. I wrote an additional program that tested the model:
https://github.com/ralscha/blog2019/blob/master/mnistjs/train/run.js

Run: node run.js

Output:

Total           : 10000
Number of errors: 180
Accuracy:       : 98.2 %

from blog2019.

MinerNJ avatar MinerNJ commented on September 17, 2024

from blog2019.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.