def get_image_classifier_pt_functional():
    """
    Simple PyTorch functional classifier for unit testing.
    """
    import torch.nn as nn
    import torch.optim as optim

    from art.estimators.classification import PyTorchClassifier

    model = nn.Sequential(
        nn.Conv2d(1, 4, 5),
        nn.ReLU(),
        nn.MaxPool2d(2, 2),
        nn.Conv2d(4, 10, 5),
        nn.ReLU(),
        nn.MaxPool2d(2, 2),
        nn.Flatten(),
        nn.Linear(4 * 4 * 10, 100),
        nn.Linear(100, 10),
    )
    criterion = nn.CrossEntropyLoss()
    optimizer = optim.Adam(model.parameters(), lr=0.01)

    classifier = PyTorchClassifier(
        model=model,
        clip_values=(0, 1),
        loss=criterion,
        optimizer=optimizer,
        input_shape=(1, 28, 28),
        nb_classes=10,
    )
    return classifier

    Simple PyTorch functional classifier for unit testing.
    
tests/utils.py