This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.base import BaseEstimator | |
from sklearn.exceptions import NotFittedError | |
import numpy as np | |
class IRFF(BaseEstimator): | |
''' | |
Random fourier features using the improved embedding | |
https://www.cs.cmu.edu/~schneide/DougalRandomFeatures_UAI2015.pdf | |
''' |
NewerOlder