2.1. pyke package

2.1.2. Submodules

2.1.3. pyke.dataset module

2.1.4. pyke.embedding module

2.1.5. pyke.library module

class pyke.library.Library[source]

Bases: object

Manages the connection to the library.

CPP_BASE = 'cpp_library/Base.cpp'
MAKE_SCRIPT = 'cpp_library/make.sh'
static compile_library(destination: str)[source]

Compile the library to the path destination.

Parameters:destination – path for the library
static get_library(temp_dir: str = None, library_name: str = None)[source]

Return the C++ library. The function compiles it if it doesn’t exist and it loads the library.

Parameters:
  • temp_dir – directory where the library is saved (optional)
  • library_name – filename of the library
Returns:

c++ library

library = None
library_name = 'pyke.so'
static load_library(path: str)[source]

Loads the library from path.

Parameters:path – path to the library (.so)
temp_dir = '.pyke'

2.1.6. pyke.norm module

pyke.norm.l1(vectors)[source]

Implements the l1 norm on a vectorspace.

Parameters vectors - Tensor of dimension at least one, returning vectors whose norm is to be computed.

Return Value Tensor of reduced dimension returning the norms. The order is preserved.

pyke.norm.l2(vectors)[source]

Implements the euclidean norm on a vectorspace.

Parameters vectors - Tensor of dimension at least one, returning vectors whose norm is to be computed.

Return Value Tensor of reduced dimension returning the norms. The order is preserved.

2.1.7. pyke.parser module

2.1.8. pyke.utils module

pyke.utils.get_array_pointer(a)[source]

Returns the address of the numpy array.

Parameters:a – Numpy array
Returns:Memory address of the array
pyke.utils.md5(filename: str)[source]

Returns the MD5-hashsum of a file.

Parameters:filename – Filename
Returns:MD5-hashsum of the file
pyke.utils.split_nt_line(line: str)[source]

Splits a line from a N-triples file into subject, predicate and object.

Parameters:line – Line from a N-triples file
Returns:tuple with subject, predicate, object

2.1.9. Module contents