Esempio n. 1
0
def test_np_autoencoder(pandas):
    """Just makes sure that this code will run; it doesn't check that
    it is creating good models.
    """
    X = utils.randmatrix(20, 50)
    if pandas:
        X = pd.DataFrame(X)
    ae = np_autoencoder.Autoencoder(hidden_dim=5, max_iter=100)
    H = ae.fit(X)
    ae.predict(X)
    H_is_pandas = isinstance(H, pd.DataFrame)
    assert H_is_pandas == pandas
Esempio n. 2
0
            'max_iter': 10,
            'eta': 0.1
        }
    ],
    [
        torch_shallow_neural_classifier.TorchShallowNeuralClassifier(
            hidden_dim=5, hidden_activation=nn.ReLU(), max_iter=1, eta=1.0),
        {
            'hidden_dim': 10,
            'hidden_activation': nn.ReLU(),
            'max_iter': 10,
            'eta': 0.1
        }
    ],
    [
        np_autoencoder.Autoencoder(hidden_dim=5, max_iter=1, eta=1.0),
        {'hidden_dim': 10, 'max_iter': 10, 'eta': 0.1}
    ],
    [
        torch_autoencoder.TorchAutoencoder(
            hidden_dim=5, hidden_activation=nn.ReLU(), max_iter=1, eta=1.0),
        {
            'hidden_dim': 10,
            'hidden_activation': nn.ReLU(),
            'max_iter': 10,
            'eta': 0.1
        }
    ]
])
def test_parameter_setting(model, params):
    model.set_params(**params)