Skip to content

Instantly share code, notes, and snippets.

View jsksxs360's full-sized avatar

Sheng Xu jsksxs360

View GitHub Profile
@jsksxs360
jsksxs360 / FactoredTensor.py
Created October 10, 2021 02:30
This class implements Factored Tensor Network (FTN) (https://aclanthology.org/P19-1058.pdf). FTN is used to model complex interactions between two vectors
#coding:utf-8
from keras import backend as K
import tensorflow as tf
from keras.engine.topology import Layer
class FactoredTensor(Layer):
"""
This class implements Factored Tensor Network (FTN) (https://aclanthology.org/P19-1058.pdf).