bstriner / dense_tensor Goto Github PK
View Code? Open in Web Editor NEWDense Tensor Layer for Keras
License: MIT License
Dense Tensor Layer for Keras
License: MIT License
Hi.
When installing the package, I confronted with the following error.
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-4l69r1fk-build/setup.py'
which means that there is no setup.py file to install package. Could you please add it?
Just a heads up that I haven't tested on Keras-2 yet. Please comment here if you run into issues. Will try to update over the summer.
Cheers
https://arxiv.org/abs/1704.08362
They don't call it a Neural Tensor Network, they just call them 2nd order neurons.
Hello, I have some question about the formula in your program
Dense Tensor Layer: f_i = a( xV_ix^T + W_ix^T + b_i)
Your formula is different of socher's, What is x represent for in above formula?
In socher's paper, The formula should be f_i = a( e_1V_ie_2^T + W_i*(e_1,e_2)^T + b_i).
Hi,
Could you please let me know whether or not it is compatible with keras 2.0.8 as there are some API change in the latest version of keras.
Hi,
I just ran the "examples/example_tensor.py" and got an error
ValueError: Multiple target dimensions are not supported. Expected: None, int, (int, int), Provided: [[1], [1]]
I use Kera 2.2.2 and tensorflow 1.9.0.
Could you help me to check this problem?
# example code
from keras.layers import Input
from keras.models import Model
from keras.optimizers import Adam
from dense_tensor import DenseTensor, simple_tensor_factorization
from dense_tensor.example_utils import experiment
from dense_tensor.utils import l1l2
def tensor_model(input_dim=28 * 28, output_dim=10, reg=lambda: l1l2(1e-6, 1e-6)):
"""
One layer of a DenseTensor
"""
_x = Input(shape=(input_dim,))
factorization = simple_tensor_factorization(tensor_regularizer=reg())
y = DenseTensor(units=output_dim,
activation='softmax',
kernel_regularizer=reg(),
factorization=factorization)
_y = y(_x)
m = Model(_x, _y)
m.compile(Adam(1e-3, decay=1e-4), loss='categorical_crossentropy', metrics=["accuracy"])
return m
if __name__ == "__main__":
path = "output/dense_tensor"
model = tensor_model()
experiment(path, model)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.