neuralogic

get_default_graphviz_path() str | None[source]

Get the default path to Graphviz

initial_seed() int[source]

Returns the initial/current random seed for a random number generator used in the backend.

initialize(debug_mode: bool = False, debug_port: int = 12999, is_debug_server: bool = True, debug_suspend: bool = True, *, seed: int | None = None, graphviz_path: str | None = None, max_memory_size: int | None = None, log_handler: LogHandler | None = None)[source]

Initialize the NeuraLogic backend. This function is called implicitly when needed and should be called manually only for debugging.

Parameters:
  • debug_mode (bool) – Enable/Disable JVM debug mode.

  • debug_port (int) – Port for the debugger to listen on. Default: 12999.

  • is_debug_server (bool) – Act like server and listen for the debugger. Default: True

  • debug_suspend (bool) – Wait until the debugger is connected. Default: True

  • seed (Optional[int]) – The seed for the random number generator.

  • graphviz_path (Optional[str]) – The Graphviz path

  • max_memory_size (Optional[int]) – The maximum memory size (in gigabytes)

  • log_handler (Optional[LogHandler]) – The handler for logging

is_initialized() bool[source]

Check whether the NeuraLogic backend has been initialized

manual_seed(seed: int)[source]

Sets the seed for a random number generator used in the backend to the passed seed.

Parameters:

seed (int) – The seed for the random number generator.

seed() int[source]

Sets the seed for a random number generator used in the backend to a random seed and returns the seed.

set_graphviz_path(path: str | None)[source]

Set the default path to Graphviz

Parameters:

path (Optional[str]) – The Graphviz path

set_jvm_options(options: List[str])[source]

Set the jvm options - by default ["-Xms1g"].

Parameters:

options (List[str]) – List of JVM options

set_jvm_path(path: str | None)[source]

Set the JVM path.

Parameters:

path (Optional[str]) – The JVM path

set_max_memory_size(size: int)[source]

Set maximum memory size that can be utilized by the backend (in gigabytes)

Parameters:

size (int) – The maximum memory size (in gigabytes)