Giter VIP home page Giter VIP logo

Comments (3)

ilblackdragon avatar ilblackdragon commented on June 26, 2024

The easiest way to proceed is to start with simple TensorFlowLinearClassifier - then you don't need to do anything with your data - just pass your features as it is.

If you really want to apply convolutional networks (though in this case it doesn't seem very meaningful) - you should just skip this conversion steps and do directly conv+pool and then logistic regression on top:

def my_conv_model(X, y):
   X = tf.reshape(X, [-1, N_FEATURES, 1, 1])  # to form a 4d tensor of shape batch_size x n_features x 1 x 1
   features = skflow.ops.conv2d(X, N_FILTERS, [WINDOW_SIZE, 1], padding='VALID') # this will give you sliding window of WINDOW_SIZE x 1 convolution.
   pool = tf.squeeze(tf.reduce_max(features, 1), squeeze_dims=[1])
   return return skflow.models.logistic_regression(pool, y)

But I think you really should just concentrate on TensorFlowLinearClassifier or TensorFlowDNNClassifier - if you only have bunch of inputs variables that don't have any inherent structure. The Convolution and RNNs are for getting signal from structured data (like images or text).

from skflow.

vinhqdang avatar vinhqdang commented on June 26, 2024

Thanks a lot,

When I use LinearClassifier, I achieved the accuracy 35% (without any tuning, just follow the example at homepage).

With DNNClassifier I achieved the accuracy of 40%, and with CNN you suggested I can reached to 50%. So I think CNN should be good.

However, I hope that I can improve the accuracy a little bit more. For CNN, what tuning parameters I should try to modify to see the difference?

Thanks a lot,

from skflow.

ilblackdragon avatar ilblackdragon commented on June 26, 2024

I should write more about tuning of the models, but here are few tips:

  • Increase number of steps to train - better, do how it's in the https://github.com/google/skflow/blob/master/examples/text_classification_character_cnn.py with loop of train/evaluate and save model state.
  • Try different learning rate - a lot of models are very sensitive to learning rate.
  • For DNN - try different number of layers and hidden units (hidden_units variable)
  • For CNN - try increasing N_FILTERS and adding more layers of convolution / max pooling.

from skflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.