human
I wrote the below code

    batch_size = 5
    n_features = 5
    n_classes = 3
    n_targets = 3
    irange = 0.1
    learning_rate = 0.1
    X_data = np.random.random(size=(batch_size, n_features))
    Y_categorical = np.asarray([[0], [1], [1], [2], [2]])
    class_frequencies = np.asarray([0.2, 0.4, 0.4])
    categorical_dataset = DenseDesignMatrix(X_data, y=Y_categorical, y_labels=n_classes)
    Y_continuous = np.random.random(size=(batch_size, n_targets))
    Y_means = np.mean(Y_continuous, axis=0)
    continuous_dataset = DenseDesignMatrix(X_data, y=Y_continuous)
    Y_multiclass = np.random.randint(n_classes, size=(batch_size, n_targets))
    multiclass_dataset = DenseDesignMatrix(X_data, y=Y_multiclass, y_labels=n_classes)
    def softmax_layer(dataset):
        return Softmax(n_classes, 'h0', irange=irange, init_bias_target_marginals=dataset)
    valid_categorical_mlp = MLP(layers=[softmax_layer(categorical_dataset)], nvis=n_features)
    actual = valid_categorical_mlp.layers[0].b.get_value()
    expected = pseudoinverse_softmax_numpy(class_frequencies)
    assert np.allclose(actual, expected)
    valid_continuous_mlp = MLP(layers=[softmax_layer(continuous_dataset)], nvis=n_features)
    actual = valid_continuous_mlp.layers[0].b.get_value()
    expected = pseudoinverse_softmax_numpy(Y_means)
    assert np.allclose(actual, expected)
    def invalid_multiclass_mlp():
        return MLP(layers=[softmax_layer(multiclass_dataset)], nvis=n_features)
    assert_raises(AssertionError, invalid_multiclass_mlp)

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def test_init_bias_target_marginals():