Linear Autoencoder Reconstruction Loss

~10 mincode completion

Implement autoencoder_loss(X, W_enc, b_enc, W_dec, b_dec) returning as a float.

Where this shows up

~10 min

8 employers weight this skill

4 autonomy companies, 1 enterprise vendor, 1 defense company, 1 health and bio company, 1 AI product company. Top match scores 87.

Python
import numpy as np


def autoencoder_loss(X, W_enc, b_enc, W_dec, b_dec):
    """
    Reconstruction loss of a linear autoencoder.

    Args:
        X:     images, shape (n, d), one per row
        W_enc: encoder weights, shape (d, k)
        b_enc: encoder bias, shape (k,)
        W_dec: decoder weights, shape (k, d)
        b_dec: decoder bias, shape (d,)

    Returns:
        float: mean over images of the summed squared error
    """
    # YOUR CODE HERE
    pass
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.