Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ketos ketos
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • public_projects
  • ketosketos
  • Issues
  • #140

Closed
Open
Created Dec 14, 2021 by val veirs@v_veirs

Exploring feeding user data into Ketos objects

I wish to program a working example of building different Ketos neural net models.

Specifically, I am starting with constructing a simple MLP following the suggestions I found in Ketos documentation as "Adding the ketos Neural Network interface to your own architectures"

My current progress is stymied by not knowing what do do when presented with the setting of needed parameter values for instantiating class MLPInterface

Here is the defining code from ketos documentation:

class MLP(Model):
    def __init__(self, n_neurons, activation):
        super(MLP, self).__init__()
        self.dense = tfk.layers.Dense(n_neurons, activation=activation)
        self.final_node = tfk.layers.Dense(10)

    def call(self, inputs):
        output = self.dense(inputs)
        output = self.dense(output)
        output = self.final_node(output)

class MLPInterface(NNInterface):
    def __init__(self, n_neurons, activation, optimizer, loss_function, metrics):
        super(MLPInterface, self).__init__(optimizer, loss_function, metrics)
        self.n_neurons = n_neurons
        self.activation = activation
        self.model = MLP(n_neurons=n_neurons, activation=activation)

My plan is to feed the mnist numpy arrays and corresponding labels and run the NN to take the 28x28 arrays, flatten them maybe, and send the 784 linear arrays in matching them to 1 of 10 label integer values into this MLPInterface.

I have things running until the train_loop which throws an error likely because I don't know how to specify optimizer, loss_function, and metrics

I will put the code as it is now in my github. https://github.com/orcasound/orca-autoencoder/blob/main/MLP/MLP_Ketos.py

I will deeply appreciate any suggestions.

And, I have not yet figured out how to get the class definitions above to print nicely here:-(

Edited Dec 15, 2021 by Oliver Kirsebom
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking