Skip to content

Instantly share code, notes, and snippets.

@arynas
Created February 26, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arynas/0f2a9b4ccd389db1c76877fd85a95dce to your computer and use it in GitHub Desktop.
Save arynas/0f2a9b4ccd389db1c76877fd85a95dce to your computer and use it in GitHub Desktop.
import tensorflow as tf
import numpy as np
class TextCNN(object):
"""
A CNN for text classification.
Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.
"""
def __init__(
self, sequence_length, num_classes, vocab_size,
embedding_size, filter_sizes, num_filters):
# Implementation...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment