How to create a small test for Tensor flow and Keras with CodeRunner

Re: How to create a small test for Tensor flow and Keras with CodeRunner

by Sakari Lukkarinen -
Number of replies: 0
Don't know about that, but I have a slightly different approach in my mind. We are planning to include scikit-learn, keras, and JAX installed into our Moodle/CodeRunner/Jobe installation.

The aim is to automate some basic coding exercises related to machine learning and neural networks to our environment. The purpose is not to make tedious training runs, but teach to design models, change parameters, and select metrics, which all should be rather straightforward to execute.

Have anyone experiences of that kind of tasks and exercises and how smoothly the JobeServer can handle those tasks?

Example question:
Write a code that creates a neural network model having an input layer, one hidden layer with 4 neurons and with "relu" activation, and an output layer with one output value. Each input data sample has 10 numerical values.

Example answer:

import keras
input_shape = (10, 1)

model = keras.Sequential([
    keras.layers.Input(shape=input_shape),
    keras.layers.Dense(4, activation='relu'),
    keras.layers.Dense(1)
   ])

Example test case:

print(model.summary())