0
0
Agentic AIml~10 mins

Progress tracking and reporting in Agentic AI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the training loss after each epoch.

Agentic AI
for epoch in range(5):
    loss = model.train_one_epoch(data)
    print('Epoch', epoch, 'Loss:', [1])
Drag options to blanks, or click blank then click option'
Aepoch
Bloss
Cdata
Dmodel
Attempts:
3 left
💡 Hint
Common Mistakes
Printing the epoch number instead of the loss.
Printing the model object.
2fill in blank
medium

Complete the code to update the progress bar with the current accuracy.

Agentic AI
for batch in data_loader:
    predictions = model.predict(batch)
    accuracy = compute_accuracy(predictions, batch.labels)
    progress_bar.update([1]=accuracy)
Drag options to blanks, or click blank then click option'
Ascore
Baccuracy
Cvalue
Dprogress
Attempts:
3 left
💡 Hint
Common Mistakes
Using the variable name accuracy as the parameter name.
Using score which is undefined.
3fill in blank
hard

Fix the error in the code to correctly log the validation accuracy after each epoch.

Agentic AI
for epoch in range(10):
    val_acc = evaluate(model, val_data)
    logger.log('Validation Accuracy:', [1])
Drag options to blanks, or click blank then click option'
Aval_acc()
Bmodel
Cevaluate
Dval_acc
Attempts:
3 left
💡 Hint
Common Mistakes
Calling val_acc as a function.
Logging the model object instead of accuracy.
4fill in blank
hard

Fill both blanks to create a dictionary that maps epoch numbers to their loss values.

Agentic AI
loss_history = { [1]: [2] for [1] in range(1, 6) }
Drag options to blanks, or click blank then click option'
Aepoch
Bloss
Cval_loss
Daccuracy
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable for both key and value.
Using validation loss or accuracy instead of training loss.
5fill in blank
hard

Fill all three blanks to filter and store epochs where accuracy is above 0.8.

Agentic AI
high_acc_epochs = { [1]: [2] for [1] in epochs if [3][[1]] > 0.8 }
Drag options to blanks, or click blank then click option'
Aepoch
Baccuracy
Cacc_dict
Dloss
Attempts:
3 left
💡 Hint
Common Mistakes
Using loss instead of accuracy.
Using wrong variable names for dictionary or keys.