GithubHelp home page GithubHelp logo

scikit-kge's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scikit-kge's Issues

More elaborate examples

It would be nice to see a more detailed example.
The README says:

N, M, xs, ys = load_data('path to data')

But how exactly do these parameters look like? Something like:

N = 12 
M = 20
xs = [(s1, o1, p1), (s2, o2, p2), ...]
ys = [1, -1, ...]

...with concrete examples would be nice

[enhancement] Some suggestions

Dear @mnick ,

i really appriciate this package. However, it is somewhat difficult to fully wrap my head arround it.
It would help if you could:

  • Create an example that solves a classic machine learning problem with sckit-kge, as it is commonly done.
  • create a detailed documentation of all available algorithms and other functions
  • explain more about the negative sampling you are talking about in the readme file.
  • explain how to access the embeddings
  • maybe support RDF Graph input
  • make scikit-kge available at pypi

Best regards
Chris

Typo in sample code of README.md

The sample code in README.md has typo. I figured it out after seeing IndexError.

from skge import HolE, StochasticTrainer

# Load knowledge graph 
# N = number of entities
# M = number of relations
# xs = list of (subject, object, predicte) triples
# ys = list of truth values for triples (1 = true, -1 = false)
N, M, xs, ys = load_data('path to data')

# instantiate HolE with an embedding space of size 100
model = HolE((N, N, M), 100)

The order of (N, N, M) must be (N, M, N).

model = HolE((N, M, N), 100)

Problem with the documentation in README?

@mnick Hi, thanks for publishing your code!

The example in the README says that the input for trainer should be composed of "xs = list of (subject, object, predicte) triples".

But when digging into the implementation, it seems that this is not correlated with what the HolE model is expecting to see in the data:

ss, ps, os, ys = unzip_triples(xys, with_ys=True)

and then:

return np.sum(self.R[ps] * ccorr(self.E[ss], self.E[os]), axis=1)

see here

This seems to indicate that the HolE model (and I think that also TransE) expects the triples to be ordered by (subject, predicate, object), i.e, switched order of predicate and object compared with the readme, right?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.