albertbup / deep-belief-network

A Python implementation of Deep Belief Networks built upon NumPy and TensorFlow with scikit-learn compatibility
MIT License
481 stars 212 forks source link

Diffrent dataset for backpropagation of the “ANN” #29

Closed Ahone91 closed 6 years ago

Ahone91 commented 6 years ago

Hi, thanks for really good code!

I would like to use the deep-belief-network for regression.

My problem is that I would like to use a different dataset for the last backpropagation of the “ANN” then for initial training of the RBM. Is that possible?

I’m trying to use the deep-belief-network for soft sensor modelling in chemical plants. Found some interesting academic publications where they have used it with great results.

Thanks in advance,

Have a good day,

Best regards Lukas

albertbup commented 6 years ago

Hi,

Yes, it's possible although it's not clear how to do it at first glance, I think I should make that part easier. Anyway, here you are:


# You create the model as you wish
dbn = SupervisedDBNRegression(...)

# Do pre-training for RBM stack
dbn.pre_train(X_1)

# Just fine-tune with backprop (pre_train=False)
dbn.fit(X_2, y, pre_train=False)

Hope it helps!