Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.
/ hungarian-layer Public archive

Hungarian Layer: Logics Empowered Neural Architecture [UNMAINTAINED]

Notifications You must be signed in to change notification settings

theSage21/hungarian-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hungarian Layer

Pytorch implementation of the Hungarian layer as described in https://arxiv.org/abs/1712.02555

Usage

import numpy as np

x = [[[0, 1], [0, 0], [1, 0]],
     [[0, 1], [0, 0], [1, 0]],
     [[0, 1], [0, 0], [1, 0]],
     [[0, 1], [0, 0], [1, 0]]
     ]
y = [[[0, 1], [0, 0]],
     [[0, 1], [0, 0]],
     [[0, 1], [0, 0]],
     [[0, 1], [0, 0]]]
x = np.array(x).astype(np.float64)
y = np.array(y).astype(np.float64)

x = torch.from_numpy(x)  # (4, 3, 2)
y = torch.from_numpy(y)  # (4, 2, 2)

hung = Hungarian()
a = hung(x, y)
print(a.shape)  #   (4, 3, 2)
print(a)

About

Hungarian Layer: Logics Empowered Neural Architecture [UNMAINTAINED]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages