return num_weights, predictions, logprob

if __name__ == '__main__':

    # Specify inference problem by its unnormalized log-posterior.
    rbf  = lambda x: np.exp(-x**2)
    relu = lambda x: np.maximum(x, 0.0)

    # Implement a 3-hidden layer neural network.
    num_weights, predictions, logprob = \
        make_nn_funs(layer_sizes=[34, 100, 100, 100, 1], nonlinearity=rbf)

    ### IMPORT DATA ###
    print("IMPORTING DATA")
    X_raw, y_raw = ascdata.load_asc_data()
    X, y = ascdata.remove_zeros(X_raw, y_raw)
    X_train, y_train, X_test, y_test = ascdata.split_train_test(X, y)
    # X_bp1, y_bp1 = ascdata.get_bp_data(1, 4194659, X_train, y_train)
    # X_bp2, y_bp2 = ascdata.get_bp_data(3, 4194873, X_train, y_train)

    objective = lambda weights, t: -logprob(weights, X_train, y_train)

    # def plot_initial_data(inX, iny, ax):
    #     plot_inputs = inX.T[2]
    #     ax.plot(plot_inputs, iny.ravel(), 'bx')
    #
    # # Set up figure.
    # fig = plt.figure(1, facecolor='white')
    # ax1 = fig.add_subplot(211, frameon=False)
    # ax2 = fig.add_subplot(212, frameon=False)
    #
import ascdata
import numpy as np
from sklearn import neural_network
import matplotlib.pyplot as plt
from sklearn.cross_validation import KFold
from math import sqrt

### IMPORT DATA ###
print "IMPORTING DATA"
X_raw, y_raw = ascdata.load_asc_data()
X_nonzero,y_nonzero = ascdata.remove_zeros(X_raw, y_raw)
X,y = ascdata.remove_crazy(X_nonzero,y_nonzero, 100)
X_train, y_train, X_test, y_test = ascdata.split_train_test(X, y)

### GET PREDICTIONS ###
print "GETTING PREDICTIONS"
clf = neural_network.MLPRegressor()
clf.fit(X_train, y_train)
y_pred = clf.predict(X_test)

rms_test = ascdata.multi_RMSE(y_test, y_pred)
print "overall rms test", rms_test

score = clf.score(X_test, y_test)
print "overall score", score

# Get cross validation RMS and r^2
def get_kfold_scores(inX, iny, k):
    N = inX.shape[0]
    kf = KFold(N, k, shuffle=True)
    mses=[]