/* Generated by Cython 3.0.12 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include/numpy/arrayobject.h",
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include/numpy/arrayscalars.h",
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include/numpy/ndarrayobject.h",
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include/numpy/ndarraytypes.h",
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include/numpy/ufuncobject.h"
        ],
        "include_dirs": [
            ".",
            "/Users/iyena/wheel_env/lib/python3.11/site-packages/numpy/core/include"
        ],
        "name": "nltkor.tag.libs.network",
        "sources": [
            "nltkor/tag/libs/network.pyx"
        ]
    },
    "module_name": "nltkor.tag.libs.network"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif
    

    #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x03000CF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_CheckExact(op)  PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;  (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__nltkor__tag__libs__network
#define __PYX_HAVE_API__nltkor__tag__libs__network
/* Early includes */
#include <string.h>
#include <stdio.h>

    /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
    
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"
#include <stddef.h>
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = (char) c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#include <string.h>
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "nltkor/tag/libs/network.pyx",
  "nltkor/tag/libs/networkconv.pyx",
  "__init__.cython-30.pxd",
  "contextvars.pxd",
  "<stringsource>",
  "nltkor/tag/libs/networkdependencyconv.pyx",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* #### Code section: numeric_typedefs ### */

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":730
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":737
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":744
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":754
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":758
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":765
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "nltkor/tag/libs/network.pyx":20
 * 
 * #ctypedef float FLOAT_t
 * ctypedef np.float_t FLOAT_t             # <<<<<<<<<<<<<<
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t
 */
typedef __pyx_t_5numpy_float_t __pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t;

/* "nltkor/tag/libs/network.pyx":22
 * ctypedef np.float_t FLOAT_t
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t             # <<<<<<<<<<<<<<
 * ctypedef np.double_t DOUBLE_t
 * 
 */
typedef __pyx_t_5numpy_int_t __pyx_t_6nltkor_3tag_4libs_7network_INT_t;

/* "nltkor/tag/libs/network.pyx":23
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t
 * ctypedef np.double_t DOUBLE_t             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
typedef __pyx_t_5numpy_double_t __pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_6nltkor_3tag_4libs_7network_Network;
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":769
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp;
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh;

/* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
 */
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp {
  int __pyx_n;
  PyObject *axis;
};

/* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
 */
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh {
  int __pyx_n;
  PyObject *inplace;
};

/* "nltkor/tag/libs/network.pyx":79
 * # ----------------------------------------------------------------------
 * 
 * cdef class Network:             # <<<<<<<<<<<<<<
 * 
 *     # sizes and learning rates
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network_Network {
  PyObject_HEAD
  int word_window_size;
  int input_size;
  int hidden_size;
  int output_size;
  float learning_rate;
  float learning_rate_features;
  float decay_factor;
  PyBoolObject *use_learning_rate_decay;
  int features_per_token;
  PyArrayObject *sentence_lookup;
  PyArrayObject *padding_left;
  PyArrayObject *padding_right;
  PyArrayObject *pre_padding;
  PyArrayObject *pos_padding;
  PyArrayObject *hidden_weights;
  PyArrayObject *output_weights;
  PyArrayObject *hidden_bias;
  PyArrayObject *output_bias;
  PyArrayObject *input_values;
  PyArrayObject *hidden_values;
  PyArrayObject *layer2_values;
  PyObject *feature_tables;
  float learning_rate_trans;
  PyArrayObject *transitions;
  float answer_score;
  PyArrayObject *net_gradients;
  PyArrayObject *trans_gradients;
  PyArrayObject *input_sent_values;
  PyArrayObject *hidden_sent_values;
  PyArrayObject *layer2_sent_values;
  float error;
  float accuracy;
  float float_errors;
  float sentence_accuracy;
  int num_tokens;
  int skips;
  PyObject *network_filename;
  PyObject *network_text_filename;
  PyObject *validation_sentences;
  PyObject *validation_tags;
};


/* "nltkor/tag/libs/networkconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalNetwork(Network):             # <<<<<<<<<<<<<<
 * 
 *     # transition and distance feature tables
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network __pyx_base;
  struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_vtab;
  PyArrayObject *target_dist_table;
  PyArrayObject *pred_dist_table;
  PyArrayObject *target_dist_weights;
  PyArrayObject *pred_dist_weights;
  int target_dist_offset;
  int pred_dist_offset;
  PyArrayObject *target_dist_lookup;
  PyArrayObject *pred_dist_lookup;
  PyArrayObject *target_convolution_lookup;
  PyArrayObject *pred_convolution_lookup;
  PyArrayObject *target_dist_deltas;
  PyArrayObject *pred_dist_deltas;
  int hidden2_size;
  PyArrayObject *hidden2_weights;
  PyArrayObject *hidden2_bias;
  PyArrayObject *hidden2_values;
  PyArrayObject *hidden2_before_activation;
  PyArrayObject *hidden_before_activation;
  PyArrayObject *convolution_lookup;
  PyArrayObject *max_indices;
  int num_targets;
  PyBoolObject *only_classify;
  int half_window;
  PyArrayObject *hidden_gradients;
  PyArrayObject *hidden2_gradients;
  PyArrayObject *input_deltas;
  int num_sentences;
  PyObject *validation_predicates;
  PyObject *validation_arguments;
};


/* "nltkor/tag/libs/networkdependencyconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalDependencyNetwork(ConvolutionalNetwork):             # <<<<<<<<<<<<<<
 * 
 *     # the weights of all possible dependency among tokens
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_base;
  PyArrayObject *dependency_weights;
  PyObject *validation_heads;
};


/* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_table;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_table;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
 */
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};



/* "nltkor/tag/libs/networkconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalNetwork(Network):             # <<<<<<<<<<<<<<
 * 
 *     # transition and distance feature tables
 */

struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork {
  PyArrayObject *(*argument_distances)(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;


/* "nltkor/tag/libs/networkdependencyconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalDependencyNetwork(ConvolutionalNetwork):             # <<<<<<<<<<<<<<
 * 
 *     # the weights of all possible dependency among tokens
 */

struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork {
  struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_base;
};
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* Profile.proto */
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
  #define CYTHON_PROFILE 0
#else
  #define CYTHON_PROFILE 1
#endif
#endif
#ifndef CYTHON_TRACE_NOGIL
  #define CYTHON_TRACE_NOGIL 0
#else
  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
    #define CYTHON_TRACE 1
  #endif
#endif
#ifndef CYTHON_TRACE
  #define CYTHON_TRACE 0
#endif
#if CYTHON_TRACE
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL(frame)
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
  #endif
  #define __Pyx_TraceDeclarations\
      static PyCodeObject *__pyx_frame_code = NULL;\
      CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
      int __Pyx_use_tracing = 0;
  #define __Pyx_TraceFrameInit(codeobj)\
      if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
#if PY_VERSION_HEX >= 0x030b00a2
  #if PY_VERSION_HEX >= 0x030C00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     ((!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #else
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #endif
  #define __Pyx_EnterTracing(tstate)  PyThreadState_EnterTracing(tstate)
  #define __Pyx_LeaveTracing(tstate)  PyThreadState_LeaveTracing(tstate)
#elif PY_VERSION_HEX >= 0x030a00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                 || tstate->c_profilefunc != NULL);\
      } while (0)
#else
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                         || tstate->c_profilefunc != NULL);\
      } while (0)
#endif
  #ifdef WITH_THREAD
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  if (nogil) {\
      if (CYTHON_TRACE_NOGIL) {\
          PyThreadState *tstate;\
          PyGILState_STATE state = PyGILState_Ensure();\
          tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 1, 1)) {\
              __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          }\
          PyGILState_Release(state);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  } else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (__Pyx_IsTracing(tstate, 1, 1)) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #else
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  {   PyThreadState* tstate = PyThreadState_GET();\
      if (__Pyx_IsTracing(tstate, 1, 1)) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #endif
  #define __Pyx_TraceException()\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 1)) {\
          __Pyx_EnterTracing(tstate);\
          PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
          if (exc_info) {\
              if (CYTHON_TRACE && tstate->c_tracefunc)\
                  tstate->c_tracefunc(\
                      tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              tstate->c_profilefunc(\
                  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              Py_DECREF(exc_info);\
          }\
          __Pyx_LeaveTracing(tstate);\
      }\
  }
  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
      PyObject *type, *value, *traceback;
      __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
      __Pyx_EnterTracing(tstate);
      if (CYTHON_TRACE && tstate->c_tracefunc)
          tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
      if (tstate->c_profilefunc)
          tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
      CYTHON_FRAME_DEL(frame);
      __Pyx_LeaveTracing(tstate);
      __Pyx_ErrRestoreInState(tstate, type, value, traceback);
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0)) {\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0)) {\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
          }\
      }\
  }
  #else
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 0)) {\
          __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
      }\
  }
  #endif
  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
#else
  #define __Pyx_TraceDeclarations
  #define __Pyx_TraceFrameInit(codeobj)
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)   if ((1)); else goto_error;
  #define __Pyx_TraceException()
  #define __Pyx_TraceReturn(result, nogil)
#endif
#if CYTHON_TRACE
  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
      int ret;
      PyObject *type, *value, *traceback;
      __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
      __Pyx_PyFrame_SetLineNumber(frame, lineno);
      __Pyx_EnterTracing(tstate);
      ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
      __Pyx_LeaveTracing(tstate);
      if (likely(!ret)) {
          __Pyx_ErrRestoreInState(tstate, type, value, traceback);
      } else {
          Py_XDECREF(type);
          Py_XDECREF(value);
          Py_XDECREF(traceback);
      }
      return ret;
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              int ret = 0;\
              PyThreadState *tstate;\
              PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
                  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              }\
              __Pyx_PyGILState_Release(state);\
              if (unlikely(ret)) goto_error;\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
              int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              if (unlikely(ret)) goto_error;\
          }\
      }\
  }
  #else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
          int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
          if (unlikely(ret)) goto_error;\
      }\
  }
  #endif
#else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)   if ((1)); else goto_error;
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#else
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
#endif
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
    #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
#else
    #define __Pyx_Arg_NewRef_VARARGS(arg) arg
    #define __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
    #define __Pyx_Arg_NewRef_FASTCALL(arg) arg  /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
                                                   to have the same reference counting */
    #define __Pyx_Arg_XDECREF_FASTCALL(arg)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
    #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
    #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

/* RaiseUnboundLocalError.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

/* PyIntCompare.proto */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* pybytes_as_double.proto */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
#endif

/* IterNext.proto */
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyIntCompare.proto */
static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?  PyFloat_AS_DOUBLE(obj) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12
#define __PYX_HAVE_RT_ImportType_proto_3_0_12
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_12 {
   __Pyx_ImportType_CheckSize_Error_3_0_12 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size);
#endif

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    typesModule = PyImport_ImportModule("types");
    if (!typesModule) return NULL;
    methodType = PyObject_GetAttrString(typesModule, "MethodType");
    Py_DECREF(typesModule);
    if (!methodType) return NULL;
    result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
    Py_DECREF(methodType);
    return result;
}
#elif PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* ClassMethod.proto */
#include "descrobject.h"
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
#endif

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CoroutineBase.proto */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);

/* CheckBinaryVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

/* #### Code section: module_declarations ### */
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
static PyArrayObject *__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_positions, PyObject *__pyx_v_argument); /* proto*/

/* Module declarations from "libc.string" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython.version" */

/* Module declarations from "cpython.exc" */

/* Module declarations from "cpython.module" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "cpython.tuple" */

/* Module declarations from "cpython.list" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.mapping" */

/* Module declarations from "cpython.iterator" */

/* Module declarations from "cpython.number" */

/* Module declarations from "cpython.int" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

/* Module declarations from "cpython.long" */

/* Module declarations from "cpython.float" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "cpython.string" */

/* Module declarations from "libc.stddef" */

/* Module declarations from "cpython.unicode" */

/* Module declarations from "cpython.pyport" */

/* Module declarations from "cpython.dict" */

/* Module declarations from "cpython.instance" */

/* Module declarations from "cpython.function" */

/* Module declarations from "cpython.method" */

/* Module declarations from "cpython.weakref" */

/* Module declarations from "cpython.getargs" */

/* Module declarations from "cpython.pythread" */

/* Module declarations from "cpython.pystate" */

/* Module declarations from "cpython.cobject" */

/* Module declarations from "cpython.oldbuffer" */

/* Module declarations from "cpython.set" */

/* Module declarations from "cpython.buffer" */

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.pycapsule" */

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "cpython.object" */

/* Module declarations from "cpython.ref" */

/* Module declarations from "numpy" */

/* Module declarations from "numpy" */

/* Module declarations from "cython" */

/* Module declarations from "nltkor.tag.libs.network" */
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_logsumexp(PyArrayObject *, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanh(PyArrayObject *, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *, PyObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t = { "FLOAT_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t = { "DOUBLE_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t = { "INT_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_INT_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_6nltkor_3tag_4libs_7network_INT_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_6nltkor_3tag_4libs_7network_INT_t), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "nltkor.tag.libs.network"
extern int __pyx_module_is_main_nltkor__tag__libs__network;
int __pyx_module_is_main_nltkor__tag__libs__network = 0;

/* Implementation of "nltkor.tag.libs.network" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_FloatingPointError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ImportError;
/* #### Code section: string_decls ### */
static const char __pyx_k_T[] = "T";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_x[] = "x";
static const char __pyx_k__5[] = ", ";
static const char __pyx_k__6[] = "\n";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_nn[] = "nn";
static const char __pyx_k_np[] = "np";
static const char __pyx_k__23[] = "   ";
static const char __pyx_k__76[] = "    ";
static const char __pyx_k__86[] = ".";
static const char __pyx_k__91[] = "*";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_net[] = "net";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_tag[] = "tag";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k__161[] = "?";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_axis[] = "axis";
static const char __pyx_k_clip[] = "clip";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_head[] = "head";
static const char __pyx_k_high[] = "high";
static const char __pyx_k_hits[] = "hits";
static const char __pyx_k_inds[] = "inds";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_less[] = "less";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sent[] = "sent";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_tags[] = "tags";
static const char __pyx_k_take[] = "take";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tile[] = "tile";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_cycle[] = "cycle";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_epoch[] = "epoch";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_graph[] = "graph";
static const char __pyx_k_heads[] = "heads";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_ravel[] = "ravel";
static const char __pyx_k_savez[] = "savez";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_shift[] = "shift";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_token[] = "token";
static const char __pyx_k_train[] = "train";
static const char __pyx_k_trans[] = "trans";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_Logger[] = "Logger";
static const char __pyx_k_answer[] = "answer";
static const char __pyx_k_arange[] = "arange";
static const char __pyx_k_argmax[] = "argmax";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_counts[] = "counts";
static const char __pyx_k_cycles[] = "cycles";
static const char __pyx_k_dCdf_2[] = "dCdf_2";
static const char __pyx_k_dCdf_3[] = "dCdf_3";
static const char __pyx_k_deltas[] = "deltas";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_epochs[] = "epochs";
static const char __pyx_k_factor[] = "factor";
static const char __pyx_k_i_args[] = "i_args";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_ind_to[] = "ind_to";
static const char __pyx_k_labels[] = "labels";
static const char __pyx_k_logadd[] = "logadd";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_scores[] = "scores";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_vertex[] = "vertex";
static const char __pyx_k_vstack[] = "vstack";
static const char __pyx_k_window[] = "window";
static const char __pyx_k_xrange[] = "xrange";
static const char __pyx_k_Network[] = "Network";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_exp_sum[] = "exp_sum";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_greater[] = "greater";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_logprob[] = "logprob";
static const char __pyx_k_net_tag[] = "net_tag";
static const char __pyx_k_outside[] = "outside";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_shuffle[] = "shuffle";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_visited[] = "visited";
static const char __pyx_k_viterbi[] = "_viterbi";
static const char __pyx_k_Accuracy[] = "   Accuracy: ";
static const char __pyx_k_Infinity[] = "Infinity";
static const char __pyx_k_argument[] = "argument";
static const char __pyx_k_bincount[] = "bincount";
static const char __pyx_k_dCd_tanh[] = "dCd_tanh";
static const char __pyx_k_diagonal[] = "diagonal";
static const char __pyx_k_features[] = "features";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_gold_tag[] = "gold_tag";
static const char __pyx_k_ind_from[] = "ind_from";
static const char __pyx_k_last_tag[] = "last_tag";
static const char __pyx_k_logprobs[] = "logprobs";
static const char __pyx_k_new_data[] = "new_data";
static const char __pyx_k_new_head[] = "new_head";
static const char __pyx_k_num_dims[] = "num_dims";
static const char __pyx_k_old_head[] = "old_head";
static const char __pyx_k_pos_dist[] = "pos_dist";
static const char __pyx_k_pre_dist[] = "pre_dist";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_rollaxis[] = "rollaxis";
static const char __pyx_k_sentence[] = "sentence";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_training[] = "training";
static const char __pyx_k_validate[] = "_validate";
static const char __pyx_k_w_deltas[] = "w_deltas";
static const char __pyx_k_arguments[] = "arguments";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_get_state[] = "get_state";
static const char __pyx_k_gold_head[] = "gold_head";
static const char __pyx_k_gold_tags[] = "gold_tags";
static const char __pyx_k_gradients[] = "gradients";
static const char __pyx_k_head_to_v[] = "head_to_v";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_new_shape[] = "new_shape";
static const char __pyx_k_num_items[] = "num_items";
static const char __pyx_k_pred_tags[] = "pred_tags";
static const char __pyx_k_predicate[] = "predicate";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reachable[] = "reachable";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_sent_args[] = "sent_args";
static const char __pyx_k_sent_tags[] = "sent_tags";
static const char __pyx_k_sentences[] = "sentences";
static const char __pyx_k_set_state[] = "set_state";
static const char __pyx_k_sumlogadd[] = "sumlogadd";
static const char __pyx_k_window_to[] = "window_to";
static const char __pyx_k_all_scores[] = "all_scores";
static const char __pyx_k_confidence[] = "confidence";
static const char __pyx_k_correction[] = "correction";
static const char __pyx_k_create_new[] = "create_new";
static const char __pyx_k_cycle_inds[] = "cycle_inds";
static const char __pyx_k_embeddings[] = "embeddings";
static const char __pyx_k_empty_like[] = "empty_like";
static const char __pyx_k_exp_scores[] = "exp_scores";
static const char __pyx_k_input_data[] = "input_data";
static const char __pyx_k_input_size[] = "input_size";
static const char __pyx_k_last_error[] = "last_error";
static const char __pyx_k_last_token[] = "last_token";
static const char __pyx_k_net_scores[] = "net_scores";
static const char __pyx_k_num_tokens[] = "num_tokens";
static const char __pyx_k_other_args[] = "other_args";
static const char __pyx_k_output_dim[] = "output_dim";
static const char __pyx_k_pos_deltas[] = "pos_deltas";
static const char __pyx_k_pre_deltas[] = "pre_deltas";
static const char __pyx_k_pred_dists[] = "pred_dists";
static const char __pyx_k_predicates[] = "predicates";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_sent_preds[] = "sent_preds";
static const char __pyx_k_start_from[] = "start_from";
static const char __pyx_k_table_dims[] = "table_dims";
static const char __pyx_k_tag_scores[] = "tag_scores";
static const char __pyx_k_zeros_like[] = "zeros_like";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Output_size[] = "\nOutput size: ";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_Saved_model[] = "Saved model";
static const char __pyx_k_best_scores[] = "best_scores";
static const char __pyx_k_concatenate[] = "concatenate";
static const char __pyx_k_cycle_score[] = "cycle_score";
static const char __pyx_k_dCd_hidden2[] = "dCd_hidden2";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_dist_deltas[] = "dist_deltas";
static const char __pyx_k_find_cycles[] = "_find_cycles";
static const char __pyx_k_grad_matrix[] = "grad_matrix";
static const char __pyx_k_gradients_t[] = "gradients_t";
static const char __pyx_k_hidden_bias[] = "hidden_bias";
static const char __pyx_k_hidden_size[] = "hidden_size";
static const char __pyx_k_last_values[] = "last_values";
static const char __pyx_k_logical_and[] = "logical_and";
static const char __pyx_k_logical_not[] = "logical_not";
static const char __pyx_k_next_vertex[] = "next_vertex";
static const char __pyx_k_output_bias[] = "output_bias";
static const char __pyx_k_output_size[] = "output_size";
static const char __pyx_k_path_scores[] = "path_scores";
static const char __pyx_k_pos_padding[] = "pos_padding";
static const char __pyx_k_pre_padding[] = "pre_padding";
static const char __pyx_k_pred_answer[] = "pred_answer";
static const char __pyx_k_train_epoch[] = "_train_epoch";
static const char __pyx_k_transitions[] = "transitions";
static const char __pyx_k_unreachable[] = "unreachable";
static const char __pyx_k_window_from[] = "window_from";
static const char __pyx_k_word_window[] = "word_window";
static const char __pyx_k_Network_save[] = "Network.save";
static const char __pyx_k_allow_pickle[] = "allow_pickle";
static const char __pyx_k_decay_factor[] = "decay_factor";
static const char __pyx_k_epochs_Error[] = " epochs   Error: ";
static const char __pyx_k_exponentials[] = "exponentials";
static const char __pyx_k_hidden1_bias[] = "hidden1_bias";
static const char __pyx_k_hidden1_size[] = "hidden1_size";
static const char __pyx_k_hidden2_bias[] = "hidden2_bias";
static const char __pyx_k_hidden2_size[] = "hidden2_size";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_input_deltas[] = "input_deltas";
static const char __pyx_k_input_values[] = "input_values";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_neuron_maxes[] = "neuron_maxes";
static const char __pyx_k_new_head_ind[] = "new_head_ind";
static const char __pyx_k_num_vertices[] = "num_vertices";
static const char __pyx_k_output_range[] = "output_range";
static const char __pyx_k_outside_inds[] = "outside_inds";
static const char __pyx_k_padding_left[] = "padding_left";
static const char __pyx_k_previous_tag[] = "previous_tag";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_random_state[] = "random_state";
static const char __pyx_k_sentence_hit[] = "sentence_hit";
static const char __pyx_k_shuffle_data[] = "_shuffle_data";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_table_deltas[] = "table_deltas";
static const char __pyx_k_tag_sentence[] = "_tag_sentence";
static const char __pyx_k_target_dists[] = "target_dists";
static const char __pyx_k_token_scores[] = "token_scores";
static const char __pyx_k_top_accuracy[] = "top_accuracy";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_Network_train[] = "Network.train";
static const char __pyx_k_allow_repeats[] = "allow_repeats";
static const char __pyx_k_average_error[] = "_average_error";
static const char __pyx_k_backpropagate[] = "_backpropagate";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_count_nonzero[] = "count_nonzero";
static const char __pyx_k_delta_softmax[] = "delta_softmax";
static const char __pyx_k_dist_features[] = "dist_features";
static const char __pyx_k_fill_diagonal[] = "fill_diagonal";
static const char __pyx_k_hidden_deltas[] = "hidden_deltas";
static const char __pyx_k_last_accuracy[] = "last_accuracy";
static const char __pyx_k_num_distances[] = "num_distances";
static const char __pyx_k_output_deltas[] = "output_deltas";
static const char __pyx_k_padding_right[] = "padding_right";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_sentence_hits[] = "sentence_hits";
static const char __pyx_k_token_indices[] = "token_indices";
static const char __pyx_k_transitions_t[] = "transitions_t";
static const char __pyx_k_Token_accuracy[] = "   Token accuracy: ";
static const char __pyx_k_adjust_weights[] = "_adjust_weights";
static const char __pyx_k_column_numbers[] = "column_numbers";
static const char __pyx_k_contract_cycle[] = "_contract_cycle";
static const char __pyx_k_dist_pred_from[] = "dist_pred_from";
static const char __pyx_k_feature_tables[] = "feature_tables";
static const char __pyx_k_hidden_weights[] = "hidden_weights";
static const char __pyx_k_load_from_file[] = "_load_from_file";
static const char __pyx_k_log_sum_scores[] = "log_sum_scores";
static const char __pyx_k_output_weights[] = "output_weights";
static const char __pyx_k_path_backtrack[] = "path_backtrack";
static const char __pyx_k_pred_arguments[] = "pred_arguments";
static const char __pyx_k_predicate_tags[] = "predicate_tags";
static const char __pyx_k_reset_counters[] = "_reset_counters";
static const char __pyx_k_tag_sentence_2[] = "tag_sentence";
static const char __pyx_k_adjust_features[] = "_adjust_features";
static const char __pyx_k_argument_blocks[] = "argument_blocks";
static const char __pyx_k_calculate_delta[] = "_calculate_delta";
static const char __pyx_k_conflicting_tag[] = "conflicting_tag";
static const char __pyx_k_convolution_max[] = "convolution_max";
static const char __pyx_k_dist_table_dims[] = "dist_table_dims";
static const char __pyx_k_hidden1_weights[] = "hidden1_weights";
static const char __pyx_k_hidden2_weights[] = "hidden2_weights";
static const char __pyx_k_input_gradients[] = "input_gradients";
static const char __pyx_k_load_parameters[] = "_load_parameters";
static const char __pyx_k_padded_sentence[] = "padded_sentence";
static const char __pyx_k_pred_dist_table[] = "pred_dist_table";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_validation_tags[] = "validation_tags";
static const char __pyx_k_Input_layer_size[] = "\nInput layer size: ";
static const char __pyx_k_Network__viterbi[] = "Network._viterbi";
static const char __pyx_k_Word_window_size[] = "\nWord window size: ";
static const char __pyx_k_desired_accuracy[] = "desired_accuracy";
static const char __pyx_k_dist_target_from[] = "dist_target_from";
static const char __pyx_k_hidden_gradients[] = "hidden_gradients";
static const char __pyx_k_highest_prob_arg[] = "highest_prob_arg";
static const char __pyx_k_incoming_weights[] = "incoming_weights";
static const char __pyx_k_load_from_file_2[] = "load_from_file";
static const char __pyx_k_network_filename[] = "network_filename";
static const char __pyx_k_outgoing_weights[] = "outgoing_weights";
static const char __pyx_k_pred_dist_values[] = "pred_dist_values";
static const char __pyx_k_predicate_answer[] = "predicate_answer";
static const char __pyx_k_word_window_size[] = "word_window_size";
static const char __pyx_k_Hidden_layer_size[] = "\nHidden layer size: ";
static const char __pyx_k_Network__validate[] = "Network._validate";
static const char __pyx_k_Sentence_accuracy[] = "   Sentence accuracy: ";
static const char __pyx_k_conflicting_probs[] = "conflicting_probs";
static const char __pyx_k_max_incoming_inds[] = "max_incoming_inds";
static const char __pyx_k_max_outgoing_inds[] = "max_outgoing_inds";
static const char __pyx_k_num_dist_features[] = "num_dist_features";
static const char __pyx_k_pre_tagging_setup[] = "_pre_tagging_setup";
static const char __pyx_k_pred_dist_indices[] = "pred_dist_indices";
static const char __pyx_k_pred_dist_weights[] = "pred_dist_weights";
static const char __pyx_k_target_dist_table[] = "target_dist_table";
static const char __pyx_k_FloatingPointError[] = "FloatingPointError";
static const char __pyx_k_Network_create_new[] = "Network.create_new";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_convolution_values[] = "convolution_values";
static const char __pyx_k_correct_path_score[] = "correct_path_score";
static const char __pyx_k_create_pred_lookup[] = "_create_pred_lookup";
static const char __pyx_k_generate_save_dict[] = "_generate_save_dict";
static const char __pyx_k_grad_times_softmax[] = "grad_times_softmax";
static const char __pyx_k_hidden_bias_deltas[] = "hidden_bias_deltas";
static const char __pyx_k_output_bias_deltas[] = "output_bias_deltas";
static const char __pyx_k_print_epoch_report[] = "_print_epoch_report";
static const char __pyx_k_reachable_vertices[] = "reachable_vertices";
static const char __pyx_k_target_dist_values[] = "target_dist_values";
static const char __pyx_k_vertices_in_cycles[] = "vertices_in_cycles";
static const char __pyx_k_Feature_table_sizes[] = "\nFeature table sizes: ";
static const char __pyx_k_Network_description[] = "Network.description";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_calculate_gradients[] = "_calculate_gradients";
static const char __pyx_k_pred_dist_gradients[] = "pred_dist_gradients";
static const char __pyx_k_set_validation_data[] = "set_validation_data";
static const char __pyx_k_target_dist_indices[] = "target_dist_indices";
static const char __pyx_k_target_dist_weights[] = "target_dist_weights";
static const char __pyx_k_ConvolutionalNetwork[] = "ConvolutionalNetwork";
static const char __pyx_k_Network__train_epoch[] = "Network._train_epoch";
static const char __pyx_k_Network_tag_sentence[] = "Network.tag_sentence";
static const char __pyx_k_calculate_all_scores[] = "_calculate_all_scores";
static const char __pyx_k_create_target_lookup[] = "_create_target_lookup";
static const char __pyx_k_find_cycle_recursive[] = "_find_cycle_recursive";
static const char __pyx_k_max_incoming_weights[] = "max_incoming_weights";
static const char __pyx_k_max_outgoing_weights[] = "max_outgoing_weights";
static const char __pyx_k_prev_score_and_trans[] = "prev_score_and_trans";
static const char __pyx_k_pyx_unpickle_Network[] = "__pyx_unpickle_Network";
static const char __pyx_k_sentence_convolution[] = "_sentence_convolution";
static const char __pyx_k_train_locals_genexpr[] = "train.<locals>.genexpr";
static const char __pyx_k_validation_arguments[] = "validation_arguments";
static const char __pyx_k_validation_sentences[] = "validation_sentences";
static const char __pyx_k_vertex_leaving_cycle[] = "vertex_leaving_cycle";
static const char __pyx_k_Network__tag_sentence[] = "Network._tag_sentence";
static const char __pyx_k_target_dist_gradients[] = "target_dist_gradients";
static const char __pyx_k_validation_predicates[] = "validation_predicates";
static const char __pyx_k_Convolution_layer_size[] = "\nConvolution layer size: ";
static const char __pyx_k_Network__backpropagate[] = "Network._backpropagate";
static const char __pyx_k_Network_load_from_file[] = "Network.load_from_file";
static const char __pyx_k_calculate_input_deltas[] = "_calculate_input_deltas";
static const char __pyx_k_create_sentence_lookup[] = "_create_sentence_lookup";
static const char __pyx_k_epochs_between_reports[] = "epochs_between_reports";
static const char __pyx_k_Network___reduce_cython[] = "Network.__reduce_cython__";
static const char __pyx_k_calculate_gradients_sll[] = "_calculate_gradients_sll";
static const char __pyx_k_calculate_gradients_wll[] = "_calculate_gradients_wll";
static const char __pyx_k_decrease_learning_rates[] = "decrease_learning_rates";
static const char __pyx_k_dist_features_per_token[] = "dist_features_per_token";
static const char __pyx_k_nltkor_tag_libs_network[] = "nltkor.tag.libs.network";
static const char __pyx_k_set_learning_rate_decay[] = "set_learning_rate_decay";
static const char __pyx_k_validate_locals_genexpr[] = "_validate.<locals>.genexpr";
static const char __pyx_k_Network__calculate_delta[] = "Network._calculate_delta";
static const char __pyx_k_Network__load_parameters[] = "Network._load_parameters";
static const char __pyx_k_Second_hidden_layer_size[] = " \nSecond hidden layer size: ";
static const char __pyx_k_input_size_with_distance[] = "input_size_with_distance";
static const char __pyx_k_vertex_leaving_cycle_ind[] = "vertex_leaving_cycle_ind";
static const char __pyx_k_ConvolutionalNetwork_save[] = "ConvolutionalNetwork.save";
static const char __pyx_k_Network___setstate_cython[] = "Network.__setstate_cython__";
static const char __pyx_k_create_convolution_lookup[] = "_create_convolution_lookup";
static const char __pyx_k_create_new_locals_genexpr[] = "create_new.<locals>.genexpr";
static const char __pyx_k_ConvolutionalNetwork_train[] = "ConvolutionalNetwork.train";
static const char __pyx_k_find_maximum_spanning_tree[] = "_find_maximum_spanning_tree";
static const char __pyx_k_input_and_pred_dist_values[] = "input_and_pred_dist_values";
static const char __pyx_k_Network__print_epoch_report[] = "Network._print_epoch_report";
static const char __pyx_k_Network_set_validation_data[] = "Network.set_validation_data";
static const char __pyx_k_Training_for_up_to_d_epochs[] = "Training for up to %d epochs";
static const char __pyx_k_nltkor_tag_libs_network_pyx[] = "nltkor/tag/libs/network.pyx";
static const char __pyx_k_calculate_gradients_classify[] = "_calculate_gradients_classify";
static const char __pyx_k_ConvolutionalNetwork__viterbi[] = "ConvolutionalNetwork._viterbi";
static const char __pyx_k_ConvolutionalDependencyNetwork[] = "ConvolutionalDependencyNetwork";
static const char __pyx_k_ConvolutionalNetwork__validate[] = "ConvolutionalNetwork._validate";
static const char __pyx_k_pyx_unpickle_ConvolutionalDepe[] = "__pyx_unpickle_ConvolutionalDependencyNetwork";
static const char __pyx_k_pyx_unpickle_ConvolutionalNetw[] = "__pyx_unpickle_ConvolutionalNetwork";
static const char __pyx_k_A_neural_network_for_NLP_taggin[] = "\nA neural network for NLP tagging tasks.\nIt employs feature tables to store feature vectors for each token.\n";
static const char __pyx_k_ConvolutionalNetwork___setstate[] = "ConvolutionalNetwork.__setstate_cython__";
static const char __pyx_k_ConvolutionalNetwork__calculate[] = "ConvolutionalNetwork._calculate_gradients";
static const char __pyx_k_ConvolutionalNetwork__load_from[] = "ConvolutionalNetwork._load_from_file";
static const char __pyx_k_ConvolutionalNetwork_create_new[] = "ConvolutionalNetwork.create_new";
static const char __pyx_k_Distance_table_sizes_target_and[] = "\nDistance table sizes (target and predicate): ";
static const char __pyx_k_Network__create_sentence_lookup[] = "Network._create_sentence_lookup";
static const char __pyx_k_Network_decrease_learning_rates[] = "Network.decrease_learning_rates";
static const char __pyx_k_Network_set_learning_rate_decay[] = "Network.set_learning_rate_decay";
static const char __pyx_k_corrections_skipped_Learning_ra[] = " corrections skipped   Learning rate: ";
static const char __pyx_k_corrections_skipped_learning_ra[] = " corrections skipped   learning rate: ";
static const char __pyx_k_nltkor_tag_libs_networkconv_pyx[] = "nltkor/tag/libs/networkconv.pyx";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_tag_sentence_labeled_dependency[] = "_tag_sentence_labeled_dependency";
static const char __pyx_k_tag_sentence_unlabeled_dependen[] = "_tag_sentence_unlabeled_dependency";
static const char __pyx_k_Confidence_measure_not_implement[] = "Confidence measure not implemented for argument classifying";
static const char __pyx_k_ConvolutionalDependencyNetwork_2[] = "ConvolutionalDependencyNetwork._tag_sentence";
static const char __pyx_k_ConvolutionalDependencyNetwork_3[] = "ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency";
static const char __pyx_k_ConvolutionalDependencyNetwork_4[] = "ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency";
static const char __pyx_k_ConvolutionalDependencyNetwork_5[] = "ConvolutionalDependencyNetwork._calculate_gradients";
static const char __pyx_k_ConvolutionalDependencyNetwork_6[] = "ConvolutionalDependencyNetwork._validate";
static const char __pyx_k_ConvolutionalDependencyNetwork_7[] = "ConvolutionalDependencyNetwork._average_error";
static const char __pyx_k_ConvolutionalDependencyNetwork_8[] = "ConvolutionalDependencyNetwork._print_epoch_report";
static const char __pyx_k_ConvolutionalDependencyNetwork_9[] = "ConvolutionalDependencyNetwork._find_cycles";
static const char __pyx_k_ConvolutionalDependencyNetwork_l[] = "ConvolutionalDependencyNetwork.load_from_file";
static const char __pyx_k_ConvolutionalDependencyNetwork_s[] = "ConvolutionalDependencyNetwork.save";
static const char __pyx_k_ConvolutionalDependencyNetwork_t[] = "ConvolutionalDependencyNetwork.train";
static const char __pyx_k_ConvolutionalNetwork___reduce_cy[] = "ConvolutionalNetwork.__reduce_cython__";
static const char __pyx_k_ConvolutionalNetwork__adjust_fea[] = "ConvolutionalNetwork._adjust_features";
static const char __pyx_k_ConvolutionalNetwork__adjust_wei[] = "ConvolutionalNetwork._adjust_weights";
static const char __pyx_k_ConvolutionalNetwork__backpropag[] = "ConvolutionalNetwork._backpropagate";
static const char __pyx_k_ConvolutionalNetwork__create_con[] = "ConvolutionalNetwork._create_convolution_lookup";
static const char __pyx_k_ConvolutionalNetwork__create_pre[] = "ConvolutionalNetwork._create_pred_lookup";
static const char __pyx_k_ConvolutionalNetwork__create_tar[] = "ConvolutionalNetwork._create_target_lookup";
static const char __pyx_k_ConvolutionalNetwork__generate_s[] = "ConvolutionalNetwork._generate_save_dict";
static const char __pyx_k_ConvolutionalNetwork__load_param[] = "ConvolutionalNetwork._load_parameters";
static const char __pyx_k_ConvolutionalNetwork__pre_taggin[] = "ConvolutionalNetwork._pre_tagging_setup";
static const char __pyx_k_ConvolutionalNetwork__reset_coun[] = "ConvolutionalNetwork._reset_counters";
static const char __pyx_k_ConvolutionalNetwork__sentence_c[] = "ConvolutionalNetwork._sentence_convolution";
static const char __pyx_k_ConvolutionalNetwork__shuffle_da[] = "ConvolutionalNetwork._shuffle_data";
static const char __pyx_k_ConvolutionalNetwork__tag_senten[] = "ConvolutionalNetwork._tag_sentence";
static const char __pyx_k_ConvolutionalNetwork__train_epoc[] = "ConvolutionalNetwork._train_epoch";
static const char __pyx_k_ConvolutionalNetwork_description[] = "ConvolutionalNetwork.description";
static const char __pyx_k_ConvolutionalNetwork_load_from_f[] = "ConvolutionalNetwork.load_from_file";
static const char __pyx_k_ConvolutionalNetwork_set_validat[] = "ConvolutionalNetwork.set_validation_data";
static const char __pyx_k_ConvolutionalNetwork_tag_sentenc[] = "ConvolutionalNetwork.tag_sentence";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))";
static const char __pyx_k_Network__calculate_gradients_sll[] = "Network._calculate_gradients_sll";
static const char __pyx_k_Network__calculate_gradients_wll[] = "Network._calculate_gradients_wll";
static const char __pyx_k_nltkor_tag_libs_networkdependenc[] = "nltkor/tag/libs/networkdependencyconv.pyx";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_ConvolutionalDependencyNetwork_10[] = "ConvolutionalDependencyNetwork._find_cycle_recursive";
static const char __pyx_k_ConvolutionalDependencyNetwork_11[] = "ConvolutionalDependencyNetwork._contract_cycle";
static const char __pyx_k_ConvolutionalDependencyNetwork_12[] = "ConvolutionalDependencyNetwork._find_maximum_spanning_tree";
static const char __pyx_k_ConvolutionalDependencyNetwork_13[] = "ConvolutionalDependencyNetwork.__reduce_cython__";
static const char __pyx_k_ConvolutionalDependencyNetwork_14[] = "ConvolutionalDependencyNetwork.__setstate_cython__";
static const char __pyx_k_ConvolutionalNetwork__calculate_2[] = "ConvolutionalNetwork._calculate_gradients_classify";
static const char __pyx_k_ConvolutionalNetwork__calculate_3[] = "ConvolutionalNetwork._calculate_input_deltas";
static const char __pyx_k_ConvolutionalDependencyNetwork_s_2[] = "ConvolutionalDependencyNetwork.set_validation_data";
static const char __pyx_k_ConvolutionalDependencyNetwork_t_2[] = "ConvolutionalDependencyNetwork.tag_sentence";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_3[] = "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, int __pyx_v_word_window, int __pyx_v_hidden_size, int __pyx_v_output_size); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden_weights, PyObject *__pyx_v_hidden_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias, PyObject *__pyx_v_transitions); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_left); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_right); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyObject *__pyx_v_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, float __pyx_v_decay_factor); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_epoch); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, int __pyx_v_num); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, PyObject *__pyx_v_target_dist_table, PyObject *__pyx_v_pred_dist_table, int __pyx_v_word_window, int __pyx_v_hidden1_size, int __pyx_v_hidden2_size, int __pyx_v_output_size); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden1_size, PyObject *__pyx_v_hidden2_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden1_weights, PyObject *__pyx_v_hidden1_bias, PyObject *__pyx_v_target_dist_weights, PyObject *__pyx_v_pred_dist_weights, PyObject *__pyx_v_hidden2_weights, PyObject *__pyx_v_hidden2_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_predicates, PyObject *__pyx_v_validation_tags, PyObject *__pyx_v_validation_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_arguments, PyBoolObject *__pyx_v_logprob, PyBoolObject *__pyx_v_allow_repeats); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_predicate, PyObject *__pyx_v_argument_blocks, PyObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyBoolObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_argument_blocks, PyBoolObject *__pyx_v_allow_repeats, PyBoolObject *__pyx_v_logprob); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, int __pyx_v_predicate, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicate); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_scores, PyBoolObject *__pyx_v_allow_repeats); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicates, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_gold_head, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, int __pyx_v_num); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph, int __pyx_v_vertex, PyObject *__pyx_v_visited, PyObject *__pyx_v_reachable, PyObject *__pyx_v_unreachable); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_heads, PyObject *__pyx_v_cycle); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_Network(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, 0, 0, 0, 0};
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_Network;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  #endif
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_Network;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  PyObject *__pyx_kp_u_Accuracy;
  PyObject *__pyx_kp_u_Confidence_measure_not_implement;
  PyObject *__pyx_kp_u_Convolution_layer_size;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_10;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_11;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_12;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_13;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_14;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_2;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_3;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_4;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_5;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_6;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_7;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_8;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_9;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_l;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_s;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_s_2;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_t;
  PyObject *__pyx_n_s_ConvolutionalDependencyNetwork_t_2;
  PyObject *__pyx_n_s_ConvolutionalNetwork;
  PyObject *__pyx_n_s_ConvolutionalNetwork___reduce_cy;
  PyObject *__pyx_n_s_ConvolutionalNetwork___setstate;
  PyObject *__pyx_n_s_ConvolutionalNetwork__adjust_fea;
  PyObject *__pyx_n_s_ConvolutionalNetwork__adjust_wei;
  PyObject *__pyx_n_s_ConvolutionalNetwork__backpropag;
  PyObject *__pyx_n_s_ConvolutionalNetwork__calculate;
  PyObject *__pyx_n_s_ConvolutionalNetwork__calculate_2;
  PyObject *__pyx_n_s_ConvolutionalNetwork__calculate_3;
  PyObject *__pyx_n_s_ConvolutionalNetwork__create_con;
  PyObject *__pyx_n_s_ConvolutionalNetwork__create_pre;
  PyObject *__pyx_n_s_ConvolutionalNetwork__create_tar;
  PyObject *__pyx_n_s_ConvolutionalNetwork__generate_s;
  PyObject *__pyx_n_s_ConvolutionalNetwork__load_from;
  PyObject *__pyx_n_s_ConvolutionalNetwork__load_param;
  PyObject *__pyx_n_s_ConvolutionalNetwork__pre_taggin;
  PyObject *__pyx_n_s_ConvolutionalNetwork__reset_coun;
  PyObject *__pyx_n_s_ConvolutionalNetwork__sentence_c;
  PyObject *__pyx_n_s_ConvolutionalNetwork__shuffle_da;
  PyObject *__pyx_n_s_ConvolutionalNetwork__tag_senten;
  PyObject *__pyx_n_s_ConvolutionalNetwork__train_epoc;
  PyObject *__pyx_n_s_ConvolutionalNetwork__validate;
  PyObject *__pyx_n_s_ConvolutionalNetwork__viterbi;
  PyObject *__pyx_n_s_ConvolutionalNetwork_create_new;
  PyObject *__pyx_n_s_ConvolutionalNetwork_description;
  PyObject *__pyx_n_s_ConvolutionalNetwork_load_from_f;
  PyObject *__pyx_n_s_ConvolutionalNetwork_save;
  PyObject *__pyx_n_s_ConvolutionalNetwork_set_validat;
  PyObject *__pyx_n_s_ConvolutionalNetwork_tag_sentenc;
  PyObject *__pyx_n_s_ConvolutionalNetwork_train;
  PyObject *__pyx_kp_u_Distance_table_sizes_target_and;
  PyObject *__pyx_kp_u_Feature_table_sizes;
  PyObject *__pyx_n_s_FloatingPointError;
  PyObject *__pyx_kp_u_Hidden_layer_size;
  PyObject *__pyx_n_s_ImportError;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3;
  PyObject *__pyx_n_s_Infinity;
  PyObject *__pyx_kp_u_Input_layer_size;
  PyObject *__pyx_n_u_Logger;
  PyObject *__pyx_n_s_Network;
  PyObject *__pyx_n_s_Network___reduce_cython;
  PyObject *__pyx_n_s_Network___setstate_cython;
  PyObject *__pyx_n_s_Network__backpropagate;
  PyObject *__pyx_n_s_Network__calculate_delta;
  PyObject *__pyx_n_s_Network__calculate_gradients_sll;
  PyObject *__pyx_n_s_Network__calculate_gradients_wll;
  PyObject *__pyx_n_s_Network__create_sentence_lookup;
  PyObject *__pyx_n_s_Network__load_parameters;
  PyObject *__pyx_n_s_Network__print_epoch_report;
  PyObject *__pyx_n_s_Network__tag_sentence;
  PyObject *__pyx_n_s_Network__train_epoch;
  PyObject *__pyx_n_s_Network__validate;
  PyObject *__pyx_n_s_Network__viterbi;
  PyObject *__pyx_n_s_Network_create_new;
  PyObject *__pyx_n_s_Network_decrease_learning_rates;
  PyObject *__pyx_n_s_Network_description;
  PyObject *__pyx_n_s_Network_load_from_file;
  PyObject *__pyx_n_s_Network_save;
  PyObject *__pyx_n_s_Network_set_learning_rate_decay;
  PyObject *__pyx_n_s_Network_set_validation_data;
  PyObject *__pyx_n_s_Network_tag_sentence;
  PyObject *__pyx_n_s_Network_train;
  PyObject *__pyx_n_s_NotImplementedError;
  PyObject *__pyx_kp_u_Output_size;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_kp_u_Saved_model;
  PyObject *__pyx_kp_u_Second_hidden_layer_size;
  PyObject *__pyx_kp_u_Sentence_accuracy;
  PyObject *__pyx_n_s_T;
  PyObject *__pyx_kp_u_Token_accuracy;
  PyObject *__pyx_kp_u_Training_for_up_to_d_epochs;
  PyObject *__pyx_kp_u_Word_window_size;
  PyObject *__pyx_n_s__161;
  PyObject *__pyx_kp_u__23;
  PyObject *__pyx_kp_u__5;
  PyObject *__pyx_kp_u__6;
  PyObject *__pyx_kp_u__76;
  PyObject *__pyx_kp_u__86;
  PyObject *__pyx_n_s__91;
  PyObject *__pyx_n_s_add;
  PyObject *__pyx_n_s_adjust_features;
  PyObject *__pyx_n_s_adjust_weights;
  PyObject *__pyx_n_s_all_scores;
  PyObject *__pyx_n_s_allow_pickle;
  PyObject *__pyx_n_s_allow_repeats;
  PyObject *__pyx_n_s_answer;
  PyObject *__pyx_n_s_arange;
  PyObject *__pyx_n_s_argmax;
  PyObject *__pyx_n_s_args;
  PyObject *__pyx_n_s_argument;
  PyObject *__pyx_n_s_argument_blocks;
  PyObject *__pyx_n_s_arguments;
  PyObject *__pyx_n_s_array;
  PyObject *__pyx_n_s_astype;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_average_error;
  PyObject *__pyx_n_s_axis;
  PyObject *__pyx_n_s_backpropagate;
  PyObject *__pyx_n_s_best_scores;
  PyObject *__pyx_n_s_bincount;
  PyObject *__pyx_n_s_calculate_all_scores;
  PyObject *__pyx_n_s_calculate_delta;
  PyObject *__pyx_n_s_calculate_gradients;
  PyObject *__pyx_n_s_calculate_gradients_classify;
  PyObject *__pyx_n_s_calculate_gradients_sll;
  PyObject *__pyx_n_s_calculate_gradients_wll;
  PyObject *__pyx_n_s_calculate_input_deltas;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_clip;
  PyObject *__pyx_n_u_clip;
  PyObject *__pyx_n_s_close;
  PyObject *__pyx_n_s_cls;
  PyObject *__pyx_n_s_column_numbers;
  PyObject *__pyx_n_s_concatenate;
  PyObject *__pyx_n_s_confidence;
  PyObject *__pyx_n_s_conflicting_probs;
  PyObject *__pyx_n_s_conflicting_tag;
  PyObject *__pyx_n_s_contract_cycle;
  PyObject *__pyx_n_s_convolution_max;
  PyObject *__pyx_n_s_convolution_values;
  PyObject *__pyx_n_s_copy;
  PyObject *__pyx_n_s_correct_path_score;
  PyObject *__pyx_n_s_correction;
  PyObject *__pyx_kp_u_corrections_skipped_Learning_ra;
  PyObject *__pyx_kp_u_corrections_skipped_learning_ra;
  PyObject *__pyx_n_s_count_nonzero;
  PyObject *__pyx_n_s_counts;
  PyObject *__pyx_n_s_create_convolution_lookup;
  PyObject *__pyx_n_s_create_new;
  PyObject *__pyx_n_s_create_new_locals_genexpr;
  PyObject *__pyx_n_s_create_pred_lookup;
  PyObject *__pyx_n_s_create_sentence_lookup;
  PyObject *__pyx_n_s_create_target_lookup;
  PyObject *__pyx_n_s_cycle;
  PyObject *__pyx_n_s_cycle_inds;
  PyObject *__pyx_n_s_cycle_score;
  PyObject *__pyx_n_s_cycles;
  PyObject *__pyx_n_s_d;
  PyObject *__pyx_n_u_d;
  PyObject *__pyx_n_s_dCd_hidden2;
  PyObject *__pyx_n_s_dCd_tanh;
  PyObject *__pyx_n_s_dCdf_2;
  PyObject *__pyx_n_s_dCdf_3;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_n_s_debug;
  PyObject *__pyx_n_s_decay_factor;
  PyObject *__pyx_n_s_decrease_learning_rates;
  PyObject *__pyx_n_s_delta;
  PyObject *__pyx_n_s_delta_softmax;
  PyObject *__pyx_n_s_deltas;
  PyObject *__pyx_n_s_desc;
  PyObject *__pyx_n_s_description;
  PyObject *__pyx_n_s_desired_accuracy;
  PyObject *__pyx_n_s_diagonal;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_dist_deltas;
  PyObject *__pyx_n_s_dist_features;
  PyObject *__pyx_n_s_dist_features_per_token;
  PyObject *__pyx_n_s_dist_pred_from;
  PyObject *__pyx_n_s_dist_table_dims;
  PyObject *__pyx_n_s_dist_target_from;
  PyObject *__pyx_n_s_dot;
  PyObject *__pyx_n_s_dtype;
  PyObject *__pyx_n_s_element;
  PyObject *__pyx_n_s_embeddings;
  PyObject *__pyx_n_s_empty;
  PyObject *__pyx_n_s_empty_like;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_end;
  PyObject *__pyx_n_s_enumerate;
  PyObject *__pyx_n_s_epoch;
  PyObject *__pyx_n_s_epochs;
  PyObject *__pyx_kp_u_epochs_Error;
  PyObject *__pyx_n_s_epochs_between_reports;
  PyObject *__pyx_n_s_error;
  PyObject *__pyx_n_s_exp;
  PyObject *__pyx_n_s_exp_scores;
  PyObject *__pyx_n_s_exp_sum;
  PyObject *__pyx_n_s_exponentials;
  PyObject *__pyx_n_u_f;
  PyObject *__pyx_n_s_factor;
  PyObject *__pyx_n_s_feature_tables;
  PyObject *__pyx_n_u_feature_tables;
  PyObject *__pyx_n_s_features;
  PyObject *__pyx_n_s_filename;
  PyObject *__pyx_n_s_fill_diagonal;
  PyObject *__pyx_n_s_find_cycle_recursive;
  PyObject *__pyx_n_s_find_cycles;
  PyObject *__pyx_n_s_find_maximum_spanning_tree;
  PyObject *__pyx_n_s_flatten;
  PyObject *__pyx_n_s_float64;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_generate_save_dict;
  PyObject *__pyx_n_s_genexpr;
  PyObject *__pyx_n_s_getLogger;
  PyObject *__pyx_n_s_get_state;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_n_s_gold_head;
  PyObject *__pyx_n_s_gold_tag;
  PyObject *__pyx_n_s_gold_tags;
  PyObject *__pyx_n_s_grad_matrix;
  PyObject *__pyx_n_s_grad_times_softmax;
  PyObject *__pyx_n_s_gradients;
  PyObject *__pyx_n_s_gradients_t;
  PyObject *__pyx_n_s_graph;
  PyObject *__pyx_n_s_greater;
  PyObject *__pyx_n_s_head;
  PyObject *__pyx_n_s_head_to_v;
  PyObject *__pyx_n_s_heads;
  PyObject *__pyx_n_s_hidden1_bias;
  PyObject *__pyx_n_s_hidden1_size;
  PyObject *__pyx_n_s_hidden1_weights;
  PyObject *__pyx_n_s_hidden2_bias;
  PyObject *__pyx_n_u_hidden2_bias;
  PyObject *__pyx_n_s_hidden2_size;
  PyObject *__pyx_n_u_hidden2_size;
  PyObject *__pyx_n_s_hidden2_weights;
  PyObject *__pyx_n_u_hidden2_weights;
  PyObject *__pyx_n_s_hidden_bias;
  PyObject *__pyx_n_u_hidden_bias;
  PyObject *__pyx_n_s_hidden_bias_deltas;
  PyObject *__pyx_n_s_hidden_deltas;
  PyObject *__pyx_n_s_hidden_gradients;
  PyObject *__pyx_n_s_hidden_size;
  PyObject *__pyx_n_u_hidden_size;
  PyObject *__pyx_n_s_hidden_weights;
  PyObject *__pyx_n_u_hidden_weights;
  PyObject *__pyx_n_s_high;
  PyObject *__pyx_n_s_highest_prob_arg;
  PyObject *__pyx_n_s_hits;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_i_args;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_incoming_weights;
  PyObject *__pyx_n_s_ind_from;
  PyObject *__pyx_n_s_ind_to;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_s_inds;
  PyObject *__pyx_n_s_info;
  PyObject *__pyx_n_s_init;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_s_input_and_pred_dist_values;
  PyObject *__pyx_n_s_input_data;
  PyObject *__pyx_n_s_input_deltas;
  PyObject *__pyx_n_s_input_gradients;
  PyObject *__pyx_n_s_input_size;
  PyObject *__pyx_n_u_input_size;
  PyObject *__pyx_n_s_input_size_with_distance;
  PyObject *__pyx_n_s_input_values;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_j;
  PyObject *__pyx_n_s_label;
  PyObject *__pyx_n_s_labels;
  PyObject *__pyx_n_s_last_accuracy;
  PyObject *__pyx_n_s_last_error;
  PyObject *__pyx_n_s_last_tag;
  PyObject *__pyx_n_s_last_token;
  PyObject *__pyx_n_s_last_values;
  PyObject *__pyx_n_s_less;
  PyObject *__pyx_n_s_load;
  PyObject *__pyx_n_s_load_from_file;
  PyObject *__pyx_n_s_load_from_file_2;
  PyObject *__pyx_n_s_load_parameters;
  PyObject *__pyx_n_s_log;
  PyObject *__pyx_n_s_log_sum_scores;
  PyObject *__pyx_n_s_logadd;
  PyObject *__pyx_n_s_logger;
  PyObject *__pyx_n_s_logging;
  PyObject *__pyx_n_s_logical_and;
  PyObject *__pyx_n_s_logical_not;
  PyObject *__pyx_n_s_logprob;
  PyObject *__pyx_n_s_logprobs;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_max;
  PyObject *__pyx_n_s_max_incoming_inds;
  PyObject *__pyx_n_s_max_incoming_weights;
  PyObject *__pyx_n_s_max_outgoing_inds;
  PyObject *__pyx_n_s_max_outgoing_weights;
  PyObject *__pyx_n_s_mode;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_net;
  PyObject *__pyx_n_s_net_scores;
  PyObject *__pyx_n_s_net_tag;
  PyObject *__pyx_n_s_network_filename;
  PyObject *__pyx_n_s_neuron_maxes;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_new_data;
  PyObject *__pyx_n_s_new_head;
  PyObject *__pyx_n_s_new_head_ind;
  PyObject *__pyx_n_s_new_shape;
  PyObject *__pyx_n_s_next_vertex;
  PyObject *__pyx_n_s_nltkor_tag_libs_network;
  PyObject *__pyx_kp_s_nltkor_tag_libs_network_pyx;
  PyObject *__pyx_kp_s_nltkor_tag_libs_networkconv_pyx;
  PyObject *__pyx_kp_s_nltkor_tag_libs_networkdependenc;
  PyObject *__pyx_n_s_nn;
  PyObject *__pyx_n_s_np;
  PyObject *__pyx_n_s_num;
  PyObject *__pyx_n_s_num_dims;
  PyObject *__pyx_n_s_num_dist_features;
  PyObject *__pyx_n_s_num_distances;
  PyObject *__pyx_n_s_num_items;
  PyObject *__pyx_n_s_num_tokens;
  PyObject *__pyx_n_s_num_vertices;
  PyObject *__pyx_n_s_numpy;
  PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
  PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
  PyObject *__pyx_n_s_old_head;
  PyObject *__pyx_n_s_other_args;
  PyObject *__pyx_n_s_outgoing_weights;
  PyObject *__pyx_n_s_output;
  PyObject *__pyx_n_s_output_bias;
  PyObject *__pyx_n_u_output_bias;
  PyObject *__pyx_n_s_output_bias_deltas;
  PyObject *__pyx_n_s_output_deltas;
  PyObject *__pyx_n_s_output_dim;
  PyObject *__pyx_n_s_output_range;
  PyObject *__pyx_n_s_output_size;
  PyObject *__pyx_n_u_output_size;
  PyObject *__pyx_n_s_output_weights;
  PyObject *__pyx_n_u_output_weights;
  PyObject *__pyx_n_s_outside;
  PyObject *__pyx_n_s_outside_inds;
  PyObject *__pyx_n_s_padded_sentence;
  PyObject *__pyx_n_s_padding_left;
  PyObject *__pyx_n_u_padding_left;
  PyObject *__pyx_n_s_padding_right;
  PyObject *__pyx_n_u_padding_right;
  PyObject *__pyx_n_s_path_backtrack;
  PyObject *__pyx_n_s_path_scores;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_s_pos_deltas;
  PyObject *__pyx_n_s_pos_dist;
  PyObject *__pyx_n_s_pos_padding;
  PyObject *__pyx_n_s_pre_deltas;
  PyObject *__pyx_n_s_pre_dist;
  PyObject *__pyx_n_s_pre_padding;
  PyObject *__pyx_n_s_pre_tagging_setup;
  PyObject *__pyx_n_s_pred_answer;
  PyObject *__pyx_n_s_pred_arguments;
  PyObject *__pyx_n_s_pred_dist_gradients;
  PyObject *__pyx_n_s_pred_dist_indices;
  PyObject *__pyx_n_s_pred_dist_table;
  PyObject *__pyx_n_u_pred_dist_table;
  PyObject *__pyx_n_s_pred_dist_values;
  PyObject *__pyx_n_s_pred_dist_weights;
  PyObject *__pyx_n_u_pred_dist_weights;
  PyObject *__pyx_n_s_pred_dists;
  PyObject *__pyx_n_s_pred_tags;
  PyObject *__pyx_n_s_predicate;
  PyObject *__pyx_n_s_predicate_answer;
  PyObject *__pyx_n_s_predicate_tags;
  PyObject *__pyx_n_s_predicates;
  PyObject *__pyx_n_s_prev_score_and_trans;
  PyObject *__pyx_n_s_previous_tag;
  PyObject *__pyx_n_s_print_epoch_report;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_ConvolutionalDepe;
  PyObject *__pyx_n_s_pyx_unpickle_ConvolutionalNetw;
  PyObject *__pyx_n_s_pyx_unpickle_Network;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_random;
  PyObject *__pyx_n_s_random_state;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_ravel;
  PyObject *__pyx_n_s_reachable;
  PyObject *__pyx_n_s_reachable_vertices;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_reset_counters;
  PyObject *__pyx_n_s_reshape;
  PyObject *__pyx_n_s_rollaxis;
  PyObject *__pyx_n_s_root;
  PyObject *__pyx_n_s_save;
  PyObject *__pyx_n_s_savez;
  PyObject *__pyx_n_s_scores;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_send;
  PyObject *__pyx_n_s_sent;
  PyObject *__pyx_n_s_sent_args;
  PyObject *__pyx_n_s_sent_preds;
  PyObject *__pyx_n_s_sent_tags;
  PyObject *__pyx_n_s_sentence;
  PyObject *__pyx_n_s_sentence_convolution;
  PyObject *__pyx_n_s_sentence_hit;
  PyObject *__pyx_n_s_sentence_hits;
  PyObject *__pyx_n_s_sentences;
  PyObject *__pyx_n_s_set_learning_rate_decay;
  PyObject *__pyx_n_s_set_state;
  PyObject *__pyx_n_s_set_validation_data;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_n_s_shape;
  PyObject *__pyx_n_s_shift;
  PyObject *__pyx_n_s_shuffle;
  PyObject *__pyx_n_s_shuffle_data;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_sqrt;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_start_from;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_sum;
  PyObject *__pyx_n_s_sumlogadd;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_t;
  PyObject *__pyx_n_s_table;
  PyObject *__pyx_n_s_table_deltas;
  PyObject *__pyx_n_s_table_dims;
  PyObject *__pyx_n_s_tag;
  PyObject *__pyx_n_s_tag_scores;
  PyObject *__pyx_n_s_tag_sentence;
  PyObject *__pyx_n_s_tag_sentence_2;
  PyObject *__pyx_n_s_tag_sentence_labeled_dependency;
  PyObject *__pyx_n_s_tag_sentence_unlabeled_dependen;
  PyObject *__pyx_n_s_tags;
  PyObject *__pyx_n_s_take;
  PyObject *__pyx_n_s_target;
  PyObject *__pyx_n_s_target_dist_gradients;
  PyObject *__pyx_n_s_target_dist_indices;
  PyObject *__pyx_n_s_target_dist_table;
  PyObject *__pyx_n_u_target_dist_table;
  PyObject *__pyx_n_s_target_dist_values;
  PyObject *__pyx_n_s_target_dist_weights;
  PyObject *__pyx_n_u_target_dist_weights;
  PyObject *__pyx_n_s_target_dists;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_throw;
  PyObject *__pyx_n_s_tile;
  PyObject *__pyx_n_s_token;
  PyObject *__pyx_n_s_token_indices;
  PyObject *__pyx_n_s_token_scores;
  PyObject *__pyx_n_s_top_accuracy;
  PyObject *__pyx_n_s_train;
  PyObject *__pyx_n_s_train_epoch;
  PyObject *__pyx_n_s_train_locals_genexpr;
  PyObject *__pyx_n_s_training;
  PyObject *__pyx_n_s_trans;
  PyObject *__pyx_n_s_transitions;
  PyObject *__pyx_n_u_transitions;
  PyObject *__pyx_n_s_transitions_t;
  PyObject *__pyx_n_s_uniform;
  PyObject *__pyx_n_s_unreachable;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_validate;
  PyObject *__pyx_n_s_validate_locals_genexpr;
  PyObject *__pyx_n_s_validation_arguments;
  PyObject *__pyx_n_s_validation_predicates;
  PyObject *__pyx_n_s_validation_sentences;
  PyObject *__pyx_n_s_validation_tags;
  PyObject *__pyx_n_s_vertex;
  PyObject *__pyx_n_s_vertex_leaving_cycle;
  PyObject *__pyx_n_s_vertex_leaving_cycle_ind;
  PyObject *__pyx_n_s_vertices_in_cycles;
  PyObject *__pyx_n_s_visited;
  PyObject *__pyx_n_s_viterbi;
  PyObject *__pyx_n_s_vstack;
  PyObject *__pyx_n_s_w_deltas;
  PyObject *__pyx_n_s_where;
  PyObject *__pyx_n_s_window;
  PyObject *__pyx_n_s_window_from;
  PyObject *__pyx_n_s_window_to;
  PyObject *__pyx_n_s_word_window;
  PyObject *__pyx_n_s_word_window_size;
  PyObject *__pyx_n_u_word_window_size;
  PyObject *__pyx_n_s_x;
  PyObject *__pyx_n_s_xrange;
  PyObject *__pyx_n_s_zeros;
  PyObject *__pyx_n_s_zeros_like;
  PyObject *__pyx_n_s_zip;
  PyObject *__pyx_float_0_0;
  PyObject *__pyx_float_1_0;
  PyObject *__pyx_float_0_01;
  PyObject *__pyx_float_2_38;
  PyObject *__pyx_float_neg_1_0;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_27816595;
  PyObject *__pyx_int_49696698;
  PyObject *__pyx_int_119830996;
  PyObject *__pyx_int_145891266;
  PyObject *__pyx_int_148123145;
  PyObject *__pyx_int_149446146;
  PyObject *__pyx_int_202246394;
  PyObject *__pyx_int_212151326;
  PyObject *__pyx_int_220499725;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_int_neg_2;
  PyObject *__pyx_int_neg_1000;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_slice__8;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_slice__12;
  PyObject *__pyx_slice__14;
  PyObject *__pyx_slice__56;
  PyObject *__pyx_slice__59;
  PyObject *__pyx_tuple__15;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__88;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__94;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__97;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_tuple__99;
  PyObject *__pyx_codeobj__3;
  PyObject *__pyx_codeobj__4;
  PyObject *__pyx_codeobj__7;
  PyObject *__pyx_codeobj__9;
  PyObject *__pyx_tuple__100;
  PyObject *__pyx_tuple__101;
  PyObject *__pyx_tuple__102;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__104;
  PyObject *__pyx_tuple__105;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__107;
  PyObject *__pyx_tuple__108;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__110;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__112;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__114;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__116;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__118;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__120;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__122;
  PyObject *__pyx_tuple__123;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__125;
  PyObject *__pyx_tuple__126;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__128;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__130;
  PyObject *__pyx_tuple__131;
  PyObject *__pyx_tuple__132;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__134;
  PyObject *__pyx_tuple__135;
  PyObject *__pyx_tuple__136;
  PyObject *__pyx_tuple__137;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__139;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__141;
  PyObject *__pyx_tuple__142;
  PyObject *__pyx_tuple__143;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__145;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__147;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__150;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__153;
  PyObject *__pyx_tuple__154;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__156;
  PyObject *__pyx_tuple__157;
  PyObject *__pyx_tuple__158;
  PyObject *__pyx_tuple__159;
  PyObject *__pyx_tuple__160;
  PyObject *__pyx_codeobj__10;
  PyObject *__pyx_codeobj__11;
  PyObject *__pyx_codeobj__13;
  PyObject *__pyx_codeobj__16;
  PyObject *__pyx_codeobj__17;
  PyObject *__pyx_codeobj__18;
  PyObject *__pyx_codeobj__19;
  PyObject *__pyx_codeobj__20;
  PyObject *__pyx_codeobj__21;
  PyObject *__pyx_codeobj__22;
  PyObject *__pyx_codeobj__24;
  PyObject *__pyx_codeobj__25;
  PyObject *__pyx_codeobj__26;
  PyObject *__pyx_codeobj__27;
  PyObject *__pyx_codeobj__28;
  PyObject *__pyx_codeobj__29;
  PyObject *__pyx_codeobj__30;
  PyObject *__pyx_codeobj__31;
  PyObject *__pyx_codeobj__32;
  PyObject *__pyx_codeobj__33;
  PyObject *__pyx_codeobj__34;
  PyObject *__pyx_codeobj__35;
  PyObject *__pyx_codeobj__36;
  PyObject *__pyx_codeobj__37;
  PyObject *__pyx_codeobj__38;
  PyObject *__pyx_codeobj__39;
  PyObject *__pyx_codeobj__40;
  PyObject *__pyx_codeobj__41;
  PyObject *__pyx_codeobj__42;
  PyObject *__pyx_codeobj__43;
  PyObject *__pyx_codeobj__44;
  PyObject *__pyx_codeobj__45;
  PyObject *__pyx_codeobj__46;
  PyObject *__pyx_codeobj__47;
  PyObject *__pyx_codeobj__49;
  PyObject *__pyx_codeobj__50;
  PyObject *__pyx_codeobj__51;
  PyObject *__pyx_codeobj__52;
  PyObject *__pyx_codeobj__53;
  PyObject *__pyx_codeobj__54;
  PyObject *__pyx_codeobj__55;
  PyObject *__pyx_codeobj__58;
  PyObject *__pyx_codeobj__60;
  PyObject *__pyx_codeobj__61;
  PyObject *__pyx_codeobj__62;
  PyObject *__pyx_codeobj__63;
  PyObject *__pyx_codeobj__64;
  PyObject *__pyx_codeobj__65;
  PyObject *__pyx_codeobj__66;
  PyObject *__pyx_codeobj__67;
  PyObject *__pyx_codeobj__68;
  PyObject *__pyx_codeobj__69;
  PyObject *__pyx_codeobj__70;
  PyObject *__pyx_codeobj__71;
  PyObject *__pyx_codeobj__72;
  PyObject *__pyx_codeobj__73;
  PyObject *__pyx_codeobj__74;
  PyObject *__pyx_codeobj__75;
  PyObject *__pyx_codeobj__77;
  PyObject *__pyx_codeobj__78;
  PyObject *__pyx_codeobj__79;
  PyObject *__pyx_codeobj__80;
  PyObject *__pyx_codeobj__81;
  PyObject *__pyx_codeobj__82;
  PyObject *__pyx_codeobj__83;
  PyObject *__pyx_codeobj__84;
  PyObject *__pyx_codeobj__87;
  PyObject *__pyx_codeobj__89;
} __pyx_mstate;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_Network);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Accuracy);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Confidence_measure_not_implement);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Convolution_layer_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_10);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_11);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_12);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_13);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_14);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_4);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_5);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_6);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_7);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_8);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_9);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_l);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_s_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_t_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork___reduce_cy);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork___setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__adjust_fea);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__adjust_wei);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__backpropag);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__calculate);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__calculate_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__calculate_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__create_con);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__create_pre);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__create_tar);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__generate_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__load_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__load_param);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__pre_taggin);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__reset_coun);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__sentence_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__shuffle_da);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__tag_senten);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__train_epoc);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__validate);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork__viterbi);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_create_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_description);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_load_from_f);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_save);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_set_validat);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_tag_sentenc);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConvolutionalNetwork_train);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Distance_table_sizes_target_and);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Feature_table_sizes);
  Py_CLEAR(clear_module_state->__pyx_n_s_FloatingPointError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Hidden_layer_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_Infinity);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Input_layer_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_Logger);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__backpropagate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__calculate_delta);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__calculate_gradients_sll);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__calculate_gradients_wll);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__create_sentence_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__load_parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__print_epoch_report);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__tag_sentence);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__train_epoch);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__validate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network__viterbi);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_create_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_decrease_learning_rates);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_description);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_load_from_file);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_save);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_set_learning_rate_decay);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_set_validation_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_tag_sentence);
  Py_CLEAR(clear_module_state->__pyx_n_s_Network_train);
  Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Output_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Saved_model);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Second_hidden_layer_size);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Sentence_accuracy);
  Py_CLEAR(clear_module_state->__pyx_n_s_T);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Token_accuracy);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Training_for_up_to_d_epochs);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Word_window_size);
  Py_CLEAR(clear_module_state->__pyx_n_s__161);
  Py_CLEAR(clear_module_state->__pyx_kp_u__23);
  Py_CLEAR(clear_module_state->__pyx_kp_u__5);
  Py_CLEAR(clear_module_state->__pyx_kp_u__6);
  Py_CLEAR(clear_module_state->__pyx_kp_u__76);
  Py_CLEAR(clear_module_state->__pyx_kp_u__86);
  Py_CLEAR(clear_module_state->__pyx_n_s__91);
  Py_CLEAR(clear_module_state->__pyx_n_s_add);
  Py_CLEAR(clear_module_state->__pyx_n_s_adjust_features);
  Py_CLEAR(clear_module_state->__pyx_n_s_adjust_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_all_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_allow_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_allow_repeats);
  Py_CLEAR(clear_module_state->__pyx_n_s_answer);
  Py_CLEAR(clear_module_state->__pyx_n_s_arange);
  Py_CLEAR(clear_module_state->__pyx_n_s_argmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_argument);
  Py_CLEAR(clear_module_state->__pyx_n_s_argument_blocks);
  Py_CLEAR(clear_module_state->__pyx_n_s_arguments);
  Py_CLEAR(clear_module_state->__pyx_n_s_array);
  Py_CLEAR(clear_module_state->__pyx_n_s_astype);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_average_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_axis);
  Py_CLEAR(clear_module_state->__pyx_n_s_backpropagate);
  Py_CLEAR(clear_module_state->__pyx_n_s_best_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_bincount);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_all_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_delta);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_gradients_classify);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_gradients_sll);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_gradients_wll);
  Py_CLEAR(clear_module_state->__pyx_n_s_calculate_input_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_clip);
  Py_CLEAR(clear_module_state->__pyx_n_u_clip);
  Py_CLEAR(clear_module_state->__pyx_n_s_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_cls);
  Py_CLEAR(clear_module_state->__pyx_n_s_column_numbers);
  Py_CLEAR(clear_module_state->__pyx_n_s_concatenate);
  Py_CLEAR(clear_module_state->__pyx_n_s_confidence);
  Py_CLEAR(clear_module_state->__pyx_n_s_conflicting_probs);
  Py_CLEAR(clear_module_state->__pyx_n_s_conflicting_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_contract_cycle);
  Py_CLEAR(clear_module_state->__pyx_n_s_convolution_max);
  Py_CLEAR(clear_module_state->__pyx_n_s_convolution_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_copy);
  Py_CLEAR(clear_module_state->__pyx_n_s_correct_path_score);
  Py_CLEAR(clear_module_state->__pyx_n_s_correction);
  Py_CLEAR(clear_module_state->__pyx_kp_u_corrections_skipped_Learning_ra);
  Py_CLEAR(clear_module_state->__pyx_kp_u_corrections_skipped_learning_ra);
  Py_CLEAR(clear_module_state->__pyx_n_s_count_nonzero);
  Py_CLEAR(clear_module_state->__pyx_n_s_counts);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_convolution_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_new_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_pred_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_sentence_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_target_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_cycle);
  Py_CLEAR(clear_module_state->__pyx_n_s_cycle_inds);
  Py_CLEAR(clear_module_state->__pyx_n_s_cycle_score);
  Py_CLEAR(clear_module_state->__pyx_n_s_cycles);
  Py_CLEAR(clear_module_state->__pyx_n_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_u_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_dCd_hidden2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dCd_tanh);
  Py_CLEAR(clear_module_state->__pyx_n_s_dCdf_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dCdf_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_debug);
  Py_CLEAR(clear_module_state->__pyx_n_s_decay_factor);
  Py_CLEAR(clear_module_state->__pyx_n_s_decrease_learning_rates);
  Py_CLEAR(clear_module_state->__pyx_n_s_delta);
  Py_CLEAR(clear_module_state->__pyx_n_s_delta_softmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_desc);
  Py_CLEAR(clear_module_state->__pyx_n_s_description);
  Py_CLEAR(clear_module_state->__pyx_n_s_desired_accuracy);
  Py_CLEAR(clear_module_state->__pyx_n_s_diagonal);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_features);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_features_per_token);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_pred_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_table_dims);
  Py_CLEAR(clear_module_state->__pyx_n_s_dist_target_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_dot);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
  Py_CLEAR(clear_module_state->__pyx_n_s_element);
  Py_CLEAR(clear_module_state->__pyx_n_s_embeddings);
  Py_CLEAR(clear_module_state->__pyx_n_s_empty);
  Py_CLEAR(clear_module_state->__pyx_n_s_empty_like);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
  Py_CLEAR(clear_module_state->__pyx_n_s_epoch);
  Py_CLEAR(clear_module_state->__pyx_n_s_epochs);
  Py_CLEAR(clear_module_state->__pyx_kp_u_epochs_Error);
  Py_CLEAR(clear_module_state->__pyx_n_s_epochs_between_reports);
  Py_CLEAR(clear_module_state->__pyx_n_s_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_exp);
  Py_CLEAR(clear_module_state->__pyx_n_s_exp_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_exp_sum);
  Py_CLEAR(clear_module_state->__pyx_n_s_exponentials);
  Py_CLEAR(clear_module_state->__pyx_n_u_f);
  Py_CLEAR(clear_module_state->__pyx_n_s_factor);
  Py_CLEAR(clear_module_state->__pyx_n_s_feature_tables);
  Py_CLEAR(clear_module_state->__pyx_n_u_feature_tables);
  Py_CLEAR(clear_module_state->__pyx_n_s_features);
  Py_CLEAR(clear_module_state->__pyx_n_s_filename);
  Py_CLEAR(clear_module_state->__pyx_n_s_fill_diagonal);
  Py_CLEAR(clear_module_state->__pyx_n_s_find_cycle_recursive);
  Py_CLEAR(clear_module_state->__pyx_n_s_find_cycles);
  Py_CLEAR(clear_module_state->__pyx_n_s_find_maximum_spanning_tree);
  Py_CLEAR(clear_module_state->__pyx_n_s_flatten);
  Py_CLEAR(clear_module_state->__pyx_n_s_float64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_generate_save_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_getLogger);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_gold_head);
  Py_CLEAR(clear_module_state->__pyx_n_s_gold_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_gold_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_grad_matrix);
  Py_CLEAR(clear_module_state->__pyx_n_s_grad_times_softmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_gradients_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_graph);
  Py_CLEAR(clear_module_state->__pyx_n_s_greater);
  Py_CLEAR(clear_module_state->__pyx_n_s_head);
  Py_CLEAR(clear_module_state->__pyx_n_s_head_to_v);
  Py_CLEAR(clear_module_state->__pyx_n_s_heads);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden1_bias);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden1_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden1_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden2_bias);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden2_bias);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden2_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden2_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden2_weights);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden2_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_bias);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden_bias);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_bias_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_hidden_weights);
  Py_CLEAR(clear_module_state->__pyx_n_u_hidden_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_high);
  Py_CLEAR(clear_module_state->__pyx_n_s_highest_prob_arg);
  Py_CLEAR(clear_module_state->__pyx_n_s_hits);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_i_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_incoming_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_ind_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_ind_to);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_inds);
  Py_CLEAR(clear_module_state->__pyx_n_s_info);
  Py_CLEAR(clear_module_state->__pyx_n_s_init);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_and_pred_dist_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_input_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_size_with_distance);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_j);
  Py_CLEAR(clear_module_state->__pyx_n_s_label);
  Py_CLEAR(clear_module_state->__pyx_n_s_labels);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_accuracy);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_token);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_less);
  Py_CLEAR(clear_module_state->__pyx_n_s_load);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_from_file);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_from_file_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_log);
  Py_CLEAR(clear_module_state->__pyx_n_s_log_sum_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_logadd);
  Py_CLEAR(clear_module_state->__pyx_n_s_logger);
  Py_CLEAR(clear_module_state->__pyx_n_s_logging);
  Py_CLEAR(clear_module_state->__pyx_n_s_logical_and);
  Py_CLEAR(clear_module_state->__pyx_n_s_logical_not);
  Py_CLEAR(clear_module_state->__pyx_n_s_logprob);
  Py_CLEAR(clear_module_state->__pyx_n_s_logprobs);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_max);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_incoming_inds);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_incoming_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_outgoing_inds);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_outgoing_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_net);
  Py_CLEAR(clear_module_state->__pyx_n_s_net_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_net_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_network_filename);
  Py_CLEAR(clear_module_state->__pyx_n_s_neuron_maxes);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_head);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_head_ind);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_shape);
  Py_CLEAR(clear_module_state->__pyx_n_s_next_vertex);
  Py_CLEAR(clear_module_state->__pyx_n_s_nltkor_tag_libs_network);
  Py_CLEAR(clear_module_state->__pyx_kp_s_nltkor_tag_libs_network_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_nltkor_tag_libs_networkconv_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_nltkor_tag_libs_networkdependenc);
  Py_CLEAR(clear_module_state->__pyx_n_s_nn);
  Py_CLEAR(clear_module_state->__pyx_n_s_np);
  Py_CLEAR(clear_module_state->__pyx_n_s_num);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_dims);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_dist_features);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_distances);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_tokens);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_vertices);
  Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
  Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to);
  Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor);
  Py_CLEAR(clear_module_state->__pyx_n_s_old_head);
  Py_CLEAR(clear_module_state->__pyx_n_s_other_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_outgoing_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_bias);
  Py_CLEAR(clear_module_state->__pyx_n_u_output_bias);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_bias_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_dim);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_output_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_weights);
  Py_CLEAR(clear_module_state->__pyx_n_u_output_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_outside);
  Py_CLEAR(clear_module_state->__pyx_n_s_outside_inds);
  Py_CLEAR(clear_module_state->__pyx_n_s_padded_sentence);
  Py_CLEAR(clear_module_state->__pyx_n_s_padding_left);
  Py_CLEAR(clear_module_state->__pyx_n_u_padding_left);
  Py_CLEAR(clear_module_state->__pyx_n_s_padding_right);
  Py_CLEAR(clear_module_state->__pyx_n_u_padding_right);
  Py_CLEAR(clear_module_state->__pyx_n_s_path_backtrack);
  Py_CLEAR(clear_module_state->__pyx_n_s_path_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_pos_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_pos_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_pos_padding);
  Py_CLEAR(clear_module_state->__pyx_n_s_pre_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_pre_dist);
  Py_CLEAR(clear_module_state->__pyx_n_s_pre_padding);
  Py_CLEAR(clear_module_state->__pyx_n_s_pre_tagging_setup);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_answer);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_arguments);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dist_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dist_indices);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dist_table);
  Py_CLEAR(clear_module_state->__pyx_n_u_pred_dist_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dist_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dist_weights);
  Py_CLEAR(clear_module_state->__pyx_n_u_pred_dist_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_dists);
  Py_CLEAR(clear_module_state->__pyx_n_s_pred_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_predicate);
  Py_CLEAR(clear_module_state->__pyx_n_s_predicate_answer);
  Py_CLEAR(clear_module_state->__pyx_n_s_predicate_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_predicates);
  Py_CLEAR(clear_module_state->__pyx_n_s_prev_score_and_trans);
  Py_CLEAR(clear_module_state->__pyx_n_s_previous_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_print_epoch_report);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_ConvolutionalDepe);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_ConvolutionalNetw);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Network);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_random);
  Py_CLEAR(clear_module_state->__pyx_n_s_random_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_ravel);
  Py_CLEAR(clear_module_state->__pyx_n_s_reachable);
  Py_CLEAR(clear_module_state->__pyx_n_s_reachable_vertices);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_counters);
  Py_CLEAR(clear_module_state->__pyx_n_s_reshape);
  Py_CLEAR(clear_module_state->__pyx_n_s_rollaxis);
  Py_CLEAR(clear_module_state->__pyx_n_s_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_save);
  Py_CLEAR(clear_module_state->__pyx_n_s_savez);
  Py_CLEAR(clear_module_state->__pyx_n_s_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_send);
  Py_CLEAR(clear_module_state->__pyx_n_s_sent);
  Py_CLEAR(clear_module_state->__pyx_n_s_sent_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_sent_preds);
  Py_CLEAR(clear_module_state->__pyx_n_s_sent_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_sentence);
  Py_CLEAR(clear_module_state->__pyx_n_s_sentence_convolution);
  Py_CLEAR(clear_module_state->__pyx_n_s_sentence_hit);
  Py_CLEAR(clear_module_state->__pyx_n_s_sentence_hits);
  Py_CLEAR(clear_module_state->__pyx_n_s_sentences);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_learning_rate_decay);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_validation_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_shape);
  Py_CLEAR(clear_module_state->__pyx_n_s_shift);
  Py_CLEAR(clear_module_state->__pyx_n_s_shuffle);
  Py_CLEAR(clear_module_state->__pyx_n_s_shuffle_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_sqrt);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_start_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_sum);
  Py_CLEAR(clear_module_state->__pyx_n_s_sumlogadd);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_table_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_table_dims);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_sentence);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_sentence_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_sentence_labeled_dependency);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_sentence_unlabeled_dependen);
  Py_CLEAR(clear_module_state->__pyx_n_s_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_take);
  Py_CLEAR(clear_module_state->__pyx_n_s_target);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dist_gradients);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dist_indices);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dist_table);
  Py_CLEAR(clear_module_state->__pyx_n_u_target_dist_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dist_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dist_weights);
  Py_CLEAR(clear_module_state->__pyx_n_u_target_dist_weights);
  Py_CLEAR(clear_module_state->__pyx_n_s_target_dists);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_throw);
  Py_CLEAR(clear_module_state->__pyx_n_s_tile);
  Py_CLEAR(clear_module_state->__pyx_n_s_token);
  Py_CLEAR(clear_module_state->__pyx_n_s_token_indices);
  Py_CLEAR(clear_module_state->__pyx_n_s_token_scores);
  Py_CLEAR(clear_module_state->__pyx_n_s_top_accuracy);
  Py_CLEAR(clear_module_state->__pyx_n_s_train);
  Py_CLEAR(clear_module_state->__pyx_n_s_train_epoch);
  Py_CLEAR(clear_module_state->__pyx_n_s_train_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_training);
  Py_CLEAR(clear_module_state->__pyx_n_s_trans);
  Py_CLEAR(clear_module_state->__pyx_n_s_transitions);
  Py_CLEAR(clear_module_state->__pyx_n_u_transitions);
  Py_CLEAR(clear_module_state->__pyx_n_s_transitions_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_uniform);
  Py_CLEAR(clear_module_state->__pyx_n_s_unreachable);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_validate);
  Py_CLEAR(clear_module_state->__pyx_n_s_validate_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_validation_arguments);
  Py_CLEAR(clear_module_state->__pyx_n_s_validation_predicates);
  Py_CLEAR(clear_module_state->__pyx_n_s_validation_sentences);
  Py_CLEAR(clear_module_state->__pyx_n_s_validation_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_vertex);
  Py_CLEAR(clear_module_state->__pyx_n_s_vertex_leaving_cycle);
  Py_CLEAR(clear_module_state->__pyx_n_s_vertex_leaving_cycle_ind);
  Py_CLEAR(clear_module_state->__pyx_n_s_vertices_in_cycles);
  Py_CLEAR(clear_module_state->__pyx_n_s_visited);
  Py_CLEAR(clear_module_state->__pyx_n_s_viterbi);
  Py_CLEAR(clear_module_state->__pyx_n_s_vstack);
  Py_CLEAR(clear_module_state->__pyx_n_s_w_deltas);
  Py_CLEAR(clear_module_state->__pyx_n_s_where);
  Py_CLEAR(clear_module_state->__pyx_n_s_window);
  Py_CLEAR(clear_module_state->__pyx_n_s_window_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_window_to);
  Py_CLEAR(clear_module_state->__pyx_n_s_word_window);
  Py_CLEAR(clear_module_state->__pyx_n_s_word_window_size);
  Py_CLEAR(clear_module_state->__pyx_n_u_word_window_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_x);
  Py_CLEAR(clear_module_state->__pyx_n_s_xrange);
  Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
  Py_CLEAR(clear_module_state->__pyx_n_s_zeros_like);
  Py_CLEAR(clear_module_state->__pyx_n_s_zip);
  Py_CLEAR(clear_module_state->__pyx_float_0_0);
  Py_CLEAR(clear_module_state->__pyx_float_1_0);
  Py_CLEAR(clear_module_state->__pyx_float_0_01);
  Py_CLEAR(clear_module_state->__pyx_float_2_38);
  Py_CLEAR(clear_module_state->__pyx_float_neg_1_0);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_27816595);
  Py_CLEAR(clear_module_state->__pyx_int_49696698);
  Py_CLEAR(clear_module_state->__pyx_int_119830996);
  Py_CLEAR(clear_module_state->__pyx_int_145891266);
  Py_CLEAR(clear_module_state->__pyx_int_148123145);
  Py_CLEAR(clear_module_state->__pyx_int_149446146);
  Py_CLEAR(clear_module_state->__pyx_int_202246394);
  Py_CLEAR(clear_module_state->__pyx_int_212151326);
  Py_CLEAR(clear_module_state->__pyx_int_220499725);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_int_neg_2);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1000);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_slice__8);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_slice__12);
  Py_CLEAR(clear_module_state->__pyx_slice__14);
  Py_CLEAR(clear_module_state->__pyx_slice__56);
  Py_CLEAR(clear_module_state->__pyx_slice__59);
  Py_CLEAR(clear_module_state->__pyx_tuple__15);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__88);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__94);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__97);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_tuple__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__3);
  Py_CLEAR(clear_module_state->__pyx_codeobj__4);
  Py_CLEAR(clear_module_state->__pyx_codeobj__7);
  Py_CLEAR(clear_module_state->__pyx_codeobj__9);
  Py_CLEAR(clear_module_state->__pyx_tuple__100);
  Py_CLEAR(clear_module_state->__pyx_tuple__101);
  Py_CLEAR(clear_module_state->__pyx_tuple__102);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__104);
  Py_CLEAR(clear_module_state->__pyx_tuple__105);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__107);
  Py_CLEAR(clear_module_state->__pyx_tuple__108);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__110);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__112);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__114);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__116);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__118);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__120);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__122);
  Py_CLEAR(clear_module_state->__pyx_tuple__123);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__125);
  Py_CLEAR(clear_module_state->__pyx_tuple__126);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__128);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__130);
  Py_CLEAR(clear_module_state->__pyx_tuple__131);
  Py_CLEAR(clear_module_state->__pyx_tuple__132);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__134);
  Py_CLEAR(clear_module_state->__pyx_tuple__135);
  Py_CLEAR(clear_module_state->__pyx_tuple__136);
  Py_CLEAR(clear_module_state->__pyx_tuple__137);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__139);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__141);
  Py_CLEAR(clear_module_state->__pyx_tuple__142);
  Py_CLEAR(clear_module_state->__pyx_tuple__143);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__145);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__147);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__150);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__153);
  Py_CLEAR(clear_module_state->__pyx_tuple__154);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__156);
  Py_CLEAR(clear_module_state->__pyx_tuple__157);
  Py_CLEAR(clear_module_state->__pyx_tuple__158);
  Py_CLEAR(clear_module_state->__pyx_tuple__159);
  Py_CLEAR(clear_module_state->__pyx_tuple__160);
  Py_CLEAR(clear_module_state->__pyx_codeobj__10);
  Py_CLEAR(clear_module_state->__pyx_codeobj__11);
  Py_CLEAR(clear_module_state->__pyx_codeobj__13);
  Py_CLEAR(clear_module_state->__pyx_codeobj__16);
  Py_CLEAR(clear_module_state->__pyx_codeobj__17);
  Py_CLEAR(clear_module_state->__pyx_codeobj__18);
  Py_CLEAR(clear_module_state->__pyx_codeobj__19);
  Py_CLEAR(clear_module_state->__pyx_codeobj__20);
  Py_CLEAR(clear_module_state->__pyx_codeobj__21);
  Py_CLEAR(clear_module_state->__pyx_codeobj__22);
  Py_CLEAR(clear_module_state->__pyx_codeobj__24);
  Py_CLEAR(clear_module_state->__pyx_codeobj__25);
  Py_CLEAR(clear_module_state->__pyx_codeobj__26);
  Py_CLEAR(clear_module_state->__pyx_codeobj__27);
  Py_CLEAR(clear_module_state->__pyx_codeobj__28);
  Py_CLEAR(clear_module_state->__pyx_codeobj__29);
  Py_CLEAR(clear_module_state->__pyx_codeobj__30);
  Py_CLEAR(clear_module_state->__pyx_codeobj__31);
  Py_CLEAR(clear_module_state->__pyx_codeobj__32);
  Py_CLEAR(clear_module_state->__pyx_codeobj__33);
  Py_CLEAR(clear_module_state->__pyx_codeobj__34);
  Py_CLEAR(clear_module_state->__pyx_codeobj__35);
  Py_CLEAR(clear_module_state->__pyx_codeobj__36);
  Py_CLEAR(clear_module_state->__pyx_codeobj__37);
  Py_CLEAR(clear_module_state->__pyx_codeobj__38);
  Py_CLEAR(clear_module_state->__pyx_codeobj__39);
  Py_CLEAR(clear_module_state->__pyx_codeobj__40);
  Py_CLEAR(clear_module_state->__pyx_codeobj__41);
  Py_CLEAR(clear_module_state->__pyx_codeobj__42);
  Py_CLEAR(clear_module_state->__pyx_codeobj__43);
  Py_CLEAR(clear_module_state->__pyx_codeobj__44);
  Py_CLEAR(clear_module_state->__pyx_codeobj__45);
  Py_CLEAR(clear_module_state->__pyx_codeobj__46);
  Py_CLEAR(clear_module_state->__pyx_codeobj__47);
  Py_CLEAR(clear_module_state->__pyx_codeobj__49);
  Py_CLEAR(clear_module_state->__pyx_codeobj__50);
  Py_CLEAR(clear_module_state->__pyx_codeobj__51);
  Py_CLEAR(clear_module_state->__pyx_codeobj__52);
  Py_CLEAR(clear_module_state->__pyx_codeobj__53);
  Py_CLEAR(clear_module_state->__pyx_codeobj__54);
  Py_CLEAR(clear_module_state->__pyx_codeobj__55);
  Py_CLEAR(clear_module_state->__pyx_codeobj__58);
  Py_CLEAR(clear_module_state->__pyx_codeobj__60);
  Py_CLEAR(clear_module_state->__pyx_codeobj__61);
  Py_CLEAR(clear_module_state->__pyx_codeobj__62);
  Py_CLEAR(clear_module_state->__pyx_codeobj__63);
  Py_CLEAR(clear_module_state->__pyx_codeobj__64);
  Py_CLEAR(clear_module_state->__pyx_codeobj__65);
  Py_CLEAR(clear_module_state->__pyx_codeobj__66);
  Py_CLEAR(clear_module_state->__pyx_codeobj__67);
  Py_CLEAR(clear_module_state->__pyx_codeobj__68);
  Py_CLEAR(clear_module_state->__pyx_codeobj__69);
  Py_CLEAR(clear_module_state->__pyx_codeobj__70);
  Py_CLEAR(clear_module_state->__pyx_codeobj__71);
  Py_CLEAR(clear_module_state->__pyx_codeobj__72);
  Py_CLEAR(clear_module_state->__pyx_codeobj__73);
  Py_CLEAR(clear_module_state->__pyx_codeobj__74);
  Py_CLEAR(clear_module_state->__pyx_codeobj__75);
  Py_CLEAR(clear_module_state->__pyx_codeobj__77);
  Py_CLEAR(clear_module_state->__pyx_codeobj__78);
  Py_CLEAR(clear_module_state->__pyx_codeobj__79);
  Py_CLEAR(clear_module_state->__pyx_codeobj__80);
  Py_CLEAR(clear_module_state->__pyx_codeobj__81);
  Py_CLEAR(clear_module_state->__pyx_codeobj__82);
  Py_CLEAR(clear_module_state->__pyx_codeobj__83);
  Py_CLEAR(clear_module_state->__pyx_codeobj__84);
  Py_CLEAR(clear_module_state->__pyx_codeobj__87);
  Py_CLEAR(clear_module_state->__pyx_codeobj__89);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_Network);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Accuracy);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Confidence_measure_not_implement);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Convolution_layer_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_10);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_11);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_12);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_13);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_14);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_4);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_5);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_6);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_7);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_8);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_9);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_l);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_s_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalDependencyNetwork_t_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork___reduce_cy);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork___setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__adjust_fea);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__adjust_wei);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__backpropag);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__calculate);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__calculate_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__calculate_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__create_con);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__create_pre);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__create_tar);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__generate_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__load_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__load_param);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__pre_taggin);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__reset_coun);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__sentence_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__shuffle_da);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__tag_senten);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__train_epoc);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__validate);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork__viterbi);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_create_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_description);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_load_from_f);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_save);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_set_validat);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_tag_sentenc);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConvolutionalNetwork_train);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Distance_table_sizes_target_and);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Feature_table_sizes);
  Py_VISIT(traverse_module_state->__pyx_n_s_FloatingPointError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Hidden_layer_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_Infinity);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Input_layer_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_Logger);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__backpropagate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__calculate_delta);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__calculate_gradients_sll);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__calculate_gradients_wll);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__create_sentence_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__load_parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__print_epoch_report);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__tag_sentence);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__train_epoch);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__validate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network__viterbi);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_create_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_decrease_learning_rates);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_description);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_load_from_file);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_save);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_set_learning_rate_decay);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_set_validation_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_tag_sentence);
  Py_VISIT(traverse_module_state->__pyx_n_s_Network_train);
  Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Output_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Saved_model);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Second_hidden_layer_size);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Sentence_accuracy);
  Py_VISIT(traverse_module_state->__pyx_n_s_T);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Token_accuracy);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Training_for_up_to_d_epochs);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Word_window_size);
  Py_VISIT(traverse_module_state->__pyx_n_s__161);
  Py_VISIT(traverse_module_state->__pyx_kp_u__23);
  Py_VISIT(traverse_module_state->__pyx_kp_u__5);
  Py_VISIT(traverse_module_state->__pyx_kp_u__6);
  Py_VISIT(traverse_module_state->__pyx_kp_u__76);
  Py_VISIT(traverse_module_state->__pyx_kp_u__86);
  Py_VISIT(traverse_module_state->__pyx_n_s__91);
  Py_VISIT(traverse_module_state->__pyx_n_s_add);
  Py_VISIT(traverse_module_state->__pyx_n_s_adjust_features);
  Py_VISIT(traverse_module_state->__pyx_n_s_adjust_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_all_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_allow_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_allow_repeats);
  Py_VISIT(traverse_module_state->__pyx_n_s_answer);
  Py_VISIT(traverse_module_state->__pyx_n_s_arange);
  Py_VISIT(traverse_module_state->__pyx_n_s_argmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_argument);
  Py_VISIT(traverse_module_state->__pyx_n_s_argument_blocks);
  Py_VISIT(traverse_module_state->__pyx_n_s_arguments);
  Py_VISIT(traverse_module_state->__pyx_n_s_array);
  Py_VISIT(traverse_module_state->__pyx_n_s_astype);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_average_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_axis);
  Py_VISIT(traverse_module_state->__pyx_n_s_backpropagate);
  Py_VISIT(traverse_module_state->__pyx_n_s_best_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_bincount);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_all_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_delta);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_gradients_classify);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_gradients_sll);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_gradients_wll);
  Py_VISIT(traverse_module_state->__pyx_n_s_calculate_input_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_clip);
  Py_VISIT(traverse_module_state->__pyx_n_u_clip);
  Py_VISIT(traverse_module_state->__pyx_n_s_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_cls);
  Py_VISIT(traverse_module_state->__pyx_n_s_column_numbers);
  Py_VISIT(traverse_module_state->__pyx_n_s_concatenate);
  Py_VISIT(traverse_module_state->__pyx_n_s_confidence);
  Py_VISIT(traverse_module_state->__pyx_n_s_conflicting_probs);
  Py_VISIT(traverse_module_state->__pyx_n_s_conflicting_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_contract_cycle);
  Py_VISIT(traverse_module_state->__pyx_n_s_convolution_max);
  Py_VISIT(traverse_module_state->__pyx_n_s_convolution_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_copy);
  Py_VISIT(traverse_module_state->__pyx_n_s_correct_path_score);
  Py_VISIT(traverse_module_state->__pyx_n_s_correction);
  Py_VISIT(traverse_module_state->__pyx_kp_u_corrections_skipped_Learning_ra);
  Py_VISIT(traverse_module_state->__pyx_kp_u_corrections_skipped_learning_ra);
  Py_VISIT(traverse_module_state->__pyx_n_s_count_nonzero);
  Py_VISIT(traverse_module_state->__pyx_n_s_counts);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_convolution_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_new_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_pred_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_sentence_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_target_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_cycle);
  Py_VISIT(traverse_module_state->__pyx_n_s_cycle_inds);
  Py_VISIT(traverse_module_state->__pyx_n_s_cycle_score);
  Py_VISIT(traverse_module_state->__pyx_n_s_cycles);
  Py_VISIT(traverse_module_state->__pyx_n_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_u_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_dCd_hidden2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dCd_tanh);
  Py_VISIT(traverse_module_state->__pyx_n_s_dCdf_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dCdf_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_debug);
  Py_VISIT(traverse_module_state->__pyx_n_s_decay_factor);
  Py_VISIT(traverse_module_state->__pyx_n_s_decrease_learning_rates);
  Py_VISIT(traverse_module_state->__pyx_n_s_delta);
  Py_VISIT(traverse_module_state->__pyx_n_s_delta_softmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_desc);
  Py_VISIT(traverse_module_state->__pyx_n_s_description);
  Py_VISIT(traverse_module_state->__pyx_n_s_desired_accuracy);
  Py_VISIT(traverse_module_state->__pyx_n_s_diagonal);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_features);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_features_per_token);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_pred_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_table_dims);
  Py_VISIT(traverse_module_state->__pyx_n_s_dist_target_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_dot);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
  Py_VISIT(traverse_module_state->__pyx_n_s_element);
  Py_VISIT(traverse_module_state->__pyx_n_s_embeddings);
  Py_VISIT(traverse_module_state->__pyx_n_s_empty);
  Py_VISIT(traverse_module_state->__pyx_n_s_empty_like);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
  Py_VISIT(traverse_module_state->__pyx_n_s_epoch);
  Py_VISIT(traverse_module_state->__pyx_n_s_epochs);
  Py_VISIT(traverse_module_state->__pyx_kp_u_epochs_Error);
  Py_VISIT(traverse_module_state->__pyx_n_s_epochs_between_reports);
  Py_VISIT(traverse_module_state->__pyx_n_s_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_exp);
  Py_VISIT(traverse_module_state->__pyx_n_s_exp_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_exp_sum);
  Py_VISIT(traverse_module_state->__pyx_n_s_exponentials);
  Py_VISIT(traverse_module_state->__pyx_n_u_f);
  Py_VISIT(traverse_module_state->__pyx_n_s_factor);
  Py_VISIT(traverse_module_state->__pyx_n_s_feature_tables);
  Py_VISIT(traverse_module_state->__pyx_n_u_feature_tables);
  Py_VISIT(traverse_module_state->__pyx_n_s_features);
  Py_VISIT(traverse_module_state->__pyx_n_s_filename);
  Py_VISIT(traverse_module_state->__pyx_n_s_fill_diagonal);
  Py_VISIT(traverse_module_state->__pyx_n_s_find_cycle_recursive);
  Py_VISIT(traverse_module_state->__pyx_n_s_find_cycles);
  Py_VISIT(traverse_module_state->__pyx_n_s_find_maximum_spanning_tree);
  Py_VISIT(traverse_module_state->__pyx_n_s_flatten);
  Py_VISIT(traverse_module_state->__pyx_n_s_float64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_generate_save_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_getLogger);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_gold_head);
  Py_VISIT(traverse_module_state->__pyx_n_s_gold_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_gold_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_grad_matrix);
  Py_VISIT(traverse_module_state->__pyx_n_s_grad_times_softmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_gradients_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_graph);
  Py_VISIT(traverse_module_state->__pyx_n_s_greater);
  Py_VISIT(traverse_module_state->__pyx_n_s_head);
  Py_VISIT(traverse_module_state->__pyx_n_s_head_to_v);
  Py_VISIT(traverse_module_state->__pyx_n_s_heads);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden1_bias);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden1_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden1_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden2_bias);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden2_bias);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden2_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden2_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden2_weights);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden2_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_bias);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden_bias);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_bias_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_hidden_weights);
  Py_VISIT(traverse_module_state->__pyx_n_u_hidden_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_high);
  Py_VISIT(traverse_module_state->__pyx_n_s_highest_prob_arg);
  Py_VISIT(traverse_module_state->__pyx_n_s_hits);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_i_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_incoming_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_ind_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_ind_to);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_inds);
  Py_VISIT(traverse_module_state->__pyx_n_s_info);
  Py_VISIT(traverse_module_state->__pyx_n_s_init);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_and_pred_dist_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_input_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_size_with_distance);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_j);
  Py_VISIT(traverse_module_state->__pyx_n_s_label);
  Py_VISIT(traverse_module_state->__pyx_n_s_labels);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_accuracy);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_token);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_less);
  Py_VISIT(traverse_module_state->__pyx_n_s_load);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_from_file);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_from_file_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_log);
  Py_VISIT(traverse_module_state->__pyx_n_s_log_sum_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_logadd);
  Py_VISIT(traverse_module_state->__pyx_n_s_logger);
  Py_VISIT(traverse_module_state->__pyx_n_s_logging);
  Py_VISIT(traverse_module_state->__pyx_n_s_logical_and);
  Py_VISIT(traverse_module_state->__pyx_n_s_logical_not);
  Py_VISIT(traverse_module_state->__pyx_n_s_logprob);
  Py_VISIT(traverse_module_state->__pyx_n_s_logprobs);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_max);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_incoming_inds);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_incoming_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_outgoing_inds);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_outgoing_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_net);
  Py_VISIT(traverse_module_state->__pyx_n_s_net_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_net_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_network_filename);
  Py_VISIT(traverse_module_state->__pyx_n_s_neuron_maxes);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_head);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_head_ind);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_shape);
  Py_VISIT(traverse_module_state->__pyx_n_s_next_vertex);
  Py_VISIT(traverse_module_state->__pyx_n_s_nltkor_tag_libs_network);
  Py_VISIT(traverse_module_state->__pyx_kp_s_nltkor_tag_libs_network_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_nltkor_tag_libs_networkconv_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_nltkor_tag_libs_networkdependenc);
  Py_VISIT(traverse_module_state->__pyx_n_s_nn);
  Py_VISIT(traverse_module_state->__pyx_n_s_np);
  Py_VISIT(traverse_module_state->__pyx_n_s_num);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_dims);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_dist_features);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_distances);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_tokens);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_vertices);
  Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
  Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to);
  Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor);
  Py_VISIT(traverse_module_state->__pyx_n_s_old_head);
  Py_VISIT(traverse_module_state->__pyx_n_s_other_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_outgoing_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_bias);
  Py_VISIT(traverse_module_state->__pyx_n_u_output_bias);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_bias_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_dim);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_output_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_weights);
  Py_VISIT(traverse_module_state->__pyx_n_u_output_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_outside);
  Py_VISIT(traverse_module_state->__pyx_n_s_outside_inds);
  Py_VISIT(traverse_module_state->__pyx_n_s_padded_sentence);
  Py_VISIT(traverse_module_state->__pyx_n_s_padding_left);
  Py_VISIT(traverse_module_state->__pyx_n_u_padding_left);
  Py_VISIT(traverse_module_state->__pyx_n_s_padding_right);
  Py_VISIT(traverse_module_state->__pyx_n_u_padding_right);
  Py_VISIT(traverse_module_state->__pyx_n_s_path_backtrack);
  Py_VISIT(traverse_module_state->__pyx_n_s_path_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_pos_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_pos_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_pos_padding);
  Py_VISIT(traverse_module_state->__pyx_n_s_pre_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_pre_dist);
  Py_VISIT(traverse_module_state->__pyx_n_s_pre_padding);
  Py_VISIT(traverse_module_state->__pyx_n_s_pre_tagging_setup);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_answer);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_arguments);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dist_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dist_indices);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dist_table);
  Py_VISIT(traverse_module_state->__pyx_n_u_pred_dist_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dist_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dist_weights);
  Py_VISIT(traverse_module_state->__pyx_n_u_pred_dist_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_dists);
  Py_VISIT(traverse_module_state->__pyx_n_s_pred_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_predicate);
  Py_VISIT(traverse_module_state->__pyx_n_s_predicate_answer);
  Py_VISIT(traverse_module_state->__pyx_n_s_predicate_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_predicates);
  Py_VISIT(traverse_module_state->__pyx_n_s_prev_score_and_trans);
  Py_VISIT(traverse_module_state->__pyx_n_s_previous_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_print_epoch_report);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_ConvolutionalDepe);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_ConvolutionalNetw);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Network);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_random);
  Py_VISIT(traverse_module_state->__pyx_n_s_random_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_ravel);
  Py_VISIT(traverse_module_state->__pyx_n_s_reachable);
  Py_VISIT(traverse_module_state->__pyx_n_s_reachable_vertices);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_counters);
  Py_VISIT(traverse_module_state->__pyx_n_s_reshape);
  Py_VISIT(traverse_module_state->__pyx_n_s_rollaxis);
  Py_VISIT(traverse_module_state->__pyx_n_s_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_save);
  Py_VISIT(traverse_module_state->__pyx_n_s_savez);
  Py_VISIT(traverse_module_state->__pyx_n_s_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_send);
  Py_VISIT(traverse_module_state->__pyx_n_s_sent);
  Py_VISIT(traverse_module_state->__pyx_n_s_sent_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_sent_preds);
  Py_VISIT(traverse_module_state->__pyx_n_s_sent_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_sentence);
  Py_VISIT(traverse_module_state->__pyx_n_s_sentence_convolution);
  Py_VISIT(traverse_module_state->__pyx_n_s_sentence_hit);
  Py_VISIT(traverse_module_state->__pyx_n_s_sentence_hits);
  Py_VISIT(traverse_module_state->__pyx_n_s_sentences);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_learning_rate_decay);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_validation_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_shape);
  Py_VISIT(traverse_module_state->__pyx_n_s_shift);
  Py_VISIT(traverse_module_state->__pyx_n_s_shuffle);
  Py_VISIT(traverse_module_state->__pyx_n_s_shuffle_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_sqrt);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_start_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_sum);
  Py_VISIT(traverse_module_state->__pyx_n_s_sumlogadd);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_table_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_table_dims);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_sentence);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_sentence_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_sentence_labeled_dependency);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_sentence_unlabeled_dependen);
  Py_VISIT(traverse_module_state->__pyx_n_s_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_take);
  Py_VISIT(traverse_module_state->__pyx_n_s_target);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dist_gradients);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dist_indices);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dist_table);
  Py_VISIT(traverse_module_state->__pyx_n_u_target_dist_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dist_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dist_weights);
  Py_VISIT(traverse_module_state->__pyx_n_u_target_dist_weights);
  Py_VISIT(traverse_module_state->__pyx_n_s_target_dists);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_throw);
  Py_VISIT(traverse_module_state->__pyx_n_s_tile);
  Py_VISIT(traverse_module_state->__pyx_n_s_token);
  Py_VISIT(traverse_module_state->__pyx_n_s_token_indices);
  Py_VISIT(traverse_module_state->__pyx_n_s_token_scores);
  Py_VISIT(traverse_module_state->__pyx_n_s_top_accuracy);
  Py_VISIT(traverse_module_state->__pyx_n_s_train);
  Py_VISIT(traverse_module_state->__pyx_n_s_train_epoch);
  Py_VISIT(traverse_module_state->__pyx_n_s_train_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_training);
  Py_VISIT(traverse_module_state->__pyx_n_s_trans);
  Py_VISIT(traverse_module_state->__pyx_n_s_transitions);
  Py_VISIT(traverse_module_state->__pyx_n_u_transitions);
  Py_VISIT(traverse_module_state->__pyx_n_s_transitions_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_uniform);
  Py_VISIT(traverse_module_state->__pyx_n_s_unreachable);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_validate);
  Py_VISIT(traverse_module_state->__pyx_n_s_validate_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_validation_arguments);
  Py_VISIT(traverse_module_state->__pyx_n_s_validation_predicates);
  Py_VISIT(traverse_module_state->__pyx_n_s_validation_sentences);
  Py_VISIT(traverse_module_state->__pyx_n_s_validation_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_vertex);
  Py_VISIT(traverse_module_state->__pyx_n_s_vertex_leaving_cycle);
  Py_VISIT(traverse_module_state->__pyx_n_s_vertex_leaving_cycle_ind);
  Py_VISIT(traverse_module_state->__pyx_n_s_vertices_in_cycles);
  Py_VISIT(traverse_module_state->__pyx_n_s_visited);
  Py_VISIT(traverse_module_state->__pyx_n_s_viterbi);
  Py_VISIT(traverse_module_state->__pyx_n_s_vstack);
  Py_VISIT(traverse_module_state->__pyx_n_s_w_deltas);
  Py_VISIT(traverse_module_state->__pyx_n_s_where);
  Py_VISIT(traverse_module_state->__pyx_n_s_window);
  Py_VISIT(traverse_module_state->__pyx_n_s_window_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_window_to);
  Py_VISIT(traverse_module_state->__pyx_n_s_word_window);
  Py_VISIT(traverse_module_state->__pyx_n_s_word_window_size);
  Py_VISIT(traverse_module_state->__pyx_n_u_word_window_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_x);
  Py_VISIT(traverse_module_state->__pyx_n_s_xrange);
  Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
  Py_VISIT(traverse_module_state->__pyx_n_s_zeros_like);
  Py_VISIT(traverse_module_state->__pyx_n_s_zip);
  Py_VISIT(traverse_module_state->__pyx_float_0_0);
  Py_VISIT(traverse_module_state->__pyx_float_1_0);
  Py_VISIT(traverse_module_state->__pyx_float_0_01);
  Py_VISIT(traverse_module_state->__pyx_float_2_38);
  Py_VISIT(traverse_module_state->__pyx_float_neg_1_0);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_27816595);
  Py_VISIT(traverse_module_state->__pyx_int_49696698);
  Py_VISIT(traverse_module_state->__pyx_int_119830996);
  Py_VISIT(traverse_module_state->__pyx_int_145891266);
  Py_VISIT(traverse_module_state->__pyx_int_148123145);
  Py_VISIT(traverse_module_state->__pyx_int_149446146);
  Py_VISIT(traverse_module_state->__pyx_int_202246394);
  Py_VISIT(traverse_module_state->__pyx_int_212151326);
  Py_VISIT(traverse_module_state->__pyx_int_220499725);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1);
  Py_VISIT(traverse_module_state->__pyx_int_neg_2);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1000);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_slice__8);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_slice__12);
  Py_VISIT(traverse_module_state->__pyx_slice__14);
  Py_VISIT(traverse_module_state->__pyx_slice__56);
  Py_VISIT(traverse_module_state->__pyx_slice__59);
  Py_VISIT(traverse_module_state->__pyx_tuple__15);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__88);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__94);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__97);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_tuple__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__3);
  Py_VISIT(traverse_module_state->__pyx_codeobj__4);
  Py_VISIT(traverse_module_state->__pyx_codeobj__7);
  Py_VISIT(traverse_module_state->__pyx_codeobj__9);
  Py_VISIT(traverse_module_state->__pyx_tuple__100);
  Py_VISIT(traverse_module_state->__pyx_tuple__101);
  Py_VISIT(traverse_module_state->__pyx_tuple__102);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__104);
  Py_VISIT(traverse_module_state->__pyx_tuple__105);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__107);
  Py_VISIT(traverse_module_state->__pyx_tuple__108);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__110);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__112);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__114);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__116);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__118);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__120);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__122);
  Py_VISIT(traverse_module_state->__pyx_tuple__123);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__125);
  Py_VISIT(traverse_module_state->__pyx_tuple__126);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__128);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__130);
  Py_VISIT(traverse_module_state->__pyx_tuple__131);
  Py_VISIT(traverse_module_state->__pyx_tuple__132);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__134);
  Py_VISIT(traverse_module_state->__pyx_tuple__135);
  Py_VISIT(traverse_module_state->__pyx_tuple__136);
  Py_VISIT(traverse_module_state->__pyx_tuple__137);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__139);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__141);
  Py_VISIT(traverse_module_state->__pyx_tuple__142);
  Py_VISIT(traverse_module_state->__pyx_tuple__143);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__145);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__147);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__150);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__153);
  Py_VISIT(traverse_module_state->__pyx_tuple__154);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__156);
  Py_VISIT(traverse_module_state->__pyx_tuple__157);
  Py_VISIT(traverse_module_state->__pyx_tuple__158);
  Py_VISIT(traverse_module_state->__pyx_tuple__159);
  Py_VISIT(traverse_module_state->__pyx_tuple__160);
  Py_VISIT(traverse_module_state->__pyx_codeobj__10);
  Py_VISIT(traverse_module_state->__pyx_codeobj__11);
  Py_VISIT(traverse_module_state->__pyx_codeobj__13);
  Py_VISIT(traverse_module_state->__pyx_codeobj__16);
  Py_VISIT(traverse_module_state->__pyx_codeobj__17);
  Py_VISIT(traverse_module_state->__pyx_codeobj__18);
  Py_VISIT(traverse_module_state->__pyx_codeobj__19);
  Py_VISIT(traverse_module_state->__pyx_codeobj__20);
  Py_VISIT(traverse_module_state->__pyx_codeobj__21);
  Py_VISIT(traverse_module_state->__pyx_codeobj__22);
  Py_VISIT(traverse_module_state->__pyx_codeobj__24);
  Py_VISIT(traverse_module_state->__pyx_codeobj__25);
  Py_VISIT(traverse_module_state->__pyx_codeobj__26);
  Py_VISIT(traverse_module_state->__pyx_codeobj__27);
  Py_VISIT(traverse_module_state->__pyx_codeobj__28);
  Py_VISIT(traverse_module_state->__pyx_codeobj__29);
  Py_VISIT(traverse_module_state->__pyx_codeobj__30);
  Py_VISIT(traverse_module_state->__pyx_codeobj__31);
  Py_VISIT(traverse_module_state->__pyx_codeobj__32);
  Py_VISIT(traverse_module_state->__pyx_codeobj__33);
  Py_VISIT(traverse_module_state->__pyx_codeobj__34);
  Py_VISIT(traverse_module_state->__pyx_codeobj__35);
  Py_VISIT(traverse_module_state->__pyx_codeobj__36);
  Py_VISIT(traverse_module_state->__pyx_codeobj__37);
  Py_VISIT(traverse_module_state->__pyx_codeobj__38);
  Py_VISIT(traverse_module_state->__pyx_codeobj__39);
  Py_VISIT(traverse_module_state->__pyx_codeobj__40);
  Py_VISIT(traverse_module_state->__pyx_codeobj__41);
  Py_VISIT(traverse_module_state->__pyx_codeobj__42);
  Py_VISIT(traverse_module_state->__pyx_codeobj__43);
  Py_VISIT(traverse_module_state->__pyx_codeobj__44);
  Py_VISIT(traverse_module_state->__pyx_codeobj__45);
  Py_VISIT(traverse_module_state->__pyx_codeobj__46);
  Py_VISIT(traverse_module_state->__pyx_codeobj__47);
  Py_VISIT(traverse_module_state->__pyx_codeobj__49);
  Py_VISIT(traverse_module_state->__pyx_codeobj__50);
  Py_VISIT(traverse_module_state->__pyx_codeobj__51);
  Py_VISIT(traverse_module_state->__pyx_codeobj__52);
  Py_VISIT(traverse_module_state->__pyx_codeobj__53);
  Py_VISIT(traverse_module_state->__pyx_codeobj__54);
  Py_VISIT(traverse_module_state->__pyx_codeobj__55);
  Py_VISIT(traverse_module_state->__pyx_codeobj__58);
  Py_VISIT(traverse_module_state->__pyx_codeobj__60);
  Py_VISIT(traverse_module_state->__pyx_codeobj__61);
  Py_VISIT(traverse_module_state->__pyx_codeobj__62);
  Py_VISIT(traverse_module_state->__pyx_codeobj__63);
  Py_VISIT(traverse_module_state->__pyx_codeobj__64);
  Py_VISIT(traverse_module_state->__pyx_codeobj__65);
  Py_VISIT(traverse_module_state->__pyx_codeobj__66);
  Py_VISIT(traverse_module_state->__pyx_codeobj__67);
  Py_VISIT(traverse_module_state->__pyx_codeobj__68);
  Py_VISIT(traverse_module_state->__pyx_codeobj__69);
  Py_VISIT(traverse_module_state->__pyx_codeobj__70);
  Py_VISIT(traverse_module_state->__pyx_codeobj__71);
  Py_VISIT(traverse_module_state->__pyx_codeobj__72);
  Py_VISIT(traverse_module_state->__pyx_codeobj__73);
  Py_VISIT(traverse_module_state->__pyx_codeobj__74);
  Py_VISIT(traverse_module_state->__pyx_codeobj__75);
  Py_VISIT(traverse_module_state->__pyx_codeobj__77);
  Py_VISIT(traverse_module_state->__pyx_codeobj__78);
  Py_VISIT(traverse_module_state->__pyx_codeobj__79);
  Py_VISIT(traverse_module_state->__pyx_codeobj__80);
  Py_VISIT(traverse_module_state->__pyx_codeobj__81);
  Py_VISIT(traverse_module_state->__pyx_codeobj__82);
  Py_VISIT(traverse_module_state->__pyx_codeobj__83);
  Py_VISIT(traverse_module_state->__pyx_codeobj__84);
  Py_VISIT(traverse_module_state->__pyx_codeobj__87);
  Py_VISIT(traverse_module_state->__pyx_codeobj__89);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_6nltkor_3tag_4libs_7network_Network __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network_Network
#define __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork
#define __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork
#define __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr
#define __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr
#define __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr
#define __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr
#define __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr
#endif
#define __pyx_ptype_6nltkor_3tag_4libs_7network_Network __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network
#define __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork
#define __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork
#define __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr
#define __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr
#define __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr
#define __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr
#define __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr
#define __pyx_kp_u_Accuracy __pyx_mstate_global->__pyx_kp_u_Accuracy
#define __pyx_kp_u_Confidence_measure_not_implement __pyx_mstate_global->__pyx_kp_u_Confidence_measure_not_implement
#define __pyx_kp_u_Convolution_layer_size __pyx_mstate_global->__pyx_kp_u_Convolution_layer_size
#define __pyx_n_s_ConvolutionalDependencyNetwork __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork
#define __pyx_n_s_ConvolutionalDependencyNetwork_10 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_10
#define __pyx_n_s_ConvolutionalDependencyNetwork_11 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_11
#define __pyx_n_s_ConvolutionalDependencyNetwork_12 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_12
#define __pyx_n_s_ConvolutionalDependencyNetwork_13 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_13
#define __pyx_n_s_ConvolutionalDependencyNetwork_14 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_14
#define __pyx_n_s_ConvolutionalDependencyNetwork_2 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_2
#define __pyx_n_s_ConvolutionalDependencyNetwork_3 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_3
#define __pyx_n_s_ConvolutionalDependencyNetwork_4 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_4
#define __pyx_n_s_ConvolutionalDependencyNetwork_5 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_5
#define __pyx_n_s_ConvolutionalDependencyNetwork_6 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_6
#define __pyx_n_s_ConvolutionalDependencyNetwork_7 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_7
#define __pyx_n_s_ConvolutionalDependencyNetwork_8 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_8
#define __pyx_n_s_ConvolutionalDependencyNetwork_9 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_9
#define __pyx_n_s_ConvolutionalDependencyNetwork_l __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_l
#define __pyx_n_s_ConvolutionalDependencyNetwork_s __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_s
#define __pyx_n_s_ConvolutionalDependencyNetwork_s_2 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_s_2
#define __pyx_n_s_ConvolutionalDependencyNetwork_t __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_t
#define __pyx_n_s_ConvolutionalDependencyNetwork_t_2 __pyx_mstate_global->__pyx_n_s_ConvolutionalDependencyNetwork_t_2
#define __pyx_n_s_ConvolutionalNetwork __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork
#define __pyx_n_s_ConvolutionalNetwork___reduce_cy __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork___reduce_cy
#define __pyx_n_s_ConvolutionalNetwork___setstate __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork___setstate
#define __pyx_n_s_ConvolutionalNetwork__adjust_fea __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__adjust_fea
#define __pyx_n_s_ConvolutionalNetwork__adjust_wei __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__adjust_wei
#define __pyx_n_s_ConvolutionalNetwork__backpropag __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__backpropag
#define __pyx_n_s_ConvolutionalNetwork__calculate __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__calculate
#define __pyx_n_s_ConvolutionalNetwork__calculate_2 __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__calculate_2
#define __pyx_n_s_ConvolutionalNetwork__calculate_3 __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__calculate_3
#define __pyx_n_s_ConvolutionalNetwork__create_con __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__create_con
#define __pyx_n_s_ConvolutionalNetwork__create_pre __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__create_pre
#define __pyx_n_s_ConvolutionalNetwork__create_tar __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__create_tar
#define __pyx_n_s_ConvolutionalNetwork__generate_s __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__generate_s
#define __pyx_n_s_ConvolutionalNetwork__load_from __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__load_from
#define __pyx_n_s_ConvolutionalNetwork__load_param __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__load_param
#define __pyx_n_s_ConvolutionalNetwork__pre_taggin __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__pre_taggin
#define __pyx_n_s_ConvolutionalNetwork__reset_coun __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__reset_coun
#define __pyx_n_s_ConvolutionalNetwork__sentence_c __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__sentence_c
#define __pyx_n_s_ConvolutionalNetwork__shuffle_da __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__shuffle_da
#define __pyx_n_s_ConvolutionalNetwork__tag_senten __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__tag_senten
#define __pyx_n_s_ConvolutionalNetwork__train_epoc __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__train_epoc
#define __pyx_n_s_ConvolutionalNetwork__validate __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__validate
#define __pyx_n_s_ConvolutionalNetwork__viterbi __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork__viterbi
#define __pyx_n_s_ConvolutionalNetwork_create_new __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_create_new
#define __pyx_n_s_ConvolutionalNetwork_description __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_description
#define __pyx_n_s_ConvolutionalNetwork_load_from_f __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_load_from_f
#define __pyx_n_s_ConvolutionalNetwork_save __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_save
#define __pyx_n_s_ConvolutionalNetwork_set_validat __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_set_validat
#define __pyx_n_s_ConvolutionalNetwork_tag_sentenc __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_tag_sentenc
#define __pyx_n_s_ConvolutionalNetwork_train __pyx_mstate_global->__pyx_n_s_ConvolutionalNetwork_train
#define __pyx_kp_u_Distance_table_sizes_target_and __pyx_mstate_global->__pyx_kp_u_Distance_table_sizes_target_and
#define __pyx_kp_u_Feature_table_sizes __pyx_mstate_global->__pyx_kp_u_Feature_table_sizes
#define __pyx_n_s_FloatingPointError __pyx_mstate_global->__pyx_n_s_FloatingPointError
#define __pyx_kp_u_Hidden_layer_size __pyx_mstate_global->__pyx_kp_u_Hidden_layer_size
#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3
#define __pyx_n_s_Infinity __pyx_mstate_global->__pyx_n_s_Infinity
#define __pyx_kp_u_Input_layer_size __pyx_mstate_global->__pyx_kp_u_Input_layer_size
#define __pyx_n_u_Logger __pyx_mstate_global->__pyx_n_u_Logger
#define __pyx_n_s_Network __pyx_mstate_global->__pyx_n_s_Network
#define __pyx_n_s_Network___reduce_cython __pyx_mstate_global->__pyx_n_s_Network___reduce_cython
#define __pyx_n_s_Network___setstate_cython __pyx_mstate_global->__pyx_n_s_Network___setstate_cython
#define __pyx_n_s_Network__backpropagate __pyx_mstate_global->__pyx_n_s_Network__backpropagate
#define __pyx_n_s_Network__calculate_delta __pyx_mstate_global->__pyx_n_s_Network__calculate_delta
#define __pyx_n_s_Network__calculate_gradients_sll __pyx_mstate_global->__pyx_n_s_Network__calculate_gradients_sll
#define __pyx_n_s_Network__calculate_gradients_wll __pyx_mstate_global->__pyx_n_s_Network__calculate_gradients_wll
#define __pyx_n_s_Network__create_sentence_lookup __pyx_mstate_global->__pyx_n_s_Network__create_sentence_lookup
#define __pyx_n_s_Network__load_parameters __pyx_mstate_global->__pyx_n_s_Network__load_parameters
#define __pyx_n_s_Network__print_epoch_report __pyx_mstate_global->__pyx_n_s_Network__print_epoch_report
#define __pyx_n_s_Network__tag_sentence __pyx_mstate_global->__pyx_n_s_Network__tag_sentence
#define __pyx_n_s_Network__train_epoch __pyx_mstate_global->__pyx_n_s_Network__train_epoch
#define __pyx_n_s_Network__validate __pyx_mstate_global->__pyx_n_s_Network__validate
#define __pyx_n_s_Network__viterbi __pyx_mstate_global->__pyx_n_s_Network__viterbi
#define __pyx_n_s_Network_create_new __pyx_mstate_global->__pyx_n_s_Network_create_new
#define __pyx_n_s_Network_decrease_learning_rates __pyx_mstate_global->__pyx_n_s_Network_decrease_learning_rates
#define __pyx_n_s_Network_description __pyx_mstate_global->__pyx_n_s_Network_description
#define __pyx_n_s_Network_load_from_file __pyx_mstate_global->__pyx_n_s_Network_load_from_file
#define __pyx_n_s_Network_save __pyx_mstate_global->__pyx_n_s_Network_save
#define __pyx_n_s_Network_set_learning_rate_decay __pyx_mstate_global->__pyx_n_s_Network_set_learning_rate_decay
#define __pyx_n_s_Network_set_validation_data __pyx_mstate_global->__pyx_n_s_Network_set_validation_data
#define __pyx_n_s_Network_tag_sentence __pyx_mstate_global->__pyx_n_s_Network_tag_sentence
#define __pyx_n_s_Network_train __pyx_mstate_global->__pyx_n_s_Network_train
#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
#define __pyx_kp_u_Output_size __pyx_mstate_global->__pyx_kp_u_Output_size
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_kp_u_Saved_model __pyx_mstate_global->__pyx_kp_u_Saved_model
#define __pyx_kp_u_Second_hidden_layer_size __pyx_mstate_global->__pyx_kp_u_Second_hidden_layer_size
#define __pyx_kp_u_Sentence_accuracy __pyx_mstate_global->__pyx_kp_u_Sentence_accuracy
#define __pyx_n_s_T __pyx_mstate_global->__pyx_n_s_T
#define __pyx_kp_u_Token_accuracy __pyx_mstate_global->__pyx_kp_u_Token_accuracy
#define __pyx_kp_u_Training_for_up_to_d_epochs __pyx_mstate_global->__pyx_kp_u_Training_for_up_to_d_epochs
#define __pyx_kp_u_Word_window_size __pyx_mstate_global->__pyx_kp_u_Word_window_size
#define __pyx_n_s__161 __pyx_mstate_global->__pyx_n_s__161
#define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23
#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5
#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
#define __pyx_kp_u__76 __pyx_mstate_global->__pyx_kp_u__76
#define __pyx_kp_u__86 __pyx_mstate_global->__pyx_kp_u__86
#define __pyx_n_s__91 __pyx_mstate_global->__pyx_n_s__91
#define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add
#define __pyx_n_s_adjust_features __pyx_mstate_global->__pyx_n_s_adjust_features
#define __pyx_n_s_adjust_weights __pyx_mstate_global->__pyx_n_s_adjust_weights
#define __pyx_n_s_all_scores __pyx_mstate_global->__pyx_n_s_all_scores
#define __pyx_n_s_allow_pickle __pyx_mstate_global->__pyx_n_s_allow_pickle
#define __pyx_n_s_allow_repeats __pyx_mstate_global->__pyx_n_s_allow_repeats
#define __pyx_n_s_answer __pyx_mstate_global->__pyx_n_s_answer
#define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange
#define __pyx_n_s_argmax __pyx_mstate_global->__pyx_n_s_argmax
#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
#define __pyx_n_s_argument __pyx_mstate_global->__pyx_n_s_argument
#define __pyx_n_s_argument_blocks __pyx_mstate_global->__pyx_n_s_argument_blocks
#define __pyx_n_s_arguments __pyx_mstate_global->__pyx_n_s_arguments
#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
#define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_average_error __pyx_mstate_global->__pyx_n_s_average_error
#define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis
#define __pyx_n_s_backpropagate __pyx_mstate_global->__pyx_n_s_backpropagate
#define __pyx_n_s_best_scores __pyx_mstate_global->__pyx_n_s_best_scores
#define __pyx_n_s_bincount __pyx_mstate_global->__pyx_n_s_bincount
#define __pyx_n_s_calculate_all_scores __pyx_mstate_global->__pyx_n_s_calculate_all_scores
#define __pyx_n_s_calculate_delta __pyx_mstate_global->__pyx_n_s_calculate_delta
#define __pyx_n_s_calculate_gradients __pyx_mstate_global->__pyx_n_s_calculate_gradients
#define __pyx_n_s_calculate_gradients_classify __pyx_mstate_global->__pyx_n_s_calculate_gradients_classify
#define __pyx_n_s_calculate_gradients_sll __pyx_mstate_global->__pyx_n_s_calculate_gradients_sll
#define __pyx_n_s_calculate_gradients_wll __pyx_mstate_global->__pyx_n_s_calculate_gradients_wll
#define __pyx_n_s_calculate_input_deltas __pyx_mstate_global->__pyx_n_s_calculate_input_deltas
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip
#define __pyx_n_u_clip __pyx_mstate_global->__pyx_n_u_clip
#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls
#define __pyx_n_s_column_numbers __pyx_mstate_global->__pyx_n_s_column_numbers
#define __pyx_n_s_concatenate __pyx_mstate_global->__pyx_n_s_concatenate
#define __pyx_n_s_confidence __pyx_mstate_global->__pyx_n_s_confidence
#define __pyx_n_s_conflicting_probs __pyx_mstate_global->__pyx_n_s_conflicting_probs
#define __pyx_n_s_conflicting_tag __pyx_mstate_global->__pyx_n_s_conflicting_tag
#define __pyx_n_s_contract_cycle __pyx_mstate_global->__pyx_n_s_contract_cycle
#define __pyx_n_s_convolution_max __pyx_mstate_global->__pyx_n_s_convolution_max
#define __pyx_n_s_convolution_values __pyx_mstate_global->__pyx_n_s_convolution_values
#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy
#define __pyx_n_s_correct_path_score __pyx_mstate_global->__pyx_n_s_correct_path_score
#define __pyx_n_s_correction __pyx_mstate_global->__pyx_n_s_correction
#define __pyx_kp_u_corrections_skipped_Learning_ra __pyx_mstate_global->__pyx_kp_u_corrections_skipped_Learning_ra
#define __pyx_kp_u_corrections_skipped_learning_ra __pyx_mstate_global->__pyx_kp_u_corrections_skipped_learning_ra
#define __pyx_n_s_count_nonzero __pyx_mstate_global->__pyx_n_s_count_nonzero
#define __pyx_n_s_counts __pyx_mstate_global->__pyx_n_s_counts
#define __pyx_n_s_create_convolution_lookup __pyx_mstate_global->__pyx_n_s_create_convolution_lookup
#define __pyx_n_s_create_new __pyx_mstate_global->__pyx_n_s_create_new
#define __pyx_n_s_create_new_locals_genexpr __pyx_mstate_global->__pyx_n_s_create_new_locals_genexpr
#define __pyx_n_s_create_pred_lookup __pyx_mstate_global->__pyx_n_s_create_pred_lookup
#define __pyx_n_s_create_sentence_lookup __pyx_mstate_global->__pyx_n_s_create_sentence_lookup
#define __pyx_n_s_create_target_lookup __pyx_mstate_global->__pyx_n_s_create_target_lookup
#define __pyx_n_s_cycle __pyx_mstate_global->__pyx_n_s_cycle
#define __pyx_n_s_cycle_inds __pyx_mstate_global->__pyx_n_s_cycle_inds
#define __pyx_n_s_cycle_score __pyx_mstate_global->__pyx_n_s_cycle_score
#define __pyx_n_s_cycles __pyx_mstate_global->__pyx_n_s_cycles
#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
#define __pyx_n_s_dCd_hidden2 __pyx_mstate_global->__pyx_n_s_dCd_hidden2
#define __pyx_n_s_dCd_tanh __pyx_mstate_global->__pyx_n_s_dCd_tanh
#define __pyx_n_s_dCdf_2 __pyx_mstate_global->__pyx_n_s_dCdf_2
#define __pyx_n_s_dCdf_3 __pyx_mstate_global->__pyx_n_s_dCdf_3
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_n_s_debug __pyx_mstate_global->__pyx_n_s_debug
#define __pyx_n_s_decay_factor __pyx_mstate_global->__pyx_n_s_decay_factor
#define __pyx_n_s_decrease_learning_rates __pyx_mstate_global->__pyx_n_s_decrease_learning_rates
#define __pyx_n_s_delta __pyx_mstate_global->__pyx_n_s_delta
#define __pyx_n_s_delta_softmax __pyx_mstate_global->__pyx_n_s_delta_softmax
#define __pyx_n_s_deltas __pyx_mstate_global->__pyx_n_s_deltas
#define __pyx_n_s_desc __pyx_mstate_global->__pyx_n_s_desc
#define __pyx_n_s_description __pyx_mstate_global->__pyx_n_s_description
#define __pyx_n_s_desired_accuracy __pyx_mstate_global->__pyx_n_s_desired_accuracy
#define __pyx_n_s_diagonal __pyx_mstate_global->__pyx_n_s_diagonal
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_dist_deltas __pyx_mstate_global->__pyx_n_s_dist_deltas
#define __pyx_n_s_dist_features __pyx_mstate_global->__pyx_n_s_dist_features
#define __pyx_n_s_dist_features_per_token __pyx_mstate_global->__pyx_n_s_dist_features_per_token
#define __pyx_n_s_dist_pred_from __pyx_mstate_global->__pyx_n_s_dist_pred_from
#define __pyx_n_s_dist_table_dims __pyx_mstate_global->__pyx_n_s_dist_table_dims
#define __pyx_n_s_dist_target_from __pyx_mstate_global->__pyx_n_s_dist_target_from
#define __pyx_n_s_dot __pyx_mstate_global->__pyx_n_s_dot
#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
#define __pyx_n_s_element __pyx_mstate_global->__pyx_n_s_element
#define __pyx_n_s_embeddings __pyx_mstate_global->__pyx_n_s_embeddings
#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
#define __pyx_n_s_empty_like __pyx_mstate_global->__pyx_n_s_empty_like
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end
#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
#define __pyx_n_s_epoch __pyx_mstate_global->__pyx_n_s_epoch
#define __pyx_n_s_epochs __pyx_mstate_global->__pyx_n_s_epochs
#define __pyx_kp_u_epochs_Error __pyx_mstate_global->__pyx_kp_u_epochs_Error
#define __pyx_n_s_epochs_between_reports __pyx_mstate_global->__pyx_n_s_epochs_between_reports
#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
#define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp
#define __pyx_n_s_exp_scores __pyx_mstate_global->__pyx_n_s_exp_scores
#define __pyx_n_s_exp_sum __pyx_mstate_global->__pyx_n_s_exp_sum
#define __pyx_n_s_exponentials __pyx_mstate_global->__pyx_n_s_exponentials
#define __pyx_n_u_f __pyx_mstate_global->__pyx_n_u_f
#define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor
#define __pyx_n_s_feature_tables __pyx_mstate_global->__pyx_n_s_feature_tables
#define __pyx_n_u_feature_tables __pyx_mstate_global->__pyx_n_u_feature_tables
#define __pyx_n_s_features __pyx_mstate_global->__pyx_n_s_features
#define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename
#define __pyx_n_s_fill_diagonal __pyx_mstate_global->__pyx_n_s_fill_diagonal
#define __pyx_n_s_find_cycle_recursive __pyx_mstate_global->__pyx_n_s_find_cycle_recursive
#define __pyx_n_s_find_cycles __pyx_mstate_global->__pyx_n_s_find_cycles
#define __pyx_n_s_find_maximum_spanning_tree __pyx_mstate_global->__pyx_n_s_find_maximum_spanning_tree
#define __pyx_n_s_flatten __pyx_mstate_global->__pyx_n_s_flatten
#define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_generate_save_dict __pyx_mstate_global->__pyx_n_s_generate_save_dict
#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr
#define __pyx_n_s_getLogger __pyx_mstate_global->__pyx_n_s_getLogger
#define __pyx_n_s_get_state __pyx_mstate_global->__pyx_n_s_get_state
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_n_s_gold_head __pyx_mstate_global->__pyx_n_s_gold_head
#define __pyx_n_s_gold_tag __pyx_mstate_global->__pyx_n_s_gold_tag
#define __pyx_n_s_gold_tags __pyx_mstate_global->__pyx_n_s_gold_tags
#define __pyx_n_s_grad_matrix __pyx_mstate_global->__pyx_n_s_grad_matrix
#define __pyx_n_s_grad_times_softmax __pyx_mstate_global->__pyx_n_s_grad_times_softmax
#define __pyx_n_s_gradients __pyx_mstate_global->__pyx_n_s_gradients
#define __pyx_n_s_gradients_t __pyx_mstate_global->__pyx_n_s_gradients_t
#define __pyx_n_s_graph __pyx_mstate_global->__pyx_n_s_graph
#define __pyx_n_s_greater __pyx_mstate_global->__pyx_n_s_greater
#define __pyx_n_s_head __pyx_mstate_global->__pyx_n_s_head
#define __pyx_n_s_head_to_v __pyx_mstate_global->__pyx_n_s_head_to_v
#define __pyx_n_s_heads __pyx_mstate_global->__pyx_n_s_heads
#define __pyx_n_s_hidden1_bias __pyx_mstate_global->__pyx_n_s_hidden1_bias
#define __pyx_n_s_hidden1_size __pyx_mstate_global->__pyx_n_s_hidden1_size
#define __pyx_n_s_hidden1_weights __pyx_mstate_global->__pyx_n_s_hidden1_weights
#define __pyx_n_s_hidden2_bias __pyx_mstate_global->__pyx_n_s_hidden2_bias
#define __pyx_n_u_hidden2_bias __pyx_mstate_global->__pyx_n_u_hidden2_bias
#define __pyx_n_s_hidden2_size __pyx_mstate_global->__pyx_n_s_hidden2_size
#define __pyx_n_u_hidden2_size __pyx_mstate_global->__pyx_n_u_hidden2_size
#define __pyx_n_s_hidden2_weights __pyx_mstate_global->__pyx_n_s_hidden2_weights
#define __pyx_n_u_hidden2_weights __pyx_mstate_global->__pyx_n_u_hidden2_weights
#define __pyx_n_s_hidden_bias __pyx_mstate_global->__pyx_n_s_hidden_bias
#define __pyx_n_u_hidden_bias __pyx_mstate_global->__pyx_n_u_hidden_bias
#define __pyx_n_s_hidden_bias_deltas __pyx_mstate_global->__pyx_n_s_hidden_bias_deltas
#define __pyx_n_s_hidden_deltas __pyx_mstate_global->__pyx_n_s_hidden_deltas
#define __pyx_n_s_hidden_gradients __pyx_mstate_global->__pyx_n_s_hidden_gradients
#define __pyx_n_s_hidden_size __pyx_mstate_global->__pyx_n_s_hidden_size
#define __pyx_n_u_hidden_size __pyx_mstate_global->__pyx_n_u_hidden_size
#define __pyx_n_s_hidden_weights __pyx_mstate_global->__pyx_n_s_hidden_weights
#define __pyx_n_u_hidden_weights __pyx_mstate_global->__pyx_n_u_hidden_weights
#define __pyx_n_s_high __pyx_mstate_global->__pyx_n_s_high
#define __pyx_n_s_highest_prob_arg __pyx_mstate_global->__pyx_n_s_highest_prob_arg
#define __pyx_n_s_hits __pyx_mstate_global->__pyx_n_s_hits
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_i_args __pyx_mstate_global->__pyx_n_s_i_args
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_incoming_weights __pyx_mstate_global->__pyx_n_s_incoming_weights
#define __pyx_n_s_ind_from __pyx_mstate_global->__pyx_n_s_ind_from
#define __pyx_n_s_ind_to __pyx_mstate_global->__pyx_n_s_ind_to
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_s_inds __pyx_mstate_global->__pyx_n_s_inds
#define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info
#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_s_input_and_pred_dist_values __pyx_mstate_global->__pyx_n_s_input_and_pred_dist_values
#define __pyx_n_s_input_data __pyx_mstate_global->__pyx_n_s_input_data
#define __pyx_n_s_input_deltas __pyx_mstate_global->__pyx_n_s_input_deltas
#define __pyx_n_s_input_gradients __pyx_mstate_global->__pyx_n_s_input_gradients
#define __pyx_n_s_input_size __pyx_mstate_global->__pyx_n_s_input_size
#define __pyx_n_u_input_size __pyx_mstate_global->__pyx_n_u_input_size
#define __pyx_n_s_input_size_with_distance __pyx_mstate_global->__pyx_n_s_input_size_with_distance
#define __pyx_n_s_input_values __pyx_mstate_global->__pyx_n_s_input_values
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label
#define __pyx_n_s_labels __pyx_mstate_global->__pyx_n_s_labels
#define __pyx_n_s_last_accuracy __pyx_mstate_global->__pyx_n_s_last_accuracy
#define __pyx_n_s_last_error __pyx_mstate_global->__pyx_n_s_last_error
#define __pyx_n_s_last_tag __pyx_mstate_global->__pyx_n_s_last_tag
#define __pyx_n_s_last_token __pyx_mstate_global->__pyx_n_s_last_token
#define __pyx_n_s_last_values __pyx_mstate_global->__pyx_n_s_last_values
#define __pyx_n_s_less __pyx_mstate_global->__pyx_n_s_less
#define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load
#define __pyx_n_s_load_from_file __pyx_mstate_global->__pyx_n_s_load_from_file
#define __pyx_n_s_load_from_file_2 __pyx_mstate_global->__pyx_n_s_load_from_file_2
#define __pyx_n_s_load_parameters __pyx_mstate_global->__pyx_n_s_load_parameters
#define __pyx_n_s_log __pyx_mstate_global->__pyx_n_s_log
#define __pyx_n_s_log_sum_scores __pyx_mstate_global->__pyx_n_s_log_sum_scores
#define __pyx_n_s_logadd __pyx_mstate_global->__pyx_n_s_logadd
#define __pyx_n_s_logger __pyx_mstate_global->__pyx_n_s_logger
#define __pyx_n_s_logging __pyx_mstate_global->__pyx_n_s_logging
#define __pyx_n_s_logical_and __pyx_mstate_global->__pyx_n_s_logical_and
#define __pyx_n_s_logical_not __pyx_mstate_global->__pyx_n_s_logical_not
#define __pyx_n_s_logprob __pyx_mstate_global->__pyx_n_s_logprob
#define __pyx_n_s_logprobs __pyx_mstate_global->__pyx_n_s_logprobs
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
#define __pyx_n_s_max_incoming_inds __pyx_mstate_global->__pyx_n_s_max_incoming_inds
#define __pyx_n_s_max_incoming_weights __pyx_mstate_global->__pyx_n_s_max_incoming_weights
#define __pyx_n_s_max_outgoing_inds __pyx_mstate_global->__pyx_n_s_max_outgoing_inds
#define __pyx_n_s_max_outgoing_weights __pyx_mstate_global->__pyx_n_s_max_outgoing_weights
#define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_net __pyx_mstate_global->__pyx_n_s_net
#define __pyx_n_s_net_scores __pyx_mstate_global->__pyx_n_s_net_scores
#define __pyx_n_s_net_tag __pyx_mstate_global->__pyx_n_s_net_tag
#define __pyx_n_s_network_filename __pyx_mstate_global->__pyx_n_s_network_filename
#define __pyx_n_s_neuron_maxes __pyx_mstate_global->__pyx_n_s_neuron_maxes
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_new_data __pyx_mstate_global->__pyx_n_s_new_data
#define __pyx_n_s_new_head __pyx_mstate_global->__pyx_n_s_new_head
#define __pyx_n_s_new_head_ind __pyx_mstate_global->__pyx_n_s_new_head_ind
#define __pyx_n_s_new_shape __pyx_mstate_global->__pyx_n_s_new_shape
#define __pyx_n_s_next_vertex __pyx_mstate_global->__pyx_n_s_next_vertex
#define __pyx_n_s_nltkor_tag_libs_network __pyx_mstate_global->__pyx_n_s_nltkor_tag_libs_network
#define __pyx_kp_s_nltkor_tag_libs_network_pyx __pyx_mstate_global->__pyx_kp_s_nltkor_tag_libs_network_pyx
#define __pyx_kp_s_nltkor_tag_libs_networkconv_pyx __pyx_mstate_global->__pyx_kp_s_nltkor_tag_libs_networkconv_pyx
#define __pyx_kp_s_nltkor_tag_libs_networkdependenc __pyx_mstate_global->__pyx_kp_s_nltkor_tag_libs_networkdependenc
#define __pyx_n_s_nn __pyx_mstate_global->__pyx_n_s_nn
#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
#define __pyx_n_s_num __pyx_mstate_global->__pyx_n_s_num
#define __pyx_n_s_num_dims __pyx_mstate_global->__pyx_n_s_num_dims
#define __pyx_n_s_num_dist_features __pyx_mstate_global->__pyx_n_s_num_dist_features
#define __pyx_n_s_num_distances __pyx_mstate_global->__pyx_n_s_num_distances
#define __pyx_n_s_num_items __pyx_mstate_global->__pyx_n_s_num_items
#define __pyx_n_s_num_tokens __pyx_mstate_global->__pyx_n_s_num_tokens
#define __pyx_n_s_num_vertices __pyx_mstate_global->__pyx_n_s_num_vertices
#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to
#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor
#define __pyx_n_s_old_head __pyx_mstate_global->__pyx_n_s_old_head
#define __pyx_n_s_other_args __pyx_mstate_global->__pyx_n_s_other_args
#define __pyx_n_s_outgoing_weights __pyx_mstate_global->__pyx_n_s_outgoing_weights
#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output
#define __pyx_n_s_output_bias __pyx_mstate_global->__pyx_n_s_output_bias
#define __pyx_n_u_output_bias __pyx_mstate_global->__pyx_n_u_output_bias
#define __pyx_n_s_output_bias_deltas __pyx_mstate_global->__pyx_n_s_output_bias_deltas
#define __pyx_n_s_output_deltas __pyx_mstate_global->__pyx_n_s_output_deltas
#define __pyx_n_s_output_dim __pyx_mstate_global->__pyx_n_s_output_dim
#define __pyx_n_s_output_range __pyx_mstate_global->__pyx_n_s_output_range
#define __pyx_n_s_output_size __pyx_mstate_global->__pyx_n_s_output_size
#define __pyx_n_u_output_size __pyx_mstate_global->__pyx_n_u_output_size
#define __pyx_n_s_output_weights __pyx_mstate_global->__pyx_n_s_output_weights
#define __pyx_n_u_output_weights __pyx_mstate_global->__pyx_n_u_output_weights
#define __pyx_n_s_outside __pyx_mstate_global->__pyx_n_s_outside
#define __pyx_n_s_outside_inds __pyx_mstate_global->__pyx_n_s_outside_inds
#define __pyx_n_s_padded_sentence __pyx_mstate_global->__pyx_n_s_padded_sentence
#define __pyx_n_s_padding_left __pyx_mstate_global->__pyx_n_s_padding_left
#define __pyx_n_u_padding_left __pyx_mstate_global->__pyx_n_u_padding_left
#define __pyx_n_s_padding_right __pyx_mstate_global->__pyx_n_s_padding_right
#define __pyx_n_u_padding_right __pyx_mstate_global->__pyx_n_u_padding_right
#define __pyx_n_s_path_backtrack __pyx_mstate_global->__pyx_n_s_path_backtrack
#define __pyx_n_s_path_scores __pyx_mstate_global->__pyx_n_s_path_scores
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_s_pos_deltas __pyx_mstate_global->__pyx_n_s_pos_deltas
#define __pyx_n_s_pos_dist __pyx_mstate_global->__pyx_n_s_pos_dist
#define __pyx_n_s_pos_padding __pyx_mstate_global->__pyx_n_s_pos_padding
#define __pyx_n_s_pre_deltas __pyx_mstate_global->__pyx_n_s_pre_deltas
#define __pyx_n_s_pre_dist __pyx_mstate_global->__pyx_n_s_pre_dist
#define __pyx_n_s_pre_padding __pyx_mstate_global->__pyx_n_s_pre_padding
#define __pyx_n_s_pre_tagging_setup __pyx_mstate_global->__pyx_n_s_pre_tagging_setup
#define __pyx_n_s_pred_answer __pyx_mstate_global->__pyx_n_s_pred_answer
#define __pyx_n_s_pred_arguments __pyx_mstate_global->__pyx_n_s_pred_arguments
#define __pyx_n_s_pred_dist_gradients __pyx_mstate_global->__pyx_n_s_pred_dist_gradients
#define __pyx_n_s_pred_dist_indices __pyx_mstate_global->__pyx_n_s_pred_dist_indices
#define __pyx_n_s_pred_dist_table __pyx_mstate_global->__pyx_n_s_pred_dist_table
#define __pyx_n_u_pred_dist_table __pyx_mstate_global->__pyx_n_u_pred_dist_table
#define __pyx_n_s_pred_dist_values __pyx_mstate_global->__pyx_n_s_pred_dist_values
#define __pyx_n_s_pred_dist_weights __pyx_mstate_global->__pyx_n_s_pred_dist_weights
#define __pyx_n_u_pred_dist_weights __pyx_mstate_global->__pyx_n_u_pred_dist_weights
#define __pyx_n_s_pred_dists __pyx_mstate_global->__pyx_n_s_pred_dists
#define __pyx_n_s_pred_tags __pyx_mstate_global->__pyx_n_s_pred_tags
#define __pyx_n_s_predicate __pyx_mstate_global->__pyx_n_s_predicate
#define __pyx_n_s_predicate_answer __pyx_mstate_global->__pyx_n_s_predicate_answer
#define __pyx_n_s_predicate_tags __pyx_mstate_global->__pyx_n_s_predicate_tags
#define __pyx_n_s_predicates __pyx_mstate_global->__pyx_n_s_predicates
#define __pyx_n_s_prev_score_and_trans __pyx_mstate_global->__pyx_n_s_prev_score_and_trans
#define __pyx_n_s_previous_tag __pyx_mstate_global->__pyx_n_s_previous_tag
#define __pyx_n_s_print_epoch_report __pyx_mstate_global->__pyx_n_s_print_epoch_report
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_ConvolutionalDepe __pyx_mstate_global->__pyx_n_s_pyx_unpickle_ConvolutionalDepe
#define __pyx_n_s_pyx_unpickle_ConvolutionalNetw __pyx_mstate_global->__pyx_n_s_pyx_unpickle_ConvolutionalNetw
#define __pyx_n_s_pyx_unpickle_Network __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Network
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_random __pyx_mstate_global->__pyx_n_s_random
#define __pyx_n_s_random_state __pyx_mstate_global->__pyx_n_s_random_state
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_ravel __pyx_mstate_global->__pyx_n_s_ravel
#define __pyx_n_s_reachable __pyx_mstate_global->__pyx_n_s_reachable
#define __pyx_n_s_reachable_vertices __pyx_mstate_global->__pyx_n_s_reachable_vertices
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_reset_counters __pyx_mstate_global->__pyx_n_s_reset_counters
#define __pyx_n_s_reshape __pyx_mstate_global->__pyx_n_s_reshape
#define __pyx_n_s_rollaxis __pyx_mstate_global->__pyx_n_s_rollaxis
#define __pyx_n_s_root __pyx_mstate_global->__pyx_n_s_root
#define __pyx_n_s_save __pyx_mstate_global->__pyx_n_s_save
#define __pyx_n_s_savez __pyx_mstate_global->__pyx_n_s_savez
#define __pyx_n_s_scores __pyx_mstate_global->__pyx_n_s_scores
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send
#define __pyx_n_s_sent __pyx_mstate_global->__pyx_n_s_sent
#define __pyx_n_s_sent_args __pyx_mstate_global->__pyx_n_s_sent_args
#define __pyx_n_s_sent_preds __pyx_mstate_global->__pyx_n_s_sent_preds
#define __pyx_n_s_sent_tags __pyx_mstate_global->__pyx_n_s_sent_tags
#define __pyx_n_s_sentence __pyx_mstate_global->__pyx_n_s_sentence
#define __pyx_n_s_sentence_convolution __pyx_mstate_global->__pyx_n_s_sentence_convolution
#define __pyx_n_s_sentence_hit __pyx_mstate_global->__pyx_n_s_sentence_hit
#define __pyx_n_s_sentence_hits __pyx_mstate_global->__pyx_n_s_sentence_hits
#define __pyx_n_s_sentences __pyx_mstate_global->__pyx_n_s_sentences
#define __pyx_n_s_set_learning_rate_decay __pyx_mstate_global->__pyx_n_s_set_learning_rate_decay
#define __pyx_n_s_set_state __pyx_mstate_global->__pyx_n_s_set_state
#define __pyx_n_s_set_validation_data __pyx_mstate_global->__pyx_n_s_set_validation_data
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
#define __pyx_n_s_shift __pyx_mstate_global->__pyx_n_s_shift
#define __pyx_n_s_shuffle __pyx_mstate_global->__pyx_n_s_shuffle
#define __pyx_n_s_shuffle_data __pyx_mstate_global->__pyx_n_s_shuffle_data
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_sqrt __pyx_mstate_global->__pyx_n_s_sqrt
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_start_from __pyx_mstate_global->__pyx_n_s_start_from
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum
#define __pyx_n_s_sumlogadd __pyx_mstate_global->__pyx_n_s_sumlogadd
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t
#define __pyx_n_s_table __pyx_mstate_global->__pyx_n_s_table
#define __pyx_n_s_table_deltas __pyx_mstate_global->__pyx_n_s_table_deltas
#define __pyx_n_s_table_dims __pyx_mstate_global->__pyx_n_s_table_dims
#define __pyx_n_s_tag __pyx_mstate_global->__pyx_n_s_tag
#define __pyx_n_s_tag_scores __pyx_mstate_global->__pyx_n_s_tag_scores
#define __pyx_n_s_tag_sentence __pyx_mstate_global->__pyx_n_s_tag_sentence
#define __pyx_n_s_tag_sentence_2 __pyx_mstate_global->__pyx_n_s_tag_sentence_2
#define __pyx_n_s_tag_sentence_labeled_dependency __pyx_mstate_global->__pyx_n_s_tag_sentence_labeled_dependency
#define __pyx_n_s_tag_sentence_unlabeled_dependen __pyx_mstate_global->__pyx_n_s_tag_sentence_unlabeled_dependen
#define __pyx_n_s_tags __pyx_mstate_global->__pyx_n_s_tags
#define __pyx_n_s_take __pyx_mstate_global->__pyx_n_s_take
#define __pyx_n_s_target __pyx_mstate_global->__pyx_n_s_target
#define __pyx_n_s_target_dist_gradients __pyx_mstate_global->__pyx_n_s_target_dist_gradients
#define __pyx_n_s_target_dist_indices __pyx_mstate_global->__pyx_n_s_target_dist_indices
#define __pyx_n_s_target_dist_table __pyx_mstate_global->__pyx_n_s_target_dist_table
#define __pyx_n_u_target_dist_table __pyx_mstate_global->__pyx_n_u_target_dist_table
#define __pyx_n_s_target_dist_values __pyx_mstate_global->__pyx_n_s_target_dist_values
#define __pyx_n_s_target_dist_weights __pyx_mstate_global->__pyx_n_s_target_dist_weights
#define __pyx_n_u_target_dist_weights __pyx_mstate_global->__pyx_n_u_target_dist_weights
#define __pyx_n_s_target_dists __pyx_mstate_global->__pyx_n_s_target_dists
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw
#define __pyx_n_s_tile __pyx_mstate_global->__pyx_n_s_tile
#define __pyx_n_s_token __pyx_mstate_global->__pyx_n_s_token
#define __pyx_n_s_token_indices __pyx_mstate_global->__pyx_n_s_token_indices
#define __pyx_n_s_token_scores __pyx_mstate_global->__pyx_n_s_token_scores
#define __pyx_n_s_top_accuracy __pyx_mstate_global->__pyx_n_s_top_accuracy
#define __pyx_n_s_train __pyx_mstate_global->__pyx_n_s_train
#define __pyx_n_s_train_epoch __pyx_mstate_global->__pyx_n_s_train_epoch
#define __pyx_n_s_train_locals_genexpr __pyx_mstate_global->__pyx_n_s_train_locals_genexpr
#define __pyx_n_s_training __pyx_mstate_global->__pyx_n_s_training
#define __pyx_n_s_trans __pyx_mstate_global->__pyx_n_s_trans
#define __pyx_n_s_transitions __pyx_mstate_global->__pyx_n_s_transitions
#define __pyx_n_u_transitions __pyx_mstate_global->__pyx_n_u_transitions
#define __pyx_n_s_transitions_t __pyx_mstate_global->__pyx_n_s_transitions_t
#define __pyx_n_s_uniform __pyx_mstate_global->__pyx_n_s_uniform
#define __pyx_n_s_unreachable __pyx_mstate_global->__pyx_n_s_unreachable
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_validate __pyx_mstate_global->__pyx_n_s_validate
#define __pyx_n_s_validate_locals_genexpr __pyx_mstate_global->__pyx_n_s_validate_locals_genexpr
#define __pyx_n_s_validation_arguments __pyx_mstate_global->__pyx_n_s_validation_arguments
#define __pyx_n_s_validation_predicates __pyx_mstate_global->__pyx_n_s_validation_predicates
#define __pyx_n_s_validation_sentences __pyx_mstate_global->__pyx_n_s_validation_sentences
#define __pyx_n_s_validation_tags __pyx_mstate_global->__pyx_n_s_validation_tags
#define __pyx_n_s_vertex __pyx_mstate_global->__pyx_n_s_vertex
#define __pyx_n_s_vertex_leaving_cycle __pyx_mstate_global->__pyx_n_s_vertex_leaving_cycle
#define __pyx_n_s_vertex_leaving_cycle_ind __pyx_mstate_global->__pyx_n_s_vertex_leaving_cycle_ind
#define __pyx_n_s_vertices_in_cycles __pyx_mstate_global->__pyx_n_s_vertices_in_cycles
#define __pyx_n_s_visited __pyx_mstate_global->__pyx_n_s_visited
#define __pyx_n_s_viterbi __pyx_mstate_global->__pyx_n_s_viterbi
#define __pyx_n_s_vstack __pyx_mstate_global->__pyx_n_s_vstack
#define __pyx_n_s_w_deltas __pyx_mstate_global->__pyx_n_s_w_deltas
#define __pyx_n_s_where __pyx_mstate_global->__pyx_n_s_where
#define __pyx_n_s_window __pyx_mstate_global->__pyx_n_s_window
#define __pyx_n_s_window_from __pyx_mstate_global->__pyx_n_s_window_from
#define __pyx_n_s_window_to __pyx_mstate_global->__pyx_n_s_window_to
#define __pyx_n_s_word_window __pyx_mstate_global->__pyx_n_s_word_window
#define __pyx_n_s_word_window_size __pyx_mstate_global->__pyx_n_s_word_window_size
#define __pyx_n_u_word_window_size __pyx_mstate_global->__pyx_n_u_word_window_size
#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
#define __pyx_n_s_xrange __pyx_mstate_global->__pyx_n_s_xrange
#define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
#define __pyx_n_s_zeros_like __pyx_mstate_global->__pyx_n_s_zeros_like
#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip
#define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0
#define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0
#define __pyx_float_0_01 __pyx_mstate_global->__pyx_float_0_01
#define __pyx_float_2_38 __pyx_mstate_global->__pyx_float_2_38
#define __pyx_float_neg_1_0 __pyx_mstate_global->__pyx_float_neg_1_0
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_27816595 __pyx_mstate_global->__pyx_int_27816595
#define __pyx_int_49696698 __pyx_mstate_global->__pyx_int_49696698
#define __pyx_int_119830996 __pyx_mstate_global->__pyx_int_119830996
#define __pyx_int_145891266 __pyx_mstate_global->__pyx_int_145891266
#define __pyx_int_148123145 __pyx_mstate_global->__pyx_int_148123145
#define __pyx_int_149446146 __pyx_mstate_global->__pyx_int_149446146
#define __pyx_int_202246394 __pyx_mstate_global->__pyx_int_202246394
#define __pyx_int_212151326 __pyx_mstate_global->__pyx_int_212151326
#define __pyx_int_220499725 __pyx_mstate_global->__pyx_int_220499725
#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
#define __pyx_int_neg_2 __pyx_mstate_global->__pyx_int_neg_2
#define __pyx_int_neg_1000 __pyx_mstate_global->__pyx_int_neg_1000
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_slice__8 __pyx_mstate_global->__pyx_slice__8
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_slice__12 __pyx_mstate_global->__pyx_slice__12
#define __pyx_slice__14 __pyx_mstate_global->__pyx_slice__14
#define __pyx_slice__56 __pyx_mstate_global->__pyx_slice__56
#define __pyx_slice__59 __pyx_mstate_global->__pyx_slice__59
#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99
#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3
#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7
#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100
#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101
#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104
#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107
#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122
#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125
#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130
#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131
#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134
#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135
#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136
#define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141
#define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142
#define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153
#define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156
#define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157
#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158
#define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159
#define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160
#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11
#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13
#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16
#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17
#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18
#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19
#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20
#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21
#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22
#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24
#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26
#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28
#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30
#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34
#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36
#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38
#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39
#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40
#define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41
#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42
#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43
#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44
#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46
#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49
#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50
#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52
#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53
#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54
#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55
#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60
#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61
#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65
#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66
#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67
#define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68
#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69
#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70
#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71
#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72
#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73
#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74
#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78
#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79
#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80
#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82
#define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83
#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84
#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87
#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89
/* #### Code section: module_code ### */

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
 * 
 *         @property
 *         cdef inline PyObject* base(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 *             return PyArray_BASE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_BASE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
 * 
 *         @property
 *         cdef inline PyObject* base(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
 * 
 *         @property
 *         cdef inline dtype descr(self):             # <<<<<<<<<<<<<<
 *             """Returns an owned reference to the dtype of the array.
 *             """
 */

static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
  PyArray_Descr *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArray_Descr *__pyx_t_1;
  __Pyx_RefNannySetupContext("descr", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
 *             """Returns an owned reference to the dtype of the array.
 *             """
 *             return <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
  __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
 * 
 *         @property
 *         cdef inline dtype descr(self):             # <<<<<<<<<<<<<<
 *             """Returns an owned reference to the dtype of the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
 * 
 *         @property
 *         cdef inline int ndim(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns the number of dimensions in the array.
 *             """
 */

static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
 *             """Returns the number of dimensions in the array.
 *             """
 *             return PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
 * 
 *         @property
 *         cdef inline int ndim(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns the number of dimensions in the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
 * 
 *         @property
 *         cdef inline npy_intp *shape(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the dimensions/shape of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
 *             Can return NULL for 0-dimensional arrays.
 *             """
 *             return PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
 * 
 *         @property
 *         cdef inline npy_intp *shape(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the dimensions/shape of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
 * 
 *         @property
 *         cdef inline npy_intp *strides(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the strides of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
 *             The number of elements matches the number of dimensions of the array (ndim).
 *             """
 *             return PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
 * 
 *         @property
 *         cdef inline npy_intp *strides(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the strides of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
 * 
 *         @property
 *         cdef inline npy_intp size(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns the total size (in number of elements) of the array.
 *             """
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
 *             """Returns the total size (in number of elements) of the array.
 *             """
 *             return PyArray_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
 * 
 *         @property
 *         cdef inline npy_intp size(self) nogil:             # <<<<<<<<<<<<<<
 *             """Returns the total size (in number of elements) of the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
 * 
 *         @property
 *         cdef inline char* data(self) nogil:             # <<<<<<<<<<<<<<
 *             """The pointer to the data buffer as a char*.
 *             This is provided for legacy reasons to avoid direct struct field access.
 */

static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
  char *__pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
 *             of `PyArray_DATA()` instead, which returns a 'void*'.
 *             """
 *             return PyArray_BYTES(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef unsigned char      npy_bool
 */
  __pyx_r = PyArray_BYTES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
 * 
 *         @property
 *         cdef inline char* data(self) nogil:             # <<<<<<<<<<<<<<
 *             """The pointer to the data buffer as a char*.
 *             This is provided for legacy reasons to avoid direct struct field access.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":773
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
  if (__pyx_t_1) {

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":790
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error)

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = (__pyx_v_base == NULL);
  if (__pyx_t_1) {

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error)

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 984, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error)

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 990, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 1);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error)

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 996, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1011
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1026
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1036
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1043
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1050
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":20
 *         @property
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":24
 *         @property
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
 */
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":117
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":118
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 118, __pyx_L1_error)

  /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":121
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
 */
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":124
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":125
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
 */
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":126
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":135
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":136
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 136, __pyx_L1_error)

  /* "cpython/contextvars.pxd":138
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":139
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 */
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":140
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_logsumexp(PyArrayObject *__pyx_v_a, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp *__pyx_optional_args) {
  PyObject *__pyx_v_axis = ((PyObject *)Py_None);
  PyObject *__pyx_v_a_max = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("logsumexp", 0);
  __Pyx_TraceCall("logsumexp", __pyx_f[0], 28, 0, __PYX_ERR(0, 28, __pyx_L1_error));
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_axis = __pyx_optional_args->axis;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_a);

  /* "nltkor/tag/libs/network.pyx":46
 *         more stable way.
 *     """
 *     if axis is None:             # <<<<<<<<<<<<<<
 *         a = a.ravel()
 *     else:
 */
  __pyx_t_1 = (__pyx_v_axis == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":47
 *     """
 *     if axis is None:
 *         a = a.ravel()             # <<<<<<<<<<<<<<
 *     else:
 *         a = np.rollaxis(a, axis)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":46
 *         more stable way.
 *     """
 *     if axis is None:             # <<<<<<<<<<<<<<
 *         a = a.ravel()
 *     else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":49
 *         a = a.ravel()
 *     else:
 *         a = np.rollaxis(a, axis)             # <<<<<<<<<<<<<<
 *     a_max = a.max(axis=0)
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_rollaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_a), __pyx_v_axis};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":50
 *     else:
 *         a = np.rollaxis(a, axis)
 *     a_max = a.max(axis=0)             # <<<<<<<<<<<<<<
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_a_max = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":51
 *         a = np.rollaxis(a, axis)
 *     a_max = a.max(axis=0)
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max             # <<<<<<<<<<<<<<
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Subtract(((PyObject *)__pyx_v_a), __pyx_v_a_max); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_a_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("nltkor.tag.libs.network.logsumexp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a_max);
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanh(PyArrayObject *__pyx_v_weights, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh *__pyx_optional_args) {
  PyObject *__pyx_v_inplace = ((PyObject *)Py_False);
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_inds_greater = NULL;
  PyObject *__pyx_v_inds_lesser = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hardtanh", 1);
  __Pyx_TraceCall("hardtanh", __pyx_f[0], 53, 0, __PYX_ERR(0, 53, __pyx_L1_error));
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_inplace = __pyx_optional_args->inplace;
    }
  }

  /* "nltkor/tag/libs/network.pyx":58
 *     If inplace is True, modifies the input weights, which will be faster.
 *     """
 *     if inplace:             # <<<<<<<<<<<<<<
 *         out = weights
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inplace); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 58, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":59
 *     """
 *     if inplace:
 *         out = weights             # <<<<<<<<<<<<<<
 *     else:
 *         out = np.copy(weights)
 */
    __Pyx_INCREF((PyObject *)__pyx_v_weights);
    __pyx_v_out = ((PyObject *)__pyx_v_weights);

    /* "nltkor/tag/libs/network.pyx":58
 *     If inplace is True, modifies the input weights, which will be faster.
 *     """
 *     if inplace:             # <<<<<<<<<<<<<<
 *         out = weights
 *     else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":61
 *         out = weights
 *     else:
 *         out = np.copy(weights)             # <<<<<<<<<<<<<<
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_weights)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_out = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":62
 *     else:
 *         out = np.copy(weights)
 *     inds_greater = weights > 1             # <<<<<<<<<<<<<<
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __pyx_v_inds_greater = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":63
 *         out = np.copy(weights)
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1             # <<<<<<<<<<<<<<
 *     out[inds_greater] = 1
 *     out[inds_lesser] = -1
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_int_neg_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  __pyx_v_inds_lesser = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":64
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1             # <<<<<<<<<<<<<<
 *     out[inds_lesser] = -1
 * 
 */
  if (unlikely((PyObject_SetItem(__pyx_v_out, __pyx_v_inds_greater, __pyx_int_1) < 0))) __PYX_ERR(0, 64, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":65
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1
 *     out[inds_lesser] = -1             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely((PyObject_SetItem(__pyx_v_out, __pyx_v_inds_lesser, __pyx_int_neg_1) < 0))) __PYX_ERR(0, 65, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":67
 *     out[inds_lesser] = -1
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.hardtanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_inds_greater);
  __Pyx_XDECREF(__pyx_v_inds_lesser);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":69
 *     return out
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):             # <<<<<<<<<<<<<<
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(PyArrayObject *__pyx_v_weights) {
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_inds = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_weights;
  __Pyx_Buffer __pyx_pybuffer_weights;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hardtanhd", 1);
  __Pyx_TraceCall("hardtanhd", __pyx_f[0], 69, 0, __PYX_ERR(0, 69, __pyx_L1_error));
  __pyx_pybuffer_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_weights.refcount = 0;
  __pyx_pybuffernd_weights.data = NULL;
  __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
  }
  __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weights.diminfo[1].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weights.diminfo[1].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/network.pyx":71
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)             # <<<<<<<<<<<<<<
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)
 *     out[inds] = 1.0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error)
  __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":72
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)             # <<<<<<<<<<<<<<
 *     out[inds] = 1.0
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_float_neg_1_0, ((PyObject *)__pyx_v_weights), Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_float_1_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_inds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":73
 *     cdef np.ndarray out = np.zeros_like(weights)
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)
 *     out[inds] = 1.0             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_out), __pyx_v_inds, __pyx_float_1_0) < 0))) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":75
 *     out[inds] = 1.0
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":69
 *     return out
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):             # <<<<<<<<<<<<<<
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.hardtanhd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new, "Network.create_new(cls, feature_tables, int word_window, int hidden_size, int output_size)\n\n        Creates a new neural network.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_1create_new = {"create_new", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feature_tables = 0;
  int __pyx_v_word_window;
  int __pyx_v_hidden_size;
  int __pyx_v_output_size;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_new (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feature_tables,&__pyx_n_s_word_window,&__pyx_n_s_hidden_size,&__pyx_n_s_output_size,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feature_tables)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_word_window)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, 1); __PYX_ERR(0, 126, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, 2); __PYX_ERR(0, 126, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, 3); __PYX_ERR(0, 126, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_new") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_feature_tables = values[0];
    __pyx_v_word_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_word_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error)
    __pyx_v_hidden_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_hidden_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error)
    __pyx_v_output_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_output_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(((PyTypeObject*)__pyx_v_cls), __pyx_v_feature_tables, __pyx_v_word_window, __pyx_v_hidden_size, __pyx_v_output_size);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 133, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_create_new_locals_genexpr, __pyx_n_s_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __Pyx_TraceCall("genexpr", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error));
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceReturn(Py_None, 0);
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 133, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 133, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 133, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_table);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_table, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_TraceReturn(__pyx_r, 0);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 133, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, int __pyx_v_word_window, int __pyx_v_hidden_size, int __pyx_v_output_size) {
  int __pyx_v_input_size;
  PyObject *__pyx_v_high = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_transitions = NULL;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_net = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__3)
  __Pyx_RefNannySetupContext("create_new", 1);
  __Pyx_TraceCall("create_new", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */
  __pyx_t_1 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(NULL, __pyx_v_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_input_size = __pyx_t_3;

  /* "nltkor/tag/libs/network.pyx":134
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)
 *         input_size *= word_window             # <<<<<<<<<<<<<<
 * 
 *         # creates the weight matrices
 */
  __pyx_v_input_size = (__pyx_v_input_size * __pyx_v_word_window);

  /* "nltkor/tag/libs/network.pyx":145
 *         # interval = 3.46 / fanin ^ 1/4
 *         #high = 1.732 / np.power(input_size, 0.25) # SENNA: 0.416
 *         high = 2.38 / np.sqrt(input_size) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_2, 2.38, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_high = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":147
 *         high = 2.38 / np.sqrt(input_size) # [Bottou-88]
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))             # <<<<<<<<<<<<<<
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_v_high, __pyx_t_8};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_hidden_weights = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":148
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))             # <<<<<<<<<<<<<<
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_8, __pyx_v_high, __pyx_t_1};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_hidden_bias = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":150
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_4, 2.38, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":152
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))             # <<<<<<<<<<<<<<
 *         output_bias = np.random.uniform(-high, high, (output_size))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_v_high, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_output_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":153
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))
 *         output_bias = np.random.uniform(-high, high, (output_size))             # <<<<<<<<<<<<<<
 * 
 *         high = 1.0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_5, __pyx_v_high, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":155
 *         output_bias = np.random.uniform(-high, high, (output_size))
 * 
 *         high = 1.0             # <<<<<<<<<<<<<<
 *         # +1 is due for the initial transition
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))
 */
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_float_1_0);

  /* "nltkor/tag/libs/network.pyx":157
 *         high = 1.0
 *         # +1 is due for the initial transition
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))             # <<<<<<<<<<<<<<
 * 
 *         net = Network(word_window, input_size, hidden_size, output_size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_output_size + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_v_high, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_transitions = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":159
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))
 * 
 *         net = Network(word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "nltkor/tag/libs/network.pyx":161
 *         net = Network(word_window, input_size, hidden_size, output_size,
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)             # <<<<<<<<<<<<<<
 *         net.feature_tables = feature_tables
 * 
 */
  __pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_weights);
  __Pyx_GIVEREF(__pyx_v_hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_hidden_weights)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_bias);
  __Pyx_GIVEREF(__pyx_v_hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_v_hidden_bias)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_weights);
  __Pyx_GIVEREF(__pyx_v_output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_v_output_weights)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_bias);
  __Pyx_GIVEREF(__pyx_v_output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_v_output_bias)) __PYX_ERR(0, 159, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_transitions);
  __Pyx_GIVEREF(__pyx_v_transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_v_transitions)) __PYX_ERR(0, 159, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":159
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))
 * 
 *         net = Network(word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network), __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_net = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":162
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)
 *         net.feature_tables = feature_tables             # <<<<<<<<<<<<<<
 * 
 *         return net
 */
  if (!(likely(PyList_CheckExact(__pyx_v_feature_tables))||((__pyx_v_feature_tables) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_feature_tables))) __PYX_ERR(0, 162, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_feature_tables;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_net->feature_tables);
  __Pyx_DECREF(__pyx_v_net->feature_tables);
  __pyx_v_net->feature_tables = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":164
 *         net.feature_tables = feature_tables
 * 
 *         return net             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_net);
  __pyx_r = ((PyObject *)__pyx_v_net);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_high);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF((PyObject *)__pyx_v_net);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
 */

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_2__init__, "\n        This function isn't expected to be directly called.\n        Instead, use the classmethods load_from_file or \n        create_new.\n        \n        :param transitions: transition weights. If None uses\n            Window Level Likelihood instead of Sentence Level Likelihood.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__;
#endif
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word_window = 0;
  PyObject *__pyx_v_input_size = 0;
  PyObject *__pyx_v_hidden_size = 0;
  PyObject *__pyx_v_output_size = 0;
  PyObject *__pyx_v_hidden_weights = 0;
  PyObject *__pyx_v_hidden_bias = 0;
  PyObject *__pyx_v_output_weights = 0;
  PyObject *__pyx_v_output_bias = 0;
  PyObject *__pyx_v_transitions = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_word_window,&__pyx_n_s_input_size,&__pyx_n_s_hidden_size,&__pyx_n_s_output_size,&__pyx_n_s_hidden_weights,&__pyx_n_s_hidden_bias,&__pyx_n_s_output_weights,&__pyx_n_s_output_bias,&__pyx_n_s_transitions,0};

    /* "nltkor/tag/libs/network.pyx":168
 *     def __init__(self, word_window, input_size, hidden_size, output_size,
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function isn't expected to be directly called.
 */
    values[8] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_VARARGS(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_word_window)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 1); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 2); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 3); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[4]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 4); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden_bias)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[5]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 5); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[6]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 6); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_bias)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[7]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, 7); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transitions);
          if (value) { values[8] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_VARARGS(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
        values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
        values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
        values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
        values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_word_window = values[0];
    __pyx_v_input_size = values[1];
    __pyx_v_hidden_size = values[2];
    __pyx_v_output_size = values[3];
    __pyx_v_hidden_weights = values[4];
    __pyx_v_hidden_bias = values[5];
    __pyx_v_output_weights = values[6];
    __pyx_v_output_bias = values[7];
    __pyx_v_transitions = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden_size, __pyx_v_output_size, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_v_output_weights, __pyx_v_output_bias, __pyx_v_transitions);

  /* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden_weights, PyObject *__pyx_v_hidden_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias, PyObject *__pyx_v_transitions) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);
  __Pyx_TraceCall("__init__", __pyx_f[0], 166, 0, __PYX_ERR(0, 166, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":177
 *             Window Level Likelihood instead of Sentence Level Likelihood.
 *         """
 *         self.learning_rate = 0             # <<<<<<<<<<<<<<
 *         self.learning_rate_features = 0
 * 
 */
  __pyx_v_self->learning_rate = 0.0;

  /* "nltkor/tag/libs/network.pyx":178
 *         """
 *         self.learning_rate = 0
 *         self.learning_rate_features = 0             # <<<<<<<<<<<<<<
 * 
 *         self.word_window_size = word_window
 */
  __pyx_v_self->learning_rate_features = 0.0;

  /* "nltkor/tag/libs/network.pyx":180
 *         self.learning_rate_features = 0
 * 
 *         self.word_window_size = word_window             # <<<<<<<<<<<<<<
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_word_window); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_v_self->word_window_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":181
 * 
 *         self.word_window_size = word_window
 *         self.input_size = input_size             # <<<<<<<<<<<<<<
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_input_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
  __pyx_v_self->input_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":182
 *         self.word_window_size = word_window
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size             # <<<<<<<<<<<<<<
 *         self.output_size = output_size
 *         self.features_per_token = input_size / word_window
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_hidden_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
  __pyx_v_self->hidden_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":183
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size             # <<<<<<<<<<<<<<
 *         self.features_per_token = input_size / word_window
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_output_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
  __pyx_v_self->output_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":184
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size
 *         self.features_per_token = input_size / word_window             # <<<<<<<<<<<<<<
 * 
 *         # A_i_j score for jumping from tag i to j
 */
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_input_size, __pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->features_per_token = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":188
 *         # A_i_j score for jumping from tag i to j
 *         # A_0_i = transitions[-1]
 *         self.transitions = transitions             # <<<<<<<<<<<<<<
 * 
 *         self.hidden_weights = hidden_weights
 */
  if (!(likely(((__pyx_v_transitions) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_transitions, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 188, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_transitions;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":190
 *         self.transitions = transitions
 * 
 *         self.hidden_weights = hidden_weights             # <<<<<<<<<<<<<<
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights
 */
  if (!(likely(((__pyx_v_hidden_weights) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hidden_weights, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 190, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_hidden_weights;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":191
 * 
 *         self.hidden_weights = hidden_weights
 *         self.hidden_bias = hidden_bias             # <<<<<<<<<<<<<<
 *         self.output_weights = output_weights
 *         self.output_bias = output_bias
 */
  if (!(likely(((__pyx_v_hidden_bias) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hidden_bias, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 191, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_hidden_bias;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":192
 *         self.hidden_weights = hidden_weights
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights             # <<<<<<<<<<<<<<
 *         self.output_bias = output_bias
 * 
 */
  if (!(likely(((__pyx_v_output_weights) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_weights, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 192, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_output_weights;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":193
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights
 *         self.output_bias = output_bias             # <<<<<<<<<<<<<<
 * 
 *         self.validation_sentences = None
 */
  if (!(likely(((__pyx_v_output_bias) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_bias, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_output_bias;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":195
 *         self.output_bias = output_bias
 * 
 *         self.validation_sentences = None             # <<<<<<<<<<<<<<
 *         self.validation_tags = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_sentences);
  __Pyx_DECREF(__pyx_v_self->validation_sentences);
  __pyx_v_self->validation_sentences = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/network.pyx":196
 * 
 *         self.validation_sentences = None
 *         self.validation_tags = None             # <<<<<<<<<<<<<<
 * 
 *         self.use_learning_rate_decay = False
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_tags);
  __Pyx_DECREF(__pyx_v_self->validation_tags);
  __pyx_v_self->validation_tags = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/network.pyx":198
 *         self.validation_tags = None
 * 
 *         self.use_learning_rate_decay = False             # <<<<<<<<<<<<<<
 * 
 *     def description(self):
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyBoolObject *)Py_False);

  /* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description, "Network.description(self)\n\n        Returns a textual description of the network.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_5description = {"description", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("description", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "description", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_table_dims = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_UCS4 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__4)
  __Pyx_RefNannySetupContext("description", 1);
  __Pyx_TraceCall("description", __pyx_f[0], 200, 0, __PYX_ERR(0, 200, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":204
 *         Returns a textual description of the network.
 *         """
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]             # <<<<<<<<<<<<<<
 *         table_dims =  ', '.join(table_dims)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->feature_tables == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 204, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 204, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L5_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_t, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t); __pyx_8genexpr1__pyx_v_t = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t); __pyx_8genexpr1__pyx_v_t = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_table_dims = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":205
 *         """
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)             # <<<<<<<<<<<<<<
 * 
 *         desc = """
 */
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__5, __pyx_v_table_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_table_dims, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":207
 *         table_dims =  ', '.join(table_dims)
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
 */
  __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_Word_window_size);
  __pyx_t_3 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_Word_window_size);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Word_window_size);

  /* "nltkor/tag/libs/network.pyx":213
 * Hidden layer size: %d
 * Output size: %d
 * """ % (self.word_window_size, table_dims, self.input_size, self.hidden_size, self.output_size)             # <<<<<<<<<<<<<<
 * 
 *         return desc
 */
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_self->word_window_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_Feature_table_sizes);
  __pyx_t_3 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_Feature_table_sizes);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Feature_table_sizes);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_table_dims), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_Input_layer_size);
  __pyx_t_3 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_Input_layer_size);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_Input_layer_size);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_self->input_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_Hidden_layer_size);
  __pyx_t_3 += 20;
  __Pyx_GIVEREF(__pyx_kp_u_Hidden_layer_size);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_Hidden_layer_size);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_self->hidden_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_Output_size);
  __pyx_t_3 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_Output_size);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_Output_size);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_self->output_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__6);

  /* "nltkor/tag/libs/network.pyx":207
 *         table_dims =  ', '.join(table_dims)
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
 */
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_desc = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":215
 * """ % (self.word_window_size, table_dims, self.input_size, self.hidden_size, self.output_size)
 * 
 *         return desc             # <<<<<<<<<<<<<<
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_desc);
  __pyx_r = __pyx_v_desc;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_dims);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup, "Network._create_sentence_lookup(self, ndarray sentence)\n\n        Create a lookup matrix with the embeddings values for all tokens in a sentence.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup = {"_create_sentence_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_sentence_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_create_sentence_lookup") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_sentence_lookup", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._create_sentence_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence) {
  PyArrayObject *__pyx_v_padded_sentence = 0;
  PyObject *__pyx_v_ind_from = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_num_dims = NULL;
  PyObject *__pyx_v_ind_to = NULL;
  PyObject *__pyx_v_token_indices = NULL;
  PyObject *__pyx_v_embeddings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__7)
  __Pyx_RefNannySetupContext("_create_sentence_lookup", 1);
  __Pyx_TraceCall("_create_sentence_lookup", __pyx_f[0], 217, 0, __PYX_ERR(0, 217, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":222
 *         """
 *         #print (sentence)
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                                           sentence,
 *                                                           self.pos_padding))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":224
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,
 *                                                           sentence,
 *                                                           self.pos_padding))             # <<<<<<<<<<<<<<
 * 
 *         # make sure it works on 32 bit python installations
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->pre_padding))) __PYX_ERR(0, 222, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_sentence);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sentence);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_sentence))) __PYX_ERR(0, 222, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->pos_padding))) __PYX_ERR(0, 222, __pyx_L1_error);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "nltkor/tag/libs/network.pyx":222
 *         """
 *         #print (sentence)
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                                           sentence,
 *                                                           self.pos_padding))
 */
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error)
  __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":227
 * 
 *         # make sure it works on 32 bit python installations
 *         padded_sentence = padded_sentence.astype(int)             # <<<<<<<<<<<<<<
 *         #padded_sentence = padded_sentence.astype(np.int64)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_padded_sentence), __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)(&PyInt_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_padded_sentence, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":230
 *         #padded_sentence = padded_sentence.astype(np.int64)
 * 
 *         self.sentence_lookup = np.empty((len(padded_sentence), self.features_per_token))             # <<<<<<<<<<<<<<
 *         ind_from = 0
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_padded_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->sentence_lookup);
  __pyx_v_self->sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":231
 * 
 *         self.sentence_lookup = np.empty((len(padded_sentence), self.features_per_token))
 *         ind_from = 0             # <<<<<<<<<<<<<<
 * 
 *         for i, table in enumerate(self.feature_tables):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_ind_from = __pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":233
 *         ind_from = 0
 * 
 *         for i, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 233, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 233, __pyx_L1_error)
    #else
    __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":234
 * 
 *         for i, table in enumerate(self.feature_tables):
 *             num_dims = table.shape[1]             # <<<<<<<<<<<<<<
 *             ind_to = ind_from + num_dims
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_num_dims, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":235
 *         for i, table in enumerate(self.feature_tables):
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims             # <<<<<<<<<<<<<<
 * 
 *             token_indices = padded_sentence[:, i]
 */
    __pyx_t_4 = PyNumber_Add(__pyx_v_ind_from, __pyx_v_num_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_ind_to, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":237
 *             ind_to = ind_from + num_dims
 * 
 *             token_indices = padded_sentence[:, i]             # <<<<<<<<<<<<<<
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__8)) __PYX_ERR(0, 237, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_i)) __PYX_ERR(0, 237, __pyx_L1_error);
    __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_padded_sentence), __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_token_indices, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":238
 * 
 *             token_indices = padded_sentence[:, i]
 *             embeddings = table.take(token_indices, axis=0)             # <<<<<<<<<<<<<<
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_take); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_token_indices);
    __Pyx_GIVEREF(__pyx_v_token_indices);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_token_indices)) __PYX_ERR(0, 238, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_embeddings, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/network.pyx":239
 *             token_indices = padded_sentence[:, i]
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings             # <<<<<<<<<<<<<<
 * 
 *             ind_from = ind_to
 */
    __pyx_t_8 = PySlice_New(__pyx_v_ind_from, __pyx_v_ind_to, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__8)) __PYX_ERR(0, 239, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error);
    __pyx_t_8 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->sentence_lookup), __pyx_t_3, __pyx_v_embeddings) < 0))) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":241
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 * 
 *             ind_from = ind_to             # <<<<<<<<<<<<<<
 * 
 *     property padding_left:
 */
    __Pyx_INCREF(__pyx_v_ind_to);
    __Pyx_DECREF_SET(__pyx_v_ind_from, __pyx_v_ind_to);

    /* "nltkor/tag/libs/network.pyx":233
 *         ind_from = 0
 * 
 *         for i, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._create_sentence_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_padded_sentence);
  __Pyx_XDECREF(__pyx_v_ind_from);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_num_dims);
  __Pyx_XDECREF(__pyx_v_ind_to);
  __Pyx_XDECREF(__pyx_v_token_indices);
  __Pyx_XDECREF(__pyx_v_embeddings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":248
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_left
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 248, 0, __PYX_ERR(0, 248, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":249
 *         """
 *         def __get__(self):
 *             return self.padding_left             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, np.ndarray padding_left):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_left);
  __pyx_r = ((PyObject *)__pyx_v_self->padding_left);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":248
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_left
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":251
 *             return self.padding_left
 * 
 *         def __set__(self, np.ndarray padding_left):             # <<<<<<<<<<<<<<
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
 */

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_left); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_left) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_padding_left), __pyx_ptype_5numpy_ndarray, 1, "padding_left", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyArrayObject *)__pyx_v_padding_left));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_left) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 251, 0, __PYX_ERR(0, 251, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":252
 * 
 *         def __set__(self, np.ndarray padding_left):
 *             self.padding_left = padding_left             # <<<<<<<<<<<<<<
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_padding_left);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v_self->padding_left);
  __pyx_v_self->padding_left = __pyx_v_padding_left;

  /* "nltkor/tag/libs/network.pyx":253
 *         def __set__(self, np.ndarray padding_left):
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])             # <<<<<<<<<<<<<<
 * 
 *     property padding_right:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_div_long(__pyx_v_self->word_window_size, 2);
  __pyx_t_2 = PyList_New(1 * ((__pyx_t_4<0) ? 0:__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_4; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_padding_left);
      __Pyx_GIVEREF((PyObject *)__pyx_v_padding_left);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, ((PyObject *)__pyx_v_padding_left))) __PYX_ERR(0, 253, __pyx_L1_error);
    }
  }
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":251
 *             return self.padding_left
 * 
 *         def __set__(self, np.ndarray padding_left):             # <<<<<<<<<<<<<<
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":260
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_right
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 260, 0, __PYX_ERR(0, 260, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":261
 *         """
 *         def __get__(self):
 *             return self.padding_right             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, np.ndarray padding_right):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_right);
  __pyx_r = ((PyObject *)__pyx_v_self->padding_right);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":260
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_right
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":263
 *             return self.padding_right
 * 
 *         def __set__(self, np.ndarray padding_right):             # <<<<<<<<<<<<<<
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 */

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_right); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_right) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_padding_right), __pyx_ptype_5numpy_ndarray, 1, "padding_right", 0))) __PYX_ERR(0, 263, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyArrayObject *)__pyx_v_padding_right));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_right) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 263, 0, __PYX_ERR(0, 263, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":264
 * 
 *         def __set__(self, np.ndarray padding_right):
 *             self.padding_right = padding_right             # <<<<<<<<<<<<<<
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_padding_right);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v_self->padding_right);
  __pyx_v_self->padding_right = __pyx_v_padding_right;

  /* "nltkor/tag/libs/network.pyx":265
 *         def __set__(self, np.ndarray padding_right):
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_div_long(__pyx_v_self->word_window_size, 2);
  __pyx_t_2 = PyList_New(1 * ((__pyx_t_4<0) ? 0:__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_4; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_padding_right);
      __Pyx_GIVEREF((PyObject *)__pyx_v_padding_right);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, ((PyObject *)__pyx_v_padding_right))) __PYX_ERR(0, 265, __pyx_L1_error);
    }
  }
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":263
 *             return self.padding_right
 * 
 *         def __set__(self, np.ndarray padding_right):             # <<<<<<<<<<<<<<
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence, "Network.tag_sentence(self, ndarray sentence)\n\n        Runs the network for each element in the sentence and returns \n        the sequence of tags.\n        \n        :param sentence: a 2-dim numpy array, where each item encodes a token.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_9tag_sentence = {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tag_sentence") < 0)) __PYX_ERR(0, 267, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 267, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 267, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence) {
  PyObject *__pyx_v_scores = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__9)
  __Pyx_RefNannySetupContext("tag_sentence", 1);
  __Pyx_TraceCall("tag_sentence", __pyx_f[0], 267, 0, __PYX_ERR(0, 267, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":274
 *         :param sentence: a 2-dim numpy array, where each item encodes a token.
 *         """
 *         scores = self._tag_sentence(sentence)             # <<<<<<<<<<<<<<
 *         # computes full score, combining ftheta and A (if SLL)
 *         return self._viterbi(scores)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_scores = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":276
 *         scores = self._tag_sentence(sentence)
 *         # computes full score, combining ftheta and A (if SLL)
 *         return self._viterbi(scores)             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_viterbi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scores);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence, "Network._tag_sentence(self, ndarray sentence, tags=None)\n\n        Runs the network for each element in the sentence and returns \n        the sequence of tags.\n        \n        :param sentence: a 2-dim numpy array, where each item encodes a token.\n        :param tags: the correct tags (needed when training)\n        :return: a (len(sentence), output_size) array with the scores for all tokens\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence = {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_tags,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_tag_sentence") < 0)) __PYX_ERR(0, 278, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_tags = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence, __pyx_v_tags);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyObject *__pyx_v_tags) {
  PyArrayObject *__pyx_v_input_data = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyObject *__pyx_v_training = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__10)
  __Pyx_RefNannySetupContext("_tag_sentence", 1);
  __Pyx_TraceCall("_tag_sentence", __pyx_f[0], 278, 0, __PYX_ERR(0, 278, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":290
 *         cdef np.ndarray input_data
 *         # scores[t, i] = ftheta_i,t = score for i-th tag, t-th word
 *         cdef np.ndarray scores = np.empty((len(sentence), self.output_size))             # <<<<<<<<<<<<<<
 * 
 *         training = tags is not None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 290, __pyx_L1_error)
  __pyx_v_scores = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":292
 *         cdef np.ndarray scores = np.empty((len(sentence), self.output_size))
 * 
 *         training = tags is not None             # <<<<<<<<<<<<<<
 *         if training:
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 */
  __pyx_t_8 = (__pyx_v_tags != Py_None);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_training = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":293
 * 
 *         training = tags is not None
 *         if training:             # <<<<<<<<<<<<<<
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 293, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "nltkor/tag/libs/network.pyx":294
 *         training = tags is not None
 *         if training:
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))             # <<<<<<<<<<<<<<
 *             # layer2_values at each token in the correct path
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 294, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->input_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->input_sent_values);
    __pyx_v_self->input_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":296
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *             # hidden_values at each token in the correct path
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 296, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->layer2_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->layer2_sent_values);
    __pyx_v_self->layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":298
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))
 *             # hidden_values at each token in the correct path
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         self._create_sentence_lookup(sentence)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_sent_values);
    __pyx_v_self->hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":293
 * 
 *         training = tags is not None
 *         if training:             # <<<<<<<<<<<<<<
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
 */
  }

  /* "nltkor/tag/libs/network.pyx":300
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))
 * 
 *         self._create_sentence_lookup(sentence)             # <<<<<<<<<<<<<<
 * 
 *         # run through all windows in the sentence
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_sentence_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_sentence)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":303
 * 
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 303, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 303, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":304
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()             # <<<<<<<<<<<<<<
 * 
 *             # (hidden_size, input_size) . input_size = hidden_size
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Add(__pyx_v_i, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->sentence_lookup), 0, 0, &__pyx_v_i, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_input_data, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":307
 * 
 *             # (hidden_size, input_size) . input_size = hidden_size
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias             # <<<<<<<<<<<<<<
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden_weights), __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_input_data)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_v_self->hidden_bias)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->layer2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->layer2_values);
    __pyx_v_self->layer2_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":308
 *             # (hidden_size, input_size) . input_size = hidden_size
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)             # <<<<<<<<<<<<<<
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
 *             scores[i] = output
 */
    __pyx_t_5 = ((PyObject *)__pyx_v_self->layer2_values);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 308, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.inplace = __pyx_t_3;
    __pyx_t_6 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_5), &__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_values);
    __pyx_v_self->hidden_values = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/network.pyx":309
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias             # <<<<<<<<<<<<<<
 *             scores[i] = output
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->output_weights), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->hidden_values)};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = PyNumber_Add(__pyx_t_6, ((PyObject *)__pyx_v_self->output_bias)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":310
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
 *             scores[i] = output             # <<<<<<<<<<<<<<
 * 
 *             if training:
 */
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_scores), __pyx_v_i, __pyx_v_output) < 0))) __PYX_ERR(0, 310, __pyx_L1_error)

    /* "nltkor/tag/libs/network.pyx":312
 *             scores[i] = output
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/network.pyx":313
 * 
 *             if training:
 *                 self.input_sent_values[i] = input_data             # <<<<<<<<<<<<<<
 *                 self.layer2_sent_values[i] = self.layer2_values
 *                 self.hidden_sent_values[i] = self.hidden_values
 */
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->input_sent_values), __pyx_v_i, ((PyObject *)__pyx_v_input_data)) < 0))) __PYX_ERR(0, 313, __pyx_L1_error)

      /* "nltkor/tag/libs/network.pyx":314
 *             if training:
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values             # <<<<<<<<<<<<<<
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
 */
      __pyx_t_3 = ((PyObject *)__pyx_v_self->layer2_values);
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->layer2_sent_values), __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":315
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
 *                 self.hidden_sent_values[i] = self.hidden_values             # <<<<<<<<<<<<<<
 * 
 *         if training:
 */
      __pyx_t_3 = ((PyObject *)__pyx_v_self->hidden_values);
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->hidden_sent_values), __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":312
 *             scores[i] = output
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
 */
    }

    /* "nltkor/tag/libs/network.pyx":303
 * 
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":317
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 317, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "nltkor/tag/libs/network.pyx":318
 * 
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):             # <<<<<<<<<<<<<<
 *                 self._backpropagate(sentence)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients_sll); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_tags, ((PyObject *)__pyx_v_scores)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/network.pyx":319
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)             # <<<<<<<<<<<<<<
 * 
 *         return scores
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backpropagate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_sentence)};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":318
 * 
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):             # <<<<<<<<<<<<<<
 *                 self._backpropagate(sentence)
 * 
 */
    }

    /* "nltkor/tag/libs/network.pyx":317
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)
 */
  }

  /* "nltkor/tag/libs/network.pyx":321
 *                 self._backpropagate(sentence)
 * 
 *         return scores             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_delta(self, scores):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_scores);
  __pyx_r = ((PyObject *)__pyx_v_scores);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta, "Network._calculate_delta(self, scores)\n\n        Calculates a matrix with the scores for all possible paths at all given\n        points (tokens).\n        In the returned matrix, delta[i][j] means the sum of all scores \n        ending in token i with tag j (delta_i(j) in eq. 14 in the paper)\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta = {"_calculate_delta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_delta (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_delta") < 0)) __PYX_ERR(0, 323, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_scores = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_delta", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 323, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_scores) {
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_v_transitions = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__11)
  __Pyx_RefNannySetupContext("_calculate_delta", 1);
  __Pyx_TraceCall("_calculate_delta", __pyx_f[0], 323, 0, __PYX_ERR(0, 323, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":334
 *         # (use long double because taking exp's leads to very very big numbers)
 *         # scores[t][k] = ftheta_k,t
 *         delta = scores             # <<<<<<<<<<<<<<
 * 
 *         # transitions[-1] represents initial transition, A_0,i in paper (mispelled as A_i,0)
 */
  __Pyx_INCREF(__pyx_v_scores);
  __pyx_v_delta = __pyx_v_scores;

  /* "nltkor/tag/libs/network.pyx":338
 *         # transitions[-1] represents initial transition, A_0,i in paper (mispelled as A_i,0)
 *         # delta_0(k) = ftheta_k,0 + A_0,i
 *         delta[0] += self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         # logadd for the remaining tokens
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_delta, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->transitions), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_delta, __pyx_t_1, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":343
 *         # delta_t(k) = ftheta_k,t + logadd_i(delta_t-1(i) + A_i,k)
 *         #            = ftheta_k,t + log(Sum_i(exp(delta_t-1(i) + A_i,k)))
 *         transitions = self.transitions[:-1].T # A_k,i             # <<<<<<<<<<<<<<
 * 
 *         for token in xrange(1, len(delta)):
 */
  __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_transitions = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":345
 *         transitions = self.transitions[:-1].T # A_k,i
 * 
 *         for token in xrange(1, len(delta)):             # <<<<<<<<<<<<<<
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_delta); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 345, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_1)) __PYX_ERR(0, 345, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 345, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":347
 *         for token in xrange(1, len(delta)):
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)             # <<<<<<<<<<<<<<
 *             delta[token] += logadd
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_token, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_delta, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 347, __pyx_L1_error)
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.axis = __pyx_int_1;
    __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_t_3), &__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":348
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
 *             delta[token] += logadd             # <<<<<<<<<<<<<<
 * 
 *         return delta
 */
    __Pyx_INCREF(__pyx_v_token);
    __pyx_t_2 = __pyx_v_token;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_delta, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_logadd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_delta, __pyx_t_2, __pyx_t_7) < 0))) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":345
 *         transitions = self.transitions[:-1].T # A_k,i
 * 
 *         for token in xrange(1, len(delta)):             # <<<<<<<<<<<<<<
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":350
 *             delta[token] += logadd
 * 
 *         return delta             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_delta);
  __pyx_r = __pyx_v_delta;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll, "Network._calculate_gradients_sll(self, tags, scores)\n\n        Calculates the output and transition deltas for each token, using Sentence Level Likelihood.\n        The aim is to minimize the cost:\n        C(theta,A) = logadd(scores for all possible paths) - score(correct path)\n        \n        :returns: if True, normal gradient calculation was performed.\n            If False, the error was too low and weight correction should be\n            skipped.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll = {"_calculate_gradients_sll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_sll (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tags,&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_gradients_sll", 1, 2, 2, 1); __PYX_ERR(0, 352, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_gradients_sll") < 0)) __PYX_ERR(0, 352, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_sll", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 352, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_sll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_delta_softmax = 0;
  PyObject *__pyx_v_correct_path_score = NULL;
  PyObject *__pyx_v_last_tag = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_net_scores = NULL;
  PyObject *__pyx_v_trans = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_sumlogadd = NULL;
  PyObject *__pyx_v_transitions_t = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_log_sum_scores = NULL;
  PyObject *__pyx_v_grad_times_softmax = NULL;
  PyObject *__pyx_v_token = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_delta;
  __Pyx_Buffer __pyx_pybuffer_delta;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_delta_softmax;
  __Pyx_Buffer __pyx_pybuffer_delta_softmax;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  unsigned int __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  float __pyx_t_19;
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp __pyx_t_20;
  PyArrayObject *__pyx_t_21 = NULL;
  PyArrayObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__13)
  __Pyx_RefNannySetupContext("_calculate_gradients_sll", 1);
  __Pyx_TraceCall("_calculate_gradients_sll", __pyx_f[0], 352, 0, __PYX_ERR(0, 352, __pyx_L1_error));
  __pyx_pybuffer_delta.pybuffer.buf = NULL;
  __pyx_pybuffer_delta.refcount = 0;
  __pyx_pybuffernd_delta.data = NULL;
  __pyx_pybuffernd_delta.rcbuffer = &__pyx_pybuffer_delta;
  __pyx_pybuffer_delta_softmax.pybuffer.buf = NULL;
  __pyx_pybuffer_delta_softmax.refcount = 0;
  __pyx_pybuffernd_delta_softmax.data = NULL;
  __pyx_pybuffernd_delta_softmax.rcbuffer = &__pyx_pybuffer_delta_softmax;

  /* "nltkor/tag/libs/network.pyx":368
 *         # ftheta_i,t = network output for i-th tag, at t-th word
 *         # s = Sum_i(A_tags[i-1],tags[i] + ftheta_i,i), i < len(sentence)   (12)
 *         correct_path_score = 0             # <<<<<<<<<<<<<<
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_correct_path_score = __pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":369
 *         # s = Sum_i(A_tags[i-1],tags[i] + ftheta_i,i), i < len(sentence)   (12)
 *         correct_path_score = 0
 *         last_tag = self.output_size             # <<<<<<<<<<<<<<
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
 *             #print(tags, last_tag, tag, self.transitions)
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_last_tag = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tags, 0, -2L, NULL, NULL, &__pyx_slice__14, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_scores, 0, -2L, NULL, NULL, &__pyx_slice__14, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 370, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 370, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 370, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_net_scores, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/network.pyx":372
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]             # <<<<<<<<<<<<<<
 *             #print ('trans:',trans)
 *             #print ('net:',tag, net_scores[tag])
 */
    __pyx_t_9 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
    if (__pyx_t_9) {
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_2 = __pyx_int_0;
    } else {
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_last_tag);
      __Pyx_GIVEREF(__pyx_v_last_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_last_tag)) __PYX_ERR(0, 372, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_tag);
      __Pyx_GIVEREF(__pyx_v_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_tag)) __PYX_ERR(0, 372, __pyx_L1_error);
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->transitions), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_trans, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":376
 *             #print ('net:',tag, net_scores[tag])
 *             #print
 *             correct_path_score += trans + net_scores[tag]             # <<<<<<<<<<<<<<
 *             last_tag = tag
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_net_scores, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_v_trans, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_correct_path_score, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_correct_path_score, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":377
 *             #print
 *             correct_path_score += trans + net_scores[tag]
 *             last_tag = tag             # <<<<<<<<<<<<<<
 * 
 *         # delta[t] = delta_t in equation (14)
 */
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_v_tag);

    /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":380
 * 
 *         # delta[t] = delta_t in equation (14)
 *         delta = self._calculate_delta(scores)             # <<<<<<<<<<<<<<
 *         # logadd_i(delta_T(i)) = log(Sum_i(exp(delta_T(i))))
 *         # Sentence-level Log-Likelihood (SLL)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_scores};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
    __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_12 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta.rcbuffer->pybuffer, (PyObject*)__pyx_v_delta, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      }
      __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
    }
    __pyx_pybuffernd_delta.diminfo[0].strides = __pyx_pybuffernd_delta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_delta.diminfo[0].shape = __pyx_pybuffernd_delta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_delta.diminfo[1].strides = __pyx_pybuffernd_delta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_delta.diminfo[1].shape = __pyx_pybuffernd_delta.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 380, __pyx_L1_error)
  }
  __pyx_t_11 = 0;
  __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":386
 *         #print ': ', np.log(np.sum(np.exp(delta[-1])))
 *         #print '> ', correct_path_score
 *         error = np.log(np.sum(np.exp(delta[-1]))) - correct_path_score             # <<<<<<<<<<<<<<
 *         #print error
 *         #error = logsumexp(delta[-1]) - correct_path_score
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_exp); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_18 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_18)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_16};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  }
  __pyx_t_17 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_17)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_correct_path_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_error = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":389
 *         #print error
 *         #error = logsumexp(delta[-1]) - correct_path_score
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         # if the error is too low, don't bother training (saves time and avoids
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_19 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_19 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->error = __pyx_t_19;

  /* "nltkor/tag/libs/network.pyx":397
 *         # error 0.22 -> 80%
 *         # error 0.1  -> 90%
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_error, __pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_9) {

    /* "nltkor/tag/libs/network.pyx":398
 *         # error 0.1  -> 90%
 *         if error <= 0.01:
 *             self.skips += 1             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_v_self->skips = (__pyx_v_self->skips + 1);

    /* "nltkor/tag/libs/network.pyx":399
 *         if error <= 0.01:
 *             self.skips += 1
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # initialize gradients
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":397
 *         # error 0.22 -> 80%
 *         # error 0.1  -> 90%
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
 */
  }

  /* "nltkor/tag/libs/network.pyx":403
 *         # initialize gradients
 *         # dC / dftheta
 *         self.net_gradients = np.zeros((len(tags), self.output_size))             # <<<<<<<<<<<<<<
 *         # dC / dA
 *         #self.trans_gradients = np.zeros_like(self.transitions, float)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = PyObject_Length(__pyx_v_tags); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_v_self->net_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":406
 *         # dC / dA
 *         #self.trans_gradients = np.zeros_like(self.transitions, float)
 *         self.trans_gradients = np.zeros_like(self.transitions, np.float64)             # <<<<<<<<<<<<<<
 * 
 *         # things get nasty from here
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->transitions), __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->trans_gradients);
  __pyx_v_self->trans_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":418
 *         # delta_T(i) - logsumexp(delta_T(k))
 *         # dC_logadd / ddelta_T(i) = e(delta_T(i) - logsumexp(delta_T(k)))
 *         sumlogadd = logsumexp(delta[-1])             # <<<<<<<<<<<<<<
 *         # negative gradients
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)
 */
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 418, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sumlogadd = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/network.pyx":420
 *         sumlogadd = logsumexp(delta[-1])
 *         # negative gradients
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)             # <<<<<<<<<<<<<<
 * 
 *         transitions_t = 0 if self.transitions is None else self.transitions[:-1].T
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_v_sumlogadd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->net_gradients), -1L, __pyx_t_7, long, 1, __Pyx_PyInt_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/network.pyx":422
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)
 * 
 *         transitions_t = 0 if self.transitions is None else self.transitions[:-1].T             # <<<<<<<<<<<<<<
 * 
 *         # delta[i][j]: sum of scores of all path that assign tag j to ith-token
 */
  __pyx_t_9 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
  if (__pyx_t_9) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_7 = __pyx_int_0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_v_transitions_t = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/network.pyx":427
 * 
 *         # now compute the gradients for the other tokens, from last to first
 *         for t in range(len(scores) - 2, -1, -1):             # <<<<<<<<<<<<<<
 * 
 *             # sum the scores for all paths ending with each tag i at token t
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_scores); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_t_7 = PyInt_FromSsize_t((__pyx_t_4 - 2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1)) __PYX_ERR(0, 427, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_neg_1)) __PYX_ERR(0, 427, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 427, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":433
 *             # Obtained by transposing twice
 *             # [delta_t-1(i)+A_j,i]T
 *             path_scores = (delta[t] + transitions_t).T             # <<<<<<<<<<<<<<
 * 
 *             # normalize over all possible tag paths using a softmax,
 */
    __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_delta), __pyx_v_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_transitions_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path_scores, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":438
 *             # computed using log.
 *             # the log of the sums of exps, summed by column
 *             log_sum_scores = logsumexp(path_scores, 0)             # <<<<<<<<<<<<<<
 * 
 *             # softmax is the division of an exponential by the sum of all exponentials
 */
    if (!(likely(((__pyx_v_path_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_path_scores, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 438, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.axis = __pyx_int_0;
    __pyx_t_7 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_v_path_scores), &__pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_log_sum_scores, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":443
 *             # (yields a probability)
 *             # e(delta_t-1(i)+A_i,j) / Sum_k e(delta_t-1(k)+A_k,j)
 *             delta_softmax = np.exp(path_scores - log_sum_scores)             # <<<<<<<<<<<<<<
 * 
 *             # multiply each value in the softmax by the gradient at the next tag
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_path_scores, __pyx_v_log_sum_scores); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 443, __pyx_L1_error)
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_7);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer, (PyObject*)__pyx_v_delta_softmax, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
        }
        __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
      }
      __pyx_pybuffernd_delta_softmax.diminfo[0].strides = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_delta_softmax.diminfo[0].shape = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_delta_softmax.diminfo[1].strides = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_delta_softmax.diminfo[1].shape = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 443, __pyx_L1_error)
    }
    __pyx_t_21 = 0;
    __Pyx_XDECREF_SET(__pyx_v_delta_softmax, ((PyArrayObject *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":448
 *             # dC_logadd / ddelta_t(i) * delta_softmax
 *             # Attardi: negative since net_gradients[t + 1] already negative
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax             # <<<<<<<<<<<<<<
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax
 */
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_t, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, ((PyObject *)__pyx_v_delta_softmax)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_grad_times_softmax, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":450
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax             # <<<<<<<<<<<<<<
 * 
 *             # sum all transition gradients by row to find the network gradients
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
    __pyx_t_22 = __pyx_v_self->trans_gradients;
    __Pyx_INCREF(__pyx_tuple__15);
    __pyx_t_23 = __pyx_tuple__15;
    __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_22), __pyx_t_23); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_v_grad_times_softmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_22), __pyx_t_23, __pyx_t_3) < 0))) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;

    /* "nltkor/tag/libs/network.pyx":455
 *             # Sum_j(dC_logadd / ddelta_t(j) * delta_softmax)
 *             # Attardi: negative since grad_times_softmax already negative
 *             self.net_gradients[t] = np.sum(grad_times_softmax, 1)             # <<<<<<<<<<<<<<
 * 
 *         # find the gradients for the starting transition
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_grad_times_softmax, __pyx_int_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_t, __pyx_t_3) < 0))) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":427
 * 
 *         # now compute the gradients for the other tokens, from last to first
 *         for t in range(len(scores) - 2, -1, -1):             # <<<<<<<<<<<<<<
 * 
 *             # sum the scores for all paths ending with each tag i at token t
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":459
 *         # find the gradients for the starting transition
 *         # there is only one possibility to come from, which is the sentence start
 *         self.trans_gradients[-1] = self.net_gradients[0]             # <<<<<<<<<<<<<<
 * 
 *         # now, add +1 to the correct path
 */
  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->net_gradients), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->trans_gradients), -1L, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":462
 * 
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size             # <<<<<<<<<<<<<<
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":463
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_2 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_tags)) || PyTuple_CheckExact(__pyx_v_tags)) {
    __pyx_t_3 = __pyx_v_tags; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_tags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 463, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/network.pyx":464
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 */
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_token); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_tag);
    __pyx_t_7 = __pyx_v_tag;
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_17) < 0))) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "nltkor/tag/libs/network.pyx":465
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:             # <<<<<<<<<<<<<<
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag
 */
    __pyx_t_9 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
    if (__pyx_t_9) {

      /* "nltkor/tag/libs/network.pyx":466
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             last_tag = tag
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->trans_gradients), __pyx_v_last_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_tag);
      __pyx_t_7 = __pyx_v_tag;
      __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_17, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_1) < 0))) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "nltkor/tag/libs/network.pyx":465
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:             # <<<<<<<<<<<<<<
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag
 */
    }

    /* "nltkor/tag/libs/network.pyx":467
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_v_tag);

    /* "nltkor/tag/libs/network.pyx":463
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":469
 *             last_tag = tag
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF((PyObject *)__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_sll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta_softmax);
  __Pyx_XDECREF(__pyx_v_correct_path_score);
  __Pyx_XDECREF(__pyx_v_last_tag);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_net_scores);
  __Pyx_XDECREF(__pyx_v_trans);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_sumlogadd);
  __Pyx_XDECREF(__pyx_v_transitions_t);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_log_sum_scores);
  __Pyx_XDECREF(__pyx_v_grad_times_softmax);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll, "Network._calculate_gradients_wll(self, tags, scores)\n\n        Calculates the output for each token, using Word Level Likelihood.\n        The aim is to minimize the word-level log-likelihood:\n        C(ftheta) = logadd_j(ftheta_j) - ftheta_y,\n        where y is the sequence of correct tags\n        \n        :returns: if True, normal gradient calculation was performed.\n            If False, the error was too low and weight correction should be\n            skipped.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll = {"_calculate_gradients_wll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_wll (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tags,&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_gradients_wll", 1, 2, 2, 1); __PYX_ERR(0, 471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_gradients_wll") < 0)) __PYX_ERR(0, 471, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_wll", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 471, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_wll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyObject *__pyx_v_exponentials = NULL;
  PyObject *__pyx_v_correct_path_score = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_net_scores = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__16)
  __Pyx_RefNannySetupContext("_calculate_gradients_wll", 1);
  __Pyx_TraceCall("_calculate_gradients_wll", __pyx_f[0], 471, 0, __PYX_ERR(0, 471, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":485
 *         # compute the negative gradient with respect to ftheta
 *         # dC / dftheta_i = e(ftheta_i)/Sum_k(e(ftheta_k))
 *         exponentials = np.exp(scores)             # <<<<<<<<<<<<<<
 *         # FIXME: use logsumexp
 *         # ((len(sentence), self.output_size))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_exponentials = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":488
 *         # FIXME: use logsumexp
 *         # ((len(sentence), self.output_size))
 *         self.net_gradients = -(exponentials.T / exponentials.sum(1)).T             # <<<<<<<<<<<<<<
 * 
 *         # correct path and its gradient
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_exponentials, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_exponentials, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_int_1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_v_self->net_gradients = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":491
 * 
 *         # correct path and its gradient
 *         correct_path_score = 0             # <<<<<<<<<<<<<<
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_correct_path_score = __pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":492
 *         # correct path and its gradient
 *         correct_path_score = 0
 *         token = 0             # <<<<<<<<<<<<<<
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_token = __pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":493
 *         correct_path_score = 0
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_tags);
  __Pyx_GIVEREF(__pyx_v_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tags)) __PYX_ERR(0, 493, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_scores);
  __Pyx_GIVEREF(__pyx_v_scores);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_scores)) __PYX_ERR(0, 493, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 493, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 493, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 493, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_net_scores, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":494
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             token += 1
 *             correct_path_score += net_scores[tag]
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_tag);
    __pyx_t_5 = __pyx_v_tag;
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_5, __pyx_t_8) < 0))) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":495
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1             # <<<<<<<<<<<<<<
 *             correct_path_score += net_scores[tag]
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_token, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_token, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":496
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
 *             correct_path_score += net_scores[tag]             # <<<<<<<<<<<<<<
 * 
 *         # C(ftheta) = logadd_j(ftheta_j) - score(correct path)
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_net_scores, __pyx_v_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_correct_path_score, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_correct_path_score, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":493
 *         correct_path_score = 0
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":500
 *         # C(ftheta) = logadd_j(ftheta_j) - score(correct path)
 *         #error = np.log(np.sum(np.exp(scores))) - correct_path_score
 *         error = logsumexp(scores) - correct_path_score             # <<<<<<<<<<<<<<
 *         # approximate
 *         #error = np.max(scores) - correct_path_score
 */
  if (!(likely(((__pyx_v_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_scores, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_v_scores), NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_v_correct_path_score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_error = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/network.pyx":503
 *         # approximate
 *         #error = np.max(scores) - correct_path_score
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_v_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->error = __pyx_t_10;

  /* "nltkor/tag/libs/network.pyx":505
 *         self.error += error
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_wll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exponentials);
  __Pyx_XDECREF(__pyx_v_correct_path_score);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_net_scores);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi, "Network._viterbi(self, ndarray scores)\n\n        Performs a Viterbi search over the scores for each tag using\n        the transitions matrix. If a matrix wasn't supplied, \n        it will return the tags with the highest scores individually.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_19_viterbi = {"_viterbi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_viterbi (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_viterbi") < 0)) __PYX_ERR(0, 507, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_scores = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_viterbi", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 507, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scores), __pyx_ptype_5numpy_ndarray, 1, "scores", 0))) __PYX_ERR(0, 508, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_scores);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_scores) {
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_path_backtrack = NULL;
  PyObject *__pyx_v_output_range = NULL;
  PyObject *__pyx_v_transitions = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_prev_score_and_trans = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_previous_tag = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  float __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__17)
  __Pyx_RefNannySetupContext("_viterbi", 1);
  __Pyx_TraceCall("_viterbi", __pyx_f[0], 507, 0, __PYX_ERR(0, 507, __pyx_L1_error));
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 507, __pyx_L1_error)
  }
  __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/network.pyx":515
 *         """
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:             # <<<<<<<<<<<<<<
 *             return scores.argmax(1)
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 515, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 == 1);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":516
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:
 *             return scores.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *         path_scores = np.empty_like(scores)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":515
 *         """
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:             # <<<<<<<<<<<<<<
 *             return scores.argmax(1)
 * 
 */
  }

  /* "nltkor/tag/libs/network.pyx":518
 *             return scores.argmax(1)
 * 
 *         path_scores = np.empty_like(scores)             # <<<<<<<<<<<<<<
 *         #path_backtrack = np.empty_like(scores, np.int64)
 *         path_backtrack = np.empty_like(scores, int)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_scores)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v_path_scores = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":520
 *         path_scores = np.empty_like(scores)
 *         #path_backtrack = np.empty_like(scores, np.int64)
 *         path_backtrack = np.empty_like(scores, int)             # <<<<<<<<<<<<<<
 * 
 *         # now the actual Viterbi algorithm
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_scores), ((PyObject *)(&PyInt_Type))};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_path_backtrack = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":525
 *         # first, get the scores for each tag at token 0
 *         # the last row of the transitions table has the scores for the first tag
 *         path_scores[0] = scores[0] + self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi
 */
  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->transitions), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, 0, __pyx_t_6, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0))) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/network.pyx":527
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi             # <<<<<<<<<<<<<<
 *         transitions = self.transitions[:-1]        # idem
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_output_range = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/network.pyx":528
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi
 *         transitions = self.transitions[:-1]        # idem             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
  __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_transitions = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/network.pyx":531
 * 
 *         cdef int i
 *         for i in xrange(1, len(scores)):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 531, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_3;
  for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":534
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 *             prev_score_and_trans = (path_scores[i - 1] + transitions.T).T             # <<<<<<<<<<<<<<
 * 
 *             # find the previous tag that yielded the max score
 */
    __pyx_t_11 = (__pyx_v_i - 1);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_scores, __pyx_t_11, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_transitions, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_prev_score_and_trans, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":537
 * 
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)             # <<<<<<<<<<<<<<
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_prev_score_and_trans, __pyx_n_s_argmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (unlikely((__Pyx_SetItemInt(__pyx_v_path_backtrack, __pyx_v_i, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_path_backtrack, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "nltkor/tag/libs/network.pyx":539
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_output_range);
    __Pyx_GIVEREF(__pyx_v_output_range);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_output_range)) __PYX_ERR(0, 538, __pyx_L1_error);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_prev_score_and_trans, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":539
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 */
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
 */
    if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, __pyx_v_i, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "nltkor/tag/libs/network.pyx":543
 *         # now find the maximum score for the last token and follow the backtrack
 *         #answer = np.empty(len(scores), dtype=np.int64)
 *         answer = np.empty(len(scores), dtype=int)             # <<<<<<<<<<<<<<
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_answer = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":544
 *         #answer = np.empty(len(scores), dtype=np.int64)
 *         answer = np.empty(len(scores), dtype=int)
 *         answer[-1] = path_scores[-1].argmax()             # <<<<<<<<<<<<<<
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]
 */
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_argmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, -1L, __pyx_t_8, long, 1, __Pyx_PyInt_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":545
 *         answer = np.empty(len(scores), dtype=int)
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]             # <<<<<<<<<<<<<<
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->answer_score = __pyx_t_12;

  /* "nltkor/tag/libs/network.pyx":546
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 */
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_backtrack, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_previous_tag = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":548
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
  for (__pyx_t_10 = (__pyx_t_3 - 2); __pyx_t_10 > 0; __pyx_t_10-=1) {
    __pyx_v_i = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":549
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag             # <<<<<<<<<<<<<<
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 */
    if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, __pyx_v_i, __pyx_v_previous_tag, int, 1, __Pyx_PyInt_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 549, __pyx_L1_error)

    /* "nltkor/tag/libs/network.pyx":550
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]             # <<<<<<<<<<<<<<
 * 
 *         answer[0] = previous_tag
 */
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_backtrack, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_previous_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_previous_tag, __pyx_t_4);
    __pyx_t_4 = 0;
  }

  /* "nltkor/tag/libs/network.pyx":552
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 *         answer[0] = previous_tag             # <<<<<<<<<<<<<<
 *         return answer
 * 
 */
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, 0, __pyx_v_previous_tag, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0))) __PYX_ERR(0, 552, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":553
 * 
 *         answer[0] = previous_tag
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list validation_sentences=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_path_backtrack);
  __Pyx_XDECREF(__pyx_v_output_range);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF(__pyx_v_prev_score_and_trans);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_previous_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data, "Network.set_validation_data(self, list validation_sentences=None, list validation_tags=None)\n\n        Sets the data to be used during validation. If this function is not\n        called before training, the training data is used to measure performance.\n        \n        :param validation_sentences: sentences to be used in validation.\n        :param validation_tags: tags for the validation sentences.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_21set_validation_data = {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_validation_sentences = 0;
  PyObject *__pyx_v_validation_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_validation_sentences,&__pyx_n_s_validation_tags,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "nltkor/tag/libs/network.pyx":556
 * 
 *     def set_validation_data(self, list validation_sentences=None,
 *                             list validation_tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used during validation. If this function is not
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_sentences);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_tags);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_validation_data") < 0)) __PYX_ERR(0, 555, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_validation_sentences = ((PyObject*)values[0]);
    __pyx_v_validation_tags = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_sentences), (&PyList_Type), 1, "validation_sentences", 1))) __PYX_ERR(0, 555, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_tags), (&PyList_Type), 1, "validation_tags", 1))) __PYX_ERR(0, 556, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_validation_sentences, __pyx_v_validation_tags);

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_tags) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__18)
  __Pyx_RefNannySetupContext("set_validation_data", 1);
  __Pyx_TraceCall("set_validation_data", __pyx_f[0], 555, 0, __PYX_ERR(0, 555, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":564
 *         :param validation_tags: tags for the validation sentences.
 *         """
 *         self.validation_sentences = validation_sentences             # <<<<<<<<<<<<<<
 *         self.validation_tags = validation_tags
 * 
 */
  __Pyx_INCREF(__pyx_v_validation_sentences);
  __Pyx_GIVEREF(__pyx_v_validation_sentences);
  __Pyx_GOTREF(__pyx_v_self->validation_sentences);
  __Pyx_DECREF(__pyx_v_self->validation_sentences);
  __pyx_v_self->validation_sentences = __pyx_v_validation_sentences;

  /* "nltkor/tag/libs/network.pyx":565
 *         """
 *         self.validation_sentences = validation_sentences
 *         self.validation_tags = validation_tags             # <<<<<<<<<<<<<<
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):
 */
  __Pyx_INCREF(__pyx_v_validation_tags);
  __Pyx_GIVEREF(__pyx_v_validation_tags);
  __Pyx_GOTREF(__pyx_v_self->validation_tags);
  __Pyx_DECREF(__pyx_v_self->validation_tags);
  __pyx_v_self->validation_tags = __pyx_v_validation_tags;

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay, "Network.set_learning_rate_decay(self, float decay_factor=1.0)\n\n        Sets the network to use learning rate decay. \n        \n        The learning rate at each iteration t is determined as:\n        initial_rate / (1 + t * decay_factor)\n        \n        with t starting from 0\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay = {"set_learning_rate_decay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  float __pyx_v_decay_factor;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_learning_rate_decay (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decay_factor,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decay_factor);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_learning_rate_decay") < 0)) __PYX_ERR(0, 567, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_decay_factor = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_decay_factor == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error)
    } else {
      __pyx_v_decay_factor = ((float)1.0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_learning_rate_decay", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_learning_rate_decay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_decay_factor);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, float __pyx_v_decay_factor) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__19)
  __Pyx_RefNannySetupContext("set_learning_rate_decay", 1);
  __Pyx_TraceCall("set_learning_rate_decay", __pyx_f[0], 567, 0, __PYX_ERR(0, 567, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":576
 *         with t starting from 0
 *         """
 *         self.use_learning_rate_decay = True             # <<<<<<<<<<<<<<
 *         self.decay_factor = decay_factor
 * 
 */
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyBoolObject *)Py_True);

  /* "nltkor/tag/libs/network.pyx":577
 *         """
 *         self.use_learning_rate_decay = True
 *         self.decay_factor = decay_factor             # <<<<<<<<<<<<<<
 * 
 *     def decrease_learning_rates(self, epoch):
 */
  __pyx_v_self->decay_factor = __pyx_v_decay_factor;

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_learning_rate_decay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates, "Network.decrease_learning_rates(self, epoch)\n\n        Apply the learning rate decay, if the network was configured to use it.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates = {"decrease_learning_rates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_epoch = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decrease_learning_rates (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_epoch,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epoch)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decrease_learning_rates") < 0)) __PYX_ERR(0, 579, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_epoch = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decrease_learning_rates", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 579, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decrease_learning_rates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_epoch);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_epoch) {
  PyObject *__pyx_v_factor = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  float __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__20)
  __Pyx_RefNannySetupContext("decrease_learning_rates", 1);
  __Pyx_TraceCall("decrease_learning_rates", __pyx_f[0], 579, 0, __PYX_ERR(0, 579, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":583
 *         Apply the learning rate decay, if the network was configured to use it.
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_learning_rate_decay)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_epoch, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":584
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # multiplying the last rate by this adjustment is equivalent to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":583
 *         Apply the learning rate decay, if the network was configured to use it.
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "nltkor/tag/libs/network.pyx":589
 *         # initial_rate / (1 + t * decay_factor)
 *         # and we don't need to store the initial rates
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)             # <<<<<<<<<<<<<<
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
 */
  __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_epoch, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyFloat_AddCObj(__pyx_float_1_0, __pyx_t_6, 1.0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_epoch, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_factor = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":590
 *         # and we don't need to store the initial rates
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)
 *         self.learning_rate *= factor             # <<<<<<<<<<<<<<
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:
 */
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->learning_rate = __pyx_t_7;

  /* "nltkor/tag/libs/network.pyx":591
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor             # <<<<<<<<<<<<<<
 *         if self.transitions is not None:
 *             self.learning_rate_trans *= factor
 */
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_6, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->learning_rate_features = __pyx_t_7;

  /* "nltkor/tag/libs/network.pyx":592
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.learning_rate_trans *= factor
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":593
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:
 *             self.learning_rate_trans *= factor             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list tags,
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_self->learning_rate_trans = __pyx_t_7;

    /* "nltkor/tag/libs/network.pyx":592
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.learning_rate_trans *= factor
 * 
 */
  }

  /* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decrease_learning_rates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_factor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train, "Network.train(self, list sentences, list tags, int epochs, int epochs_between_reports=0, float desired_accuracy=0)\n\n        Trains the network to tag sentences.\n        \n        :param sentences: a list of 2-dim numpy arrays, where each item \n            encodes a sentence. Each item in a sentence has the \n            indices to its features.\n        :param tags: a list of 1-dim numpy arrays, where each item has\n            the tags of the sentences.\n        :param epochs: number of training epochs\n        :param epochs_between_reports: number of epochs to wait between\n            reports about the training performance. 0 means no reports.\n        :param desired_accuracy: training stops if the desired accuracy\n            is reached. Ignored if 0.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_27train = {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_tags = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_tags,&__pyx_n_s_epochs,&__pyx_n_s_epochs_between_reports,&__pyx_n_s_desired_accuracy,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 3, 5, 1); __PYX_ERR(0, 595, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 3, 5, 2); __PYX_ERR(0, 595, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs_between_reports);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_desired_accuracy);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "train") < 0)) __PYX_ERR(0, 595, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_tags = ((PyObject*)values[1]);
    __pyx_v_epochs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_epochs_between_reports = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[4]) {
      __pyx_v_desired_accuracy = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(0, 595, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(0, 595, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentences, __pyx_v_tags, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 617, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_train_locals_genexpr, __pyx_n_s_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __Pyx_TraceCall("genexpr", __pyx_f[0], 617, 0, __PYX_ERR(0, 617, __pyx_L1_error));
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceReturn(Py_None, 0);
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 617, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 617, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 617, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 617, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 617, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_TraceReturn(__pyx_r, 0);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 617, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy) {
  PyObject *__pyx_v_logger = NULL;
  double __pyx_v_top_accuracy;
  double __pyx_v_last_accuracy;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  float __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__21)
  __Pyx_RefNannySetupContext("train", 1);
  __Pyx_TraceCall("train", __pyx_f[0], 595, 0, __PYX_ERR(0, 595, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":612
 *             is reached. Ignored if 0.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":613
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)             # <<<<<<<<<<<<<<
 *         top_accuracy = 0
 *         last_accuracy = 0
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Training_for_up_to_d_epochs, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":614
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_accuracy = 0
 *         last_error = np.Infinity
 */
  __pyx_v_top_accuracy = 0.0;

  /* "nltkor/tag/libs/network.pyx":615
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0
 *         last_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 */
  __pyx_v_last_accuracy = 0.0;

  /* "nltkor/tag/libs/network.pyx":616
 *         top_accuracy = 0
 *         last_accuracy = 0
 *         last_error = np.Infinity             # <<<<<<<<<<<<<<
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_last_error = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
 */
  __pyx_t_3 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(NULL, __pyx_v_sentences); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->num_tokens = __pyx_t_6;

  /* "nltkor/tag/libs/network.pyx":619
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags
 */
  __pyx_t_7 = (__pyx_v_self->validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_7) {

    /* "nltkor/tag/libs/network.pyx":620
 * 
 *         if self.validation_sentences is None:
 *             self.validation_sentences = sentences             # <<<<<<<<<<<<<<
 *             self.validation_tags = tags
 * 
 */
    __Pyx_INCREF(__pyx_v_sentences);
    __Pyx_GIVEREF(__pyx_v_sentences);
    __Pyx_GOTREF(__pyx_v_self->validation_sentences);
    __Pyx_DECREF(__pyx_v_self->validation_sentences);
    __pyx_v_self->validation_sentences = __pyx_v_sentences;

    /* "nltkor/tag/libs/network.pyx":621
 *         if self.validation_sentences is None:
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags             # <<<<<<<<<<<<<<
 * 
 *         for i in range(epochs):
 */
    __Pyx_INCREF(__pyx_v_tags);
    __Pyx_GIVEREF(__pyx_v_tags);
    __Pyx_GOTREF(__pyx_v_self->validation_tags);
    __Pyx_DECREF(__pyx_v_self->validation_tags);
    __pyx_v_self->validation_tags = __pyx_v_tags;

    /* "nltkor/tag/libs/network.pyx":619
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags
 */
  }

  /* "nltkor/tag/libs/network.pyx":623
 *             self.validation_tags = tags
 * 
 *         for i in range(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 623, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 623, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":624
 * 
 *         for i in range(epochs):
 *             self.decrease_learning_rates(i)             # <<<<<<<<<<<<<<
 *             self._train_epoch(sentences, tags)
 *             self._validate()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decrease_learning_rates); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_i};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":625
 *         for i in range(epochs):
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)             # <<<<<<<<<<<<<<
 *             self._validate()
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_train_epoch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_tags};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":626
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
 *             self._validate()             # <<<<<<<<<<<<<<
 * 
 *             # normalize error
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_validate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":629
 * 
 *             # normalize error
 *             self.error = self.error / self.num_tokens if self.num_tokens else np.Infinity             # <<<<<<<<<<<<<<
 * 
 *             # Attardi: save model
 */
    __pyx_t_7 = (__pyx_v_self->num_tokens != 0);
    if (__pyx_t_7) {
      if (unlikely(__pyx_v_self->num_tokens == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 629, __pyx_L1_error)
      }
      __pyx_t_10 = (__pyx_v_self->error / ((float)__pyx_v_self->num_tokens));
    } else {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = __pyx_t_11;
    }
    __pyx_v_self->error = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":632
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
 */
    __pyx_t_7 = (__pyx_v_self->accuracy > __pyx_v_top_accuracy);
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":633
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *                 self.save()
 *                 logger.debug("Saved model")
 */
      __pyx_t_10 = __pyx_v_self->accuracy;
      __pyx_v_top_accuracy = __pyx_t_10;

      /* "nltkor/tag/libs/network.pyx":634
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy
 *                 self.save()             # <<<<<<<<<<<<<<
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/network.pyx":635
 *                 top_accuracy = self.accuracy
 *                 self.save()
 *                 logger.debug("Saved model")             # <<<<<<<<<<<<<<
 *             elif self.use_learning_rate_decay:
 *                 # this iteration didn't bring improvements; load the last saved model
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_Saved_model};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/network.pyx":632
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
 */
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/network.pyx":636
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_learning_rate_decay)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 636, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":639
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 *                 self._load_parameters()             # <<<<<<<<<<<<<<
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/network.pyx":636
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 */
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    __pyx_t_12 = (__pyx_v_epochs_between_reports > 0);
    if (!__pyx_t_12) {
      goto __pyx_L9_next_or;
    } else {
    }
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyNumber_Remainder(__pyx_v_i, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_12 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_3, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_L9_next_or:;

    /* "nltkor/tag/libs/network.pyx":642
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \             # <<<<<<<<<<<<<<
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 */
    __pyx_t_12 = (__pyx_v_self->accuracy >= __pyx_v_desired_accuracy);
    if (__pyx_t_12) {
      __pyx_t_12 = (__pyx_v_desired_accuracy > 0.0);
    }
    if (!__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }

    /* "nltkor/tag/libs/network.pyx":643
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 * 
 *                 self._print_epoch_report(i + 1)
 */
    __pyx_t_12 = (__pyx_v_self->accuracy < __pyx_v_last_accuracy);
    if (__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_t_12;
    __pyx_L8_bool_binop_done:;

    /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":645
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 *                 self._print_epoch_report(i + 1)             # <<<<<<<<<<<<<<
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_epoch_report); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
 */
      __pyx_t_12 = (__pyx_v_self->accuracy >= __pyx_v_desired_accuracy);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_v_desired_accuracy > 0.0);
      }
      if (!__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L14_bool_binop_done;
      }

      /* "nltkor/tag/libs/network.pyx":648
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.error > last_error and self.accuracy < last_accuracy):             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_12 = (__pyx_v_self->accuracy < __pyx_v_last_accuracy);
      __pyx_t_7 = __pyx_t_12;
      __pyx_L14_bool_binop_done:;

      /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
 */
      if (__pyx_t_7) {

        /* "nltkor/tag/libs/network.pyx":649
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             last_accuracy = self.accuracy
 */
        goto __pyx_L5_break;

        /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
 */
      }

      /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    }

    /* "nltkor/tag/libs/network.pyx":651
 *                     break
 * 
 *             last_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *             last_error = self.error
 * 
 */
    __pyx_t_10 = __pyx_v_self->accuracy;
    __pyx_v_last_accuracy = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":652
 * 
 *             last_accuracy = self.accuracy
 *             last_error = self.error             # <<<<<<<<<<<<<<
 * 
 *         self.num_tokens = 0
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_last_error, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":623
 *             self.validation_tags = tags
 * 
 *         for i in range(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L17_for_end;
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L17_for_end;
  __pyx_L17_for_end:;

  /* "nltkor/tag/libs/network.pyx":654
 *             last_error = self.error
 * 
 *         self.num_tokens = 0             # <<<<<<<<<<<<<<
 * 
 *     def _print_epoch_report(self, int num):
 */
  __pyx_v_self->num_tokens = 0;

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report, "Network._print_epoch_report(self, int num)\n\n        Reports the status of the network in the given training\n        epoch, including error and accuracy.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report = {"_print_epoch_report", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_print_epoch_report (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_print_epoch_report") < 0)) __PYX_ERR(0, 656, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_num = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 656, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_num);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, int __pyx_v_num) {
  PyObject *__pyx_v_logger = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__22)
  __Pyx_RefNannySetupContext("_print_epoch_report", 1);
  __Pyx_TraceCall("_print_epoch_report", __pyx_f[0], 656, 0, __PYX_ERR(0, 656, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":661
 *         epoch, including error and accuracy.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \
 *             "%d corrections skipped   " \
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":662
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \             # <<<<<<<<<<<<<<
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;

  /* "nltkor/tag/libs/network.pyx":664
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,             # <<<<<<<<<<<<<<
 *                                    self.error,
 *                                    self.accuracy,
 */
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_epochs_Error);
  __pyx_t_5 += 17;
  __Pyx_GIVEREF(__pyx_kp_u_epochs_Error);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_epochs_Error);

  /* "nltkor/tag/libs/network.pyx":665
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
 *                                    self.error,             # <<<<<<<<<<<<<<
 *                                    self.accuracy,
 *                                    self.skips,
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_Accuracy);
  __pyx_t_5 += 13;
  __Pyx_GIVEREF(__pyx_kp_u_Accuracy);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u_Accuracy);

  /* "nltkor/tag/libs/network.pyx":666
 *             "learning rate: %f" % (num,
 *                                    self.error,
 *                                    self.accuracy,             # <<<<<<<<<<<<<<
 *                                    self.skips,
 *                                    self.learning_rate))
 */
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->accuracy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_8, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__23);
  __pyx_t_5 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__23);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u__23);

  /* "nltkor/tag/libs/network.pyx":667
 *                                    self.error,
 *                                    self.accuracy,
 *                                    self.skips,             # <<<<<<<<<<<<<<
 *                                    self.learning_rate))
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_self->skips, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_corrections_skipped_learning_ra);
  __pyx_t_5 += 38;
  __Pyx_GIVEREF(__pyx_kp_u_corrections_skipped_learning_ra);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u_corrections_skipped_learning_ra);

  /* "nltkor/tag/libs/network.pyx":668
 *                                    self.accuracy,
 *                                    self.skips,
 *                                    self.learning_rate))             # <<<<<<<<<<<<<<
 * 
 *     def _train_epoch(self, list sentences, list tags):
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":662
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \             # <<<<<<<<<<<<<<
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
 */
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_2, 9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch, "Network._train_epoch(self, list sentences, list tags)\n\n        Trains for one epoch with all examples.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_31_train_epoch = {"_train_epoch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_train_epoch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_tags,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 2, 2, 1); __PYX_ERR(0, 670, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_train_epoch") < 0)) __PYX_ERR(0, 670, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_tags = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 670, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(0, 670, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(0, 670, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentences, __pyx_v_tags);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags) {
  PyObject *__pyx_v_random_state = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__24)
  __Pyx_RefNannySetupContext("_train_epoch", 1);
  __Pyx_TraceCall("_train_epoch", __pyx_f[0], 670, 0, __PYX_ERR(0, 670, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":674
 *         Trains for one epoch with all examples.
 *         """
 *         self.error = 0             # <<<<<<<<<<<<<<
 *         self.skips = 0
 *         self.float_errors = 0
 */
  __pyx_v_self->error = 0.0;

  /* "nltkor/tag/libs/network.pyx":675
 *         """
 *         self.error = 0
 *         self.skips = 0             # <<<<<<<<<<<<<<
 *         self.float_errors = 0
 * 
 */
  __pyx_v_self->skips = 0;

  /* "nltkor/tag/libs/network.pyx":676
 *         self.error = 0
 *         self.skips = 0
 *         self.float_errors = 0             # <<<<<<<<<<<<<<
 * 
 *         # shuffle data
 */
  __pyx_v_self->float_errors = 0.0;

  /* "nltkor/tag/libs/network.pyx":681
 *         # get the random number generator state in order to shuffle
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()             # <<<<<<<<<<<<<<
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_random_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":682
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_sentences};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":683
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(tags)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":684
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":686
 *         np.random.shuffle(tags)
 * 
 *         for sent, sent_tags in zip(sentences, tags):             # <<<<<<<<<<<<<<
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_sentences);
  __Pyx_GIVEREF(__pyx_v_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sentences)) __PYX_ERR(0, 686, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tags);
  __Pyx_GIVEREF(__pyx_v_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tags)) __PYX_ERR(0, 686, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 686, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 686, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "nltkor/tag/libs/network.pyx":688
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:
 *                 self._tag_sentence(sent, sent_tags)             # <<<<<<<<<<<<<<
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sent, __pyx_v_sent_tags};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
 */
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "nltkor/tag/libs/network.pyx":689
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:             # <<<<<<<<<<<<<<
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1
 */
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_FloatingPointError);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(0, 689, __pyx_L9_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_3);

        /* "nltkor/tag/libs/network.pyx":691
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
 */
        __pyx_v_self->float_errors = (__pyx_v_self->float_errors + 1.0);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;

      /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
 */
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L14_try_end:;
    }

    /* "nltkor/tag/libs/network.pyx":686
 *         np.random.shuffle(tags)
 * 
 *         for sent, sent_tags in zip(sentences, tags):             # <<<<<<<<<<<<<<
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_random_state);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate, "Network._validate(self)\nPerform validation on validation data and estimate accuracy");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_33_validate = {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_validate", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 702, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_validate_locals_genexpr, __pyx_n_s_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._validate.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __Pyx_TraceCall("genexpr", __pyx_f[0], 702, 0, __PYX_ERR(0, 702, __pyx_L1_error));
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceReturn(Py_None, 0);
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 702, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 702, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 702, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 702, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 702, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 702, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_TraceReturn(__pyx_r, 0);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 702, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_gold_tags = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  unsigned int __pyx_t_9;
  float __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__25)
  __Pyx_RefNannySetupContext("_validate", 1);
  __Pyx_TraceCall("_validate", __pyx_f[0], 693, 0, __PYX_ERR(0, 693, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":695
 *     def _validate(self):
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0             # <<<<<<<<<<<<<<
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_hits = __pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":697
 *         hits = 0
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):             # <<<<<<<<<<<<<<
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->validation_sentences)) __PYX_ERR(0, 697, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->validation_tags)) __PYX_ERR(0, 697, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 697, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 697, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 697, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/network.pyx":698
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
 *             answer = self.tag_sentence(sent)             # <<<<<<<<<<<<<<
 *             hits += np.count_nonzero(answer == gold_tags)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_sent};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":699
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)             # <<<<<<<<<<<<<<
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_count_nonzero); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_answer, __pyx_v_gold_tags, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_hits, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":697
 *         hits = 0
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):             # <<<<<<<<<<<<<<
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
 */
  __pyx_t_1 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(NULL, __pyx_v_self->validation_sentences); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_tokens = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/network.pyx":703
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)
 *         self.accuracy = float(hits) / num_tokens             # <<<<<<<<<<<<<<
 * 
 *     def _backpropagate(self, sentence):
 */
  __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_v_num_tokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->accuracy = __pyx_t_10;

  /* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_gold_tags);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate, "Network._backpropagate(self, sentence)\n\n        Backpropagate the gradients of the cost.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_35_backpropagate = {"_backpropagate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_backpropagate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_backpropagate") < 0)) __PYX_ERR(0, 705, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_sentence = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_backpropagate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentence) {
  PyArrayObject *__pyx_v_output_deltas = 0;
  PyObject *__pyx_v_output_bias_deltas = NULL;
  PyObject *__pyx_v_dCdf_3 = NULL;
  PyObject *__pyx_v_dCdf_2 = NULL;
  PyArrayObject *__pyx_v_hidden_deltas = 0;
  PyObject *__pyx_v_hidden_bias_deltas = NULL;
  PyArrayObject *__pyx_v_input_gradients = 0;
  PyArrayObject *__pyx_v_input_deltas = 0;
  PyObject *__pyx_v_padded_sentence = NULL;
  PyArrayObject *__pyx_v_features = 0;
  PyArrayObject *__pyx_v_table = 0;
  int __pyx_v_start;
  int __pyx_v_end;
  int __pyx_v_t;
  int __pyx_v_i;
  PyObject *__pyx_v_w_deltas = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_features;
  __Pyx_Buffer __pyx_pybuffer_features;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_hidden_deltas;
  __Pyx_Buffer __pyx_pybuffer_hidden_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_deltas;
  __Pyx_Buffer __pyx_pybuffer_input_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_gradients;
  __Pyx_Buffer __pyx_pybuffer_input_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output_deltas;
  __Pyx_Buffer __pyx_pybuffer_output_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_table;
  __Pyx_Buffer __pyx_pybuffer_table;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyArrayObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  PyArrayObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  npy_intp *__pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_6nltkor_3tag_4libs_7network_INT_t __pyx_t_25;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__26)
  __Pyx_RefNannySetupContext("_backpropagate", 1);
  __Pyx_TraceCall("_backpropagate", __pyx_f[0], 705, 0, __PYX_ERR(0, 705, __pyx_L1_error));
  __pyx_pybuffer_output_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_output_deltas.refcount = 0;
  __pyx_pybuffernd_output_deltas.data = NULL;
  __pyx_pybuffernd_output_deltas.rcbuffer = &__pyx_pybuffer_output_deltas;
  __pyx_pybuffer_hidden_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_hidden_deltas.refcount = 0;
  __pyx_pybuffernd_hidden_deltas.data = NULL;
  __pyx_pybuffernd_hidden_deltas.rcbuffer = &__pyx_pybuffer_hidden_deltas;
  __pyx_pybuffer_input_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_input_gradients.refcount = 0;
  __pyx_pybuffernd_input_gradients.data = NULL;
  __pyx_pybuffernd_input_gradients.rcbuffer = &__pyx_pybuffer_input_gradients;
  __pyx_pybuffer_input_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_input_deltas.refcount = 0;
  __pyx_pybuffernd_input_deltas.data = NULL;
  __pyx_pybuffernd_input_deltas.rcbuffer = &__pyx_pybuffer_input_deltas;
  __pyx_pybuffer_features.pybuffer.buf = NULL;
  __pyx_pybuffer_features.refcount = 0;
  __pyx_pybuffernd_features.data = NULL;
  __pyx_pybuffernd_features.rcbuffer = &__pyx_pybuffer_features;
  __pyx_pybuffer_table.pybuffer.buf = NULL;
  __pyx_pybuffer_table.refcount = 0;
  __pyx_pybuffernd_table.data = NULL;
  __pyx_pybuffernd_table.rcbuffer = &__pyx_pybuffer_table;

  /* "nltkor/tag/libs/network.pyx":725
 *         # (len, output_size).T (len, hidden_size) = (output_size, hidden_size)
 *         cdef np.ndarray[FLOAT_t, ndim=2] output_deltas
 *         output_deltas = self.net_gradients.T.dot(self.hidden_sent_values)             # <<<<<<<<<<<<<<
 * 
 *         # dC / db_4 = dC / df_4					(22)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->net_gradients), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->hidden_sent_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 725, __pyx_L1_error)
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_output_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
      __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
    }
    __pyx_pybuffernd_output_deltas.diminfo[0].strides = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output_deltas.diminfo[0].shape = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output_deltas.diminfo[1].strides = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output_deltas.diminfo[1].shape = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 725, __pyx_L1_error)
  }
  __pyx_t_5 = 0;
  __pyx_v_output_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":730
 *         # (output_size) += ((len(sentence), output_size))
 *         # sum by column, i.e. all changes through the sentence
 *         output_bias_deltas = self.net_gradients.sum(0)             # <<<<<<<<<<<<<<
 * 
 *         # dC / df_3 = M_2.T dC / df_4				(23)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->net_gradients), __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_output_bias_deltas = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":734
 *         # dC / df_3 = M_2.T dC / df_4				(23)
 *         #  (len, output_size) (output_size, hidden_size) = (len, hidden_size)
 *         dCdf_3 = self.net_gradients.dot(self.output_weights)             # <<<<<<<<<<<<<<
 * 
 *         # layer 3: HardTanh layer
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->net_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->output_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_dCdf_3 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":742
 *         # (len, hidden_size) (len, hidden_size)
 *         # FIXME: this goes quickly to 0.
 *         dCdf_2 = hardtanhd(self.layer2_sent_values) * dCdf_3             # <<<<<<<<<<<<<<
 * 
 *         # df_2 / df_1 = M_1
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->layer2_sent_values);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_dCdf_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dCdf_2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":750
 *         cdef np.ndarray[FLOAT_t, ndim=2] hidden_deltas
 *         # (len, hidden_size).T (len, input_size) = (hidden_size, input_size)
 *         hidden_deltas = dCdf_2.T.dot(self.input_sent_values)             # <<<<<<<<<<<<<<
 * 
 *         # dC / db_2 = dC / df_2					(22)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dCdf_2, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->input_sent_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 750, __pyx_L1_error)
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_hidden_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
      __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
    }
    __pyx_pybuffernd_hidden_deltas.diminfo[0].strides = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hidden_deltas.diminfo[0].shape = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_hidden_deltas.diminfo[1].strides = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_hidden_deltas.diminfo[1].shape = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 750, __pyx_L1_error)
  }
  __pyx_t_10 = 0;
  __pyx_v_hidden_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":754
 *         # dC / db_2 = dC / df_2					(22)
 *         # sum by column contribution by each token
 *         hidden_bias_deltas = dCdf_2.sum(0)             # <<<<<<<<<<<<<<
 * 
 *         # dC / df_1 = M_1.T dC / df_2
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dCdf_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_hidden_bias_deltas = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":759
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_gradients
 *         # (len, hidden_size) (hidden_size, input_size) = (len, input_size)
 *         input_gradients = dCdf_2.dot(self.hidden_weights)             # <<<<<<<<<<<<<<
 * 
 *         """
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dCdf_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->hidden_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
      __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
    }
    __pyx_pybuffernd_input_gradients.diminfo[0].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_gradients.diminfo[0].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_gradients.diminfo[1].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_gradients.diminfo[1].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 759, __pyx_L1_error)
  }
  __pyx_t_11 = 0;
  __pyx_v_input_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":764
 *         Adjust the weights.
 *         """
 *         self.output_weights += output_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_output_deltas), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->output_weights), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":765
 *         """
 *         self.output_weights += output_deltas * self.learning_rate
 *         self.output_bias += output_bias_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.hidden_weights += hidden_deltas * self.learning_rate
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_output_bias_deltas, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->output_bias), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":766
 *         self.output_weights += output_deltas * self.learning_rate
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_hidden_deltas), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden_weights), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":767
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         """
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_hidden_bias_deltas, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden_bias), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":778
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_deltas
 *         # (len, input_size)
 *         input_deltas = input_gradients * self.learning_rate_features             # <<<<<<<<<<<<<<
 * 
 *         padded_sentence = np.concatenate((self.pre_padding,
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_input_gradients), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 778, __pyx_L1_error)
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
      __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
    }
    __pyx_pybuffernd_input_deltas.diminfo[0].strides = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_deltas.diminfo[0].shape = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_deltas.diminfo[1].strides = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_deltas.diminfo[1].shape = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 778, __pyx_L1_error)
  }
  __pyx_t_12 = 0;
  __pyx_v_input_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":780
 *         input_deltas = input_gradients * self.learning_rate_features
 * 
 *         padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                           sentence,
 *                                           self.pos_padding))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":782
 *         padded_sentence = np.concatenate((self.pre_padding,
 *                                           sentence,
 *                                           self.pos_padding))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[INT_t, ndim=1] features
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->pre_padding))) __PYX_ERR(0, 780, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_sentence);
  __Pyx_GIVEREF(__pyx_v_sentence);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sentence)) __PYX_ERR(0, 780, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->pos_padding))) __PYX_ERR(0, 780, __pyx_L1_error);
  __pyx_t_13 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_padded_sentence = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":789
 *         cdef int i, j
 * 
 *         for i, w_deltas in enumerate(input_deltas):             # <<<<<<<<<<<<<<
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
 */
  __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_input_deltas))) || PyTuple_CheckExact(((PyObject *)__pyx_v_input_deltas))) {
    __pyx_t_2 = ((PyObject *)__pyx_v_input_deltas); __Pyx_INCREF(__pyx_t_2);
    __pyx_t_14 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_14 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_input_deltas)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 789, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_15(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 789, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_w_deltas, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_v_i = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "nltkor/tag/libs/network.pyx":792
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
 *             start = 0             # <<<<<<<<<<<<<<
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
 */
    __pyx_v_start = 0;

    /* "nltkor/tag/libs/network.pyx":793
 *             # this tracks where the deltas for the next table begins
 *             start = 0
 *             for features in padded_sentence[i:i+self.word_window_size]:             # <<<<<<<<<<<<<<
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
 */
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_padded_sentence, __pyx_v_i, (__pyx_v_i + __pyx_v_self->word_window_size), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
    } else {
      __pyx_t_16 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 793, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_17)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_17(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 793, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 793, __pyx_L1_error)
      __pyx_t_18 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
        __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_features.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_19 < 0)) {
          PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_features.rcbuffer->pybuffer, (PyObject*)__pyx_v_features, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          }
          __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
        }
        __pyx_pybuffernd_features.diminfo[0].strides = __pyx_pybuffernd_features.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_features.diminfo[0].shape = __pyx_pybuffernd_features.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
      }
      __pyx_t_18 = 0;
      __Pyx_XDECREF_SET(__pyx_v_features, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":795
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
 */
      __pyx_t_19 = 0;
      __pyx_t_3 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_20 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
          #endif
          if (__pyx_t_20 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_13 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_20); __Pyx_INCREF(__pyx_t_13); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
        #else
        __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 795, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 795, __pyx_L1_error)
        __pyx_t_21 = ((PyArrayObject *)__pyx_t_13);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
          __pyx_t_22 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_table.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_22 < 0)) {
            PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_table.rcbuffer->pybuffer, (PyObject*)__pyx_v_table, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
            }
            __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
          }
          __pyx_pybuffernd_table.diminfo[0].strides = __pyx_pybuffernd_table.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_table.diminfo[0].shape = __pyx_pybuffernd_table.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_table.diminfo[1].strides = __pyx_pybuffernd_table.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_table.diminfo[1].shape = __pyx_pybuffernd_table.rcbuffer->pybuffer.shape[1];
          if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
        }
        __pyx_t_21 = 0;
        __Pyx_XDECREF_SET(__pyx_v_table, ((PyArrayObject *)__pyx_t_13));
        __pyx_t_13 = 0;
        __pyx_v_t = __pyx_t_19;
        __pyx_t_19 = (__pyx_t_19 + 1);

        /* "nltkor/tag/libs/network.pyx":796
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
 *                     end = start + table.shape[1]             # <<<<<<<<<<<<<<
 *                     table[features[t]] += w_deltas[start:end]
 *                     start = end
 */
        __pyx_t_23 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_table)); if (unlikely(__pyx_t_23 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L1_error)
        __pyx_v_end = (__pyx_v_start + (__pyx_t_23[1]));

        /* "nltkor/tag/libs/network.pyx":797
 *                 for t, table in enumerate(self.feature_tables):
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]             # <<<<<<<<<<<<<<
 *                     start = end
 * 
 */
        __pyx_t_24 = __pyx_v_t;
        __pyx_t_22 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_24 += __pyx_pybuffernd_features.diminfo[0].shape;
          if (unlikely(__pyx_t_24 < 0)) __pyx_t_22 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_features.diminfo[0].shape)) __pyx_t_22 = 0;
        if (unlikely(__pyx_t_22 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_22);
          __PYX_ERR(0, 797, __pyx_L1_error)
        }
        __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_6nltkor_3tag_4libs_7network_INT_t *, __pyx_pybuffernd_features.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_features.diminfo[0].strides));
        __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_table), __pyx_t_25, __pyx_t_6nltkor_3tag_4libs_7network_INT_t, 1, __Pyx_PyInt_From_npy_long, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_26 = __Pyx_PyObject_GetSlice(__pyx_v_w_deltas, __pyx_v_start, __pyx_v_end, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_26);
        __pyx_t_27 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_t_26); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_table), __pyx_t_25, __pyx_t_27, __pyx_t_6nltkor_3tag_4libs_7network_INT_t, 1, __Pyx_PyInt_From_npy_long, 0, 1, 1) < 0))) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;

        /* "nltkor/tag/libs/network.pyx":798
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
 *                     start = end             # <<<<<<<<<<<<<<
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 */
        __pyx_v_start = __pyx_v_end;

        /* "nltkor/tag/libs/network.pyx":795
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":793
 *             # this tracks where the deltas for the next table begins
 *             start = 0
 *             for features in padded_sentence[i:i+self.word_window_size]:             # <<<<<<<<<<<<<<
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":789
 *         cdef int i, j
 * 
 *         for i, w_deltas in enumerate(input_deltas):             # <<<<<<<<<<<<<<
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":801
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 */
  __pyx_t_28 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
  if (__pyx_t_28) {

    /* "nltkor/tag/libs/network.pyx":802
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:
 *             self.transitions += self.trans_gradients * self.learning_rate_trans             # <<<<<<<<<<<<<<
 * 
 *     def _load_parameters(self):
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_self->trans_gradients), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->transitions), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":801
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 */
  }

  /* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_XDECREF(__pyx_t_27);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output_deltas);
  __Pyx_XDECREF(__pyx_v_output_bias_deltas);
  __Pyx_XDECREF(__pyx_v_dCdf_3);
  __Pyx_XDECREF(__pyx_v_dCdf_2);
  __Pyx_XDECREF((PyObject *)__pyx_v_hidden_deltas);
  __Pyx_XDECREF(__pyx_v_hidden_bias_deltas);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_deltas);
  __Pyx_XDECREF(__pyx_v_padded_sentence);
  __Pyx_XDECREF((PyObject *)__pyx_v_features);
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_w_deltas);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters, "Network._load_parameters(self)\n\n        Loads weights, feature tables and transition tables previously saved.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_37_load_parameters = {"_load_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_load_parameters", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_load_parameters", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__27)
  __Pyx_RefNannySetupContext("_load_parameters", 1);
  __Pyx_TraceCall("_load_parameters", __pyx_f[0], 804, 0, __PYX_ERR(0, 804, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":808
 *         Loads weights, feature tables and transition tables previously saved.
 *         """
 *         data = np.load(self.network_filename)             # <<<<<<<<<<<<<<
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":809
 *         """
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":810
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 810, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":811
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":812
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 *         self.feature_tables = list(data['feature_tables'])
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":813
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":816
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/network.pyx":817
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():
 *             self.transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             self.transitions = None
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":816
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":819
 *             self.transitions = data['transitions']
 *         else:
 *             self.transitions = None             # <<<<<<<<<<<<<<
 * 
 *     def save(self):
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)Py_None);
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._load_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save, "Network.save(self)\n\n        Saves the neural network to a file.\n        It will save the weights, biases, sizes, padding, \n        and feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_39save = {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "save", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__28)
  __Pyx_RefNannySetupContext("save", 1);
  __Pyx_TraceCall("save", __pyx_f[0], 821, 0, __PYX_ERR(0, 821, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":827
 *         and feature tables.
 *         """
 *         np.savez(self.network_filename, hidden_weights=self.hidden_weights,             # <<<<<<<<<<<<<<
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_savez); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->network_filename);
  __Pyx_GIVEREF(__pyx_v_self->network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->network_filename)) __PYX_ERR(0, 827, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hidden_weights, ((PyObject *)__pyx_v_self->hidden_weights)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":828
 *         """
 *         np.savez(self.network_filename, hidden_weights=self.hidden_weights,
 *                  output_weights=self.output_weights,             # <<<<<<<<<<<<<<
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_output_weights, ((PyObject *)__pyx_v_self->output_weights)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":829
 *         np.savez(self.network_filename, hidden_weights=self.hidden_weights,
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,             # <<<<<<<<<<<<<<
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hidden_bias, ((PyObject *)__pyx_v_self->hidden_bias)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_output_bias, ((PyObject *)__pyx_v_self->output_bias)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":830
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,             # <<<<<<<<<<<<<<
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, padding_left=self.padding_left,
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_word_window_size, __pyx_t_4) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":831
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,             # <<<<<<<<<<<<<<
 *                  output_size=self.output_size, padding_left=self.padding_left,
 *                  padding_right=self.padding_right, transitions=self.transitions,
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input_size, __pyx_t_4) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hidden_size, __pyx_t_4) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":832
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, padding_left=self.padding_left,             # <<<<<<<<<<<<<<
 *                  padding_right=self.padding_right, transitions=self.transitions,
 *                  feature_tables=self.feature_tables)
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_output_size, __pyx_t_4) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_padding_left, ((PyObject *)__pyx_v_self->padding_left)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":833
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, padding_left=self.padding_left,
 *                  padding_right=self.padding_right, transitions=self.transitions,             # <<<<<<<<<<<<<<
 *                  feature_tables=self.feature_tables)
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_padding_right, ((PyObject *)__pyx_v_self->padding_right)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_transitions, ((PyObject *)__pyx_v_self->transitions)) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":834
 *                  output_size=self.output_size, padding_left=self.padding_left,
 *                  padding_right=self.padding_right, transitions=self.transitions,
 *                  feature_tables=self.feature_tables)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_feature_tables, __pyx_v_self->feature_tables) < 0) __PYX_ERR(0, 827, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":827
 *         and feature tables.
 *         """
 *         np.savez(self.network_filename, hidden_weights=self.hidden_weights,             # <<<<<<<<<<<<<<
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file, "Network.load_from_file(cls, filename)\n\n        Loads the neural network from a file.\n        It will load weights, biases, sizes, padding, \n        and feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_41load_from_file = {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_from_file") < 0)) __PYX_ERR(0, 837, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 837, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_word_window_size = NULL;
  PyObject *__pyx_v_input_size = NULL;
  PyObject *__pyx_v_hidden_size = NULL;
  PyObject *__pyx_v_output_size = NULL;
  PyObject *__pyx_v_transitions = NULL;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__29)
  __Pyx_RefNannySetupContext("load_from_file", 1);
  __Pyx_TraceCall("load_from_file", __pyx_f[0], 837, 0, __PYX_ERR(0, 837, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":844
 *         and feature tables.
 *         """
 *         data = np.load(filename)             # <<<<<<<<<<<<<<
 *         #print filename
 *         # cython classes don't have the __dict__ attribute
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":848
 *         # cython classes don't have the __dict__ attribute
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":849
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":850
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         output_bias = data['output_bias']
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":851
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 * 
 *         word_window_size = data['word_window_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":853
 *         output_bias = data['output_bias']
 * 
 *         word_window_size = data['word_window_size']             # <<<<<<<<<<<<<<
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_window_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":854
 * 
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']             # <<<<<<<<<<<<<<
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_input_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":855
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']             # <<<<<<<<<<<<<<
 *         output_size = data['output_size']
 *         if 'transitions' in data:
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":856
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']             # <<<<<<<<<<<<<<
 *         if 'transitions' in data:
 *             transitions = data['transitions']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":857
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
 *         if 'transitions' in data:             # <<<<<<<<<<<<<<
 *             transitions = data['transitions']
 *         else:
 */
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_transitions, __pyx_v_data, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 857, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/network.pyx":858
 *         output_size = data['output_size']
 *         if 'transitions' in data:
 *             transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             transitions = None
 */
    __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_transitions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_transitions = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":857
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
 *         if 'transitions' in data:             # <<<<<<<<<<<<<<
 *             transitions = data['transitions']
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":860
 *             transitions = data['transitions']
 *         else:
 *             transitions = None             # <<<<<<<<<<<<<<
 * 
 *         nn = Network(word_window_size, input_size, hidden_size, output_size,
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_transitions = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":862
 *             transitions = None
 * 
 *         nn = Network(word_window_size, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                      hidden_weights, hidden_bias, output_weights, output_bias,
 *                      transitions)
 */
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_word_window_size);
  __Pyx_GIVEREF(__pyx_v_word_window_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_word_window_size)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_input_size);
  __Pyx_GIVEREF(__pyx_v_input_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_input_size)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_size);
  __Pyx_GIVEREF(__pyx_v_hidden_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_hidden_size)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_size);
  __Pyx_GIVEREF(__pyx_v_output_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_output_size)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_weights);
  __Pyx_GIVEREF(__pyx_v_hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_hidden_weights)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_bias);
  __Pyx_GIVEREF(__pyx_v_hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_hidden_bias)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_weights);
  __Pyx_GIVEREF(__pyx_v_output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_output_weights)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_bias);
  __Pyx_GIVEREF(__pyx_v_output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_output_bias)) __PYX_ERR(0, 862, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_transitions);
  __Pyx_GIVEREF(__pyx_v_transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_v_transitions)) __PYX_ERR(0, 862, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nn = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":866
 *                      transitions)
 * 
 *         nn.padding_left = data['padding_left']             # <<<<<<<<<<<<<<
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_padding_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->padding_left);
  __pyx_v_nn->padding_left = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":867
 * 
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']             # <<<<<<<<<<<<<<
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_padding_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->padding_right);
  __pyx_v_nn->padding_right = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":868
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])             # <<<<<<<<<<<<<<
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_div_long(__pyx_v_nn->word_window_size, 2);
  __pyx_t_1 = PyList_New(1 * ((__pyx_t_6<0) ? 0:__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_6; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_nn->padding_left);
      __Pyx_GIVEREF((PyObject *)__pyx_v_nn->padding_left);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, ((PyObject *)__pyx_v_nn->padding_left))) __PYX_ERR(0, 868, __pyx_L1_error);
    }
  }
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->pre_padding);
  __pyx_v_nn->pre_padding = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":869
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])             # <<<<<<<<<<<<<<
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_div_long(__pyx_v_nn->word_window_size, 2);
  __pyx_t_2 = PyList_New(1 * ((__pyx_t_6<0) ? 0:__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_6; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_nn->padding_right);
      __Pyx_GIVEREF((PyObject *)__pyx_v_nn->padding_right);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, ((PyObject *)__pyx_v_nn->padding_right))) __PYX_ERR(0, 869, __pyx_L1_error);
    }
  }
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->pos_padding);
  __pyx_v_nn->pos_padding = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":870
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         nn.network_filename = filename
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_feature_tables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_nn->feature_tables);
  __Pyx_DECREF(__pyx_v_nn->feature_tables);
  __pyx_v_nn->feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":871
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename             # <<<<<<<<<<<<<<
 * 
 *         return nn
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_filename))) __PYX_ERR(0, 871, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_filename;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_nn->network_filename);
  __Pyx_DECREF(__pyx_v_nn->network_filename);
  __pyx_v_nn->network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":873
 *         nn.network_filename = filename
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 * # include the files for other networks
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_nn);
  __pyx_r = ((PyObject *)__pyx_v_nn);
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_word_window_size);
  __Pyx_XDECREF(__pyx_v_input_size);
  __Pyx_XDECREF(__pyx_v_hidden_size);
  __Pyx_XDECREF(__pyx_v_output_size);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF((PyObject *)__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":82
 * 
 *     # sizes and learning rates
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size             # <<<<<<<<<<<<<<
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 82, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.word_window_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 82, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 82, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 82, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":83
 *     # sizes and learning rates
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size
 *     cdef public float learning_rate, learning_rate_features             # <<<<<<<<<<<<<<
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 83, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__set__", __pyx_f[0], 83, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_v_self->learning_rate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 83, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_features.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__set__", __pyx_f[0], 83, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_v_self->learning_rate_features = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_features.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":84
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor             # <<<<<<<<<<<<<<
 *     cdef public bool use_learning_rate_decay
 *     cdef readonly int features_per_token
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decay_factor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__set__", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
  __pyx_v_self->decay_factor = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decay_factor.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":85
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay             # <<<<<<<<<<<<<<
 *     cdef readonly int features_per_token
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 85, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_r = ((PyObject *)__pyx_v_self->use_learning_rate_decay);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 85, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(0, 85, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 85, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyBoolObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":86
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay
 *     cdef readonly int features_per_token             # <<<<<<<<<<<<<<
 * 
 *     # lookup for fast access to all the token embeddings in a sentence
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 86, 0, __PYX_ERR(0, 86, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.features_per_token.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":93
 *     # padding stuff
 *     cdef np.ndarray padding_left, padding_right
 *     cdef public np.ndarray pre_padding, pos_padding             # <<<<<<<<<<<<<<
 * 
 *     # weights, biases, calculated values
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_r = ((PyObject *)__pyx_v_self->pre_padding);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_r = ((PyObject *)__pyx_v_self->pos_padding);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":96
 * 
 *     # weights, biases, calculated values
 *     cdef readonly np.ndarray hidden_weights, output_weights             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden_bias, output_bias
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 96, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 96, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->output_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":97
 *     # weights, biases, calculated values
 *     cdef readonly np.ndarray hidden_weights, output_weights
 *     cdef readonly np.ndarray hidden_bias, output_bias             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_bias);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->output_bias);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":98
 *     cdef readonly np.ndarray hidden_weights, output_weights
 *     cdef readonly np.ndarray hidden_bias, output_bias
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values             # <<<<<<<<<<<<<<
 * 
 *     # feature tables
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_values);
  __pyx_r = ((PyObject *)__pyx_v_self->input_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_values);
  __pyx_r = ((PyObject *)__pyx_v_self->layer2_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.layer2_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":101
 * 
 *     # feature tables
 *     cdef public list feature_tables             # <<<<<<<<<<<<<<
 * 
 *     # transitions
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 101, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->feature_tables);
  __pyx_r = __pyx_v_self->feature_tables;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 101, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_value))) __PYX_ERR(0, 101, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 101, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":104
 * 
 *     # transitions
 *     cdef public float learning_rate_trans             # <<<<<<<<<<<<<<
 *     cdef public np.ndarray transitions
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 104, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_trans.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__set__", __pyx_f[0], 104, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
  __pyx_v_self->learning_rate_trans = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_trans.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":105
 *     # transitions
 *     cdef public float learning_rate_trans
 *     cdef public np.ndarray transitions             # <<<<<<<<<<<<<<
 * 
 *     # the score for a given path
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 105, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->transitions);
  __pyx_r = ((PyObject *)__pyx_v_self->transitions);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 105, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 105, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 105, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":108
 * 
 *     # the score for a given path
 *     cdef readonly float answer_score             # <<<<<<<<<<<<<<
 * 
 *     # gradients
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 108, 0, __PYX_ERR(0, 108, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->answer_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.answer_score.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":111
 * 
 *     # gradients
 *     cdef readonly np.ndarray net_gradients, trans_gradients             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray input_sent_values, hidden_sent_values, layer2_sent_values
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 111, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_r = ((PyObject *)__pyx_v_self->net_gradients);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.net_gradients.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 111, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
  __pyx_r = ((PyObject *)__pyx_v_self->trans_gradients);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.trans_gradients.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":112
 *     # gradients
 *     cdef readonly np.ndarray net_gradients, trans_gradients
 *     cdef readonly np.ndarray input_sent_values, hidden_sent_values, layer2_sent_values             # <<<<<<<<<<<<<<
 * 
 *     # data for statistics during training.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 112, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->input_sent_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 112, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_sent_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 112, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->layer2_sent_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.layer2_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":119
 * 
 *     # file where the network is saved
 *     cdef public str network_filename             # <<<<<<<<<<<<<<
 *     cdef public str network_text_filename
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->network_filename);
  __pyx_r = __pyx_v_self->network_filename;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(0, 119, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->network_filename);
  __Pyx_DECREF(__pyx_v_self->network_filename);
  __pyx_v_self->network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->network_filename);
  __Pyx_DECREF(__pyx_v_self->network_filename);
  __pyx_v_self->network_filename = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":120
 *     # file where the network is saved
 *     cdef public str network_filename
 *     cdef public str network_text_filename             # <<<<<<<<<<<<<<
 * 
 *     # validation
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[0], 120, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->network_text_filename);
  __pyx_r = __pyx_v_self->network_text_filename;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[0], 120, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(0, 120, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->network_text_filename);
  __Pyx_DECREF(__pyx_v_self->network_text_filename);
  __pyx_v_self->network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[0], 120, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->network_text_filename);
  __Pyx_DECREF(__pyx_v_self->network_text_filename);
  __pyx_v_self->network_text_filename = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__, "Network.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__30)
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);
  __Pyx_TraceCall("__reduce_cython__", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->num_tokens); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->sentence_accuracy); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_self->skips); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = PyTuple_New(40); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_self->feature_tables)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 7, ((PyObject *)__pyx_v_self->hidden_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 8, ((PyObject *)__pyx_v_self->hidden_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 9, __pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 10, ((PyObject *)__pyx_v_self->hidden_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 11, ((PyObject *)__pyx_v_self->hidden_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 12, ((PyObject *)__pyx_v_self->input_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 13, __pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 14, ((PyObject *)__pyx_v_self->input_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 15, ((PyObject *)__pyx_v_self->layer2_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 16, ((PyObject *)__pyx_v_self->layer2_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 17, __pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 18, __pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 19, __pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 20, ((PyObject *)__pyx_v_self->net_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->network_filename);
  __Pyx_GIVEREF(__pyx_v_self->network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 21, __pyx_v_self->network_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 22, __pyx_v_self->network_text_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 23, __pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 24, ((PyObject *)__pyx_v_self->output_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 25, __pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 26, ((PyObject *)__pyx_v_self->output_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 27, ((PyObject *)__pyx_v_self->padding_left))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 28, ((PyObject *)__pyx_v_self->padding_right))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 29, ((PyObject *)__pyx_v_self->pos_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 30, ((PyObject *)__pyx_v_self->pre_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 31, __pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 32, ((PyObject *)__pyx_v_self->sentence_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 33, __pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 34, ((PyObject *)__pyx_v_self->trans_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 35, ((PyObject *)__pyx_v_self->transitions))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 36, ((PyObject *)__pyx_v_self->use_learning_rate_decay))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 37, __pyx_v_self->validation_sentences)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 38, __pyx_v_self->validation_tags)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 39, __pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_17);
  __pyx_t_17 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_17 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_v__dict = __pyx_t_17;
  __pyx_t_17 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_18 = (__pyx_v__dict != Py_None);
  if (__pyx_t_18) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v__dict)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_16));
    __pyx_t_16 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 */
  /*else*/ {
    __pyx_t_19 = (__pyx_v_self->feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_bias) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_weights) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->input_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->input_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->layer2_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->layer2_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->net_gradients) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->output_bias) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->output_weights) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->padding_left) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->padding_right) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->pos_padding) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->pre_padding) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->sentence_lookup) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->trans_gradients) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->use_learning_rate_decay) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->validation_tags != ((PyObject*)Py_None));
    __pyx_t_18 = __pyx_t_19;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_18;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_pyx_unpickle_Network); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_119830996);
    __Pyx_GIVEREF(__pyx_int_119830996);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_int_119830996)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, Py_None)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_17);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_17)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_state)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_16 = 0;
    __pyx_t_17 = 0;
    __pyx_r = __pyx_t_15;
    __pyx_t_15 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_pyx_unpickle_Network); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_119830996);
    __Pyx_GIVEREF(__pyx_int_119830996);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_int_119830996)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_state)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_15);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_17);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_17)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_15 = 0;
    __pyx_t_17 = 0;
    __pyx_r = __pyx_t_16;
    __pyx_t_16 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__, "Network.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(4, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__31)
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);
  __Pyx_TraceCall("__setstate_cython__", __pyx_f[4], 16, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new, "ConvolutionalNetwork.create_new(cls, feature_tables, target_dist_table, pred_dist_table, int word_window, int hidden1_size, int hidden2_size, int output_size)\nCreates a new convolutional neural network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new = {"create_new", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feature_tables = 0;
  PyObject *__pyx_v_target_dist_table = 0;
  PyObject *__pyx_v_pred_dist_table = 0;
  int __pyx_v_word_window;
  int __pyx_v_hidden1_size;
  int __pyx_v_hidden2_size;
  int __pyx_v_output_size;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_new (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feature_tables,&__pyx_n_s_target_dist_table,&__pyx_n_s_pred_dist_table,&__pyx_n_s_word_window,&__pyx_n_s_hidden1_size,&__pyx_n_s_hidden2_size,&__pyx_n_s_output_size,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feature_tables)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_target_dist_table)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 1); __PYX_ERR(1, 51, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pred_dist_table)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 2); __PYX_ERR(1, 51, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_word_window)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 3); __PYX_ERR(1, 51, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden1_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 4); __PYX_ERR(1, 51, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden2_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 5); __PYX_ERR(1, 51, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, 6); __PYX_ERR(1, 51, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_new") < 0)) __PYX_ERR(1, 51, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
      values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
      values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
    }
    __pyx_v_feature_tables = values[0];
    __pyx_v_target_dist_table = values[1];
    __pyx_v_pred_dist_table = values[2];
    __pyx_v_word_window = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_word_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_hidden1_size = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_hidden1_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_hidden2_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_hidden2_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_output_size = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_output_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, __pyx_nargs); __PYX_ERR(1, 51, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(((PyTypeObject*)__pyx_v_cls), __pyx_v_feature_tables, __pyx_v_target_dist_table, __pyx_v_pred_dist_table, __pyx_v_word_window, __pyx_v_hidden1_size, __pyx_v_hidden2_size, __pyx_v_output_size);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 56, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_create_new_locals_genexpr, __pyx_n_s_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __Pyx_TraceCall("genexpr", __pyx_f[1], 56, 0, __PYX_ERR(1, 56, __pyx_L1_error));
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceReturn(Py_None, 0);
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 56, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(1, 56, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 56, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_table);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_table, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_TraceReturn(__pyx_r, 0);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 56, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, PyObject *__pyx_v_target_dist_table, PyObject *__pyx_v_pred_dist_table, int __pyx_v_word_window, int __pyx_v_hidden1_size, int __pyx_v_hidden2_size, int __pyx_v_output_size) {
  int __pyx_v_input_size;
  PyObject *__pyx_v_dist_features_per_token = NULL;
  PyObject *__pyx_v_input_size_with_distance = NULL;
  PyObject *__pyx_v_high = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_num_dist_features = NULL;
  PyObject *__pyx_v_target_dist_weights = NULL;
  PyObject *__pyx_v_pred_dist_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_hidden2_weights = NULL;
  PyObject *__pyx_v_hidden2_bias = NULL;
  PyObject *__pyx_v_output_dim = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_net = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__32)
  __Pyx_RefNannySetupContext("create_new", 1);
  __Pyx_TraceCall("create_new", __pyx_f[1], 51, 0, __PYX_ERR(1, 51, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
 */
  __pyx_t_1 = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(NULL, __pyx_v_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_input_size = __pyx_t_3;

  /* "nltkor/tag/libs/networkconv.pyx":57
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)
 *         input_size *= word_window             # <<<<<<<<<<<<<<
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]
 */
  __pyx_v_input_size = (__pyx_v_input_size * __pyx_v_word_window);

  /* "nltkor/tag/libs/networkconv.pyx":59
 *         input_size *= word_window
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         input_size_with_distance = input_size + (word_window * dist_features_per_token)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_dist_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pred_dist_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dist_features_per_token = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":60
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]
 *         input_size_with_distance = input_size + (word_window * dist_features_per_token)             # <<<<<<<<<<<<<<
 * 
 *         # creates the weight matrices
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dist_features_per_token); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_input_size_with_distance = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":63
 * 
 *         # creates the weight matrices
 *         high = 2.38 / np.sqrt(input_size_with_distance) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_input_size_with_distance};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_4, 2.38, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_high = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":64
 *         # creates the weight matrices
 *         high = 2.38 / np.sqrt(input_size_with_distance) # [Bottou-88]
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))             # <<<<<<<<<<<<<<
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(1, 64, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(1, 64, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_1, __pyx_v_high, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_hidden_weights = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":66
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_dist_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_num_dist_features = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":67
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))             # <<<<<<<<<<<<<<
 *         num_dist_features = word_window * pred_dist_table.shape[1]
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uniform); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_num_dist_features);
  __Pyx_GIVEREF(__pyx_v_num_dist_features);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_num_dist_features)) __PYX_ERR(1, 67, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_2, __pyx_v_high, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_v_target_dist_weights = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":68
 *         num_dist_features = word_window * target_dist_table.shape[1]
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pred_dist_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_num_dist_features, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":69
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))             # <<<<<<<<<<<<<<
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uniform); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_num_dist_features);
  __Pyx_GIVEREF(__pyx_v_num_dist_features);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_num_dist_features)) __PYX_ERR(1, 69, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_4, __pyx_v_high, __pyx_t_1};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_v_pred_dist_weights = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":71
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)             # <<<<<<<<<<<<<<
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_8, 2.38, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":72
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)             # <<<<<<<<<<<<<<
 * 
 *         if hidden2_size > 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uniform); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_7, __pyx_v_high, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":74
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
 *         if hidden2_size > 0:             # <<<<<<<<<<<<<<
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
 */
  __pyx_t_9 = (__pyx_v_hidden2_size > 0);
  if (__pyx_t_9) {

    /* "nltkor/tag/libs/networkconv.pyx":75
 * 
 *         if hidden2_size > 0:
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))             # <<<<<<<<<<<<<<
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uniform); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7)) __PYX_ERR(1, 75, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_4, __pyx_v_high, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_v_hidden2_weights = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":76
 *         if hidden2_size > 0:
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)             # <<<<<<<<<<<<<<
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
 *             output_dim = (output_size, hidden2_size)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_1, 2.38, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":77
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)             # <<<<<<<<<<<<<<
 *             output_dim = (output_size, hidden2_size)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_random); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_8, __pyx_v_high, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 77, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_hidden2_bias = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":78
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
 *             output_dim = (output_size, hidden2_size)             # <<<<<<<<<<<<<<
 *         else:
 *             hidden2_weights = None
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(1, 78, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_v_output_dim = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":74
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
 *         if hidden2_size > 0:             # <<<<<<<<<<<<<<
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":80
 *             output_dim = (output_size, hidden2_size)
 *         else:
 *             hidden2_weights = None             # <<<<<<<<<<<<<<
 *             hidden2_bias = None
 *             output_dim = (output_size, hidden1_size)
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_hidden2_weights = Py_None;

    /* "nltkor/tag/libs/networkconv.pyx":81
 *         else:
 *             hidden2_weights = None
 *             hidden2_bias = None             # <<<<<<<<<<<<<<
 *             output_dim = (output_size, hidden1_size)
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_hidden2_bias = Py_None;

    /* "nltkor/tag/libs/networkconv.pyx":82
 *             hidden2_weights = None
 *             hidden2_bias = None
 *             output_dim = (output_size, hidden1_size)             # <<<<<<<<<<<<<<
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_v_output_dim = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":84
 *             output_dim = (output_size, hidden1_size)
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])             # <<<<<<<<<<<<<<
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_output_dim, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_6, 2.38, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":85
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])
 *         output_weights = np.random.uniform(-high, high, output_dim)             # <<<<<<<<<<<<<<
 *         high = 2.38 / np.sqrt(output_size)
 *         output_bias = np.random.uniform(-high, high, output_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uniform); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_1, __pyx_v_high, __pyx_v_output_dim};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v_output_weights = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":86
 *         high = 2.38 / np.sqrt(output_dim[1])
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)             # <<<<<<<<<<<<<<
 *         output_bias = np.random.uniform(-high, high, output_size)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_2_38, __pyx_t_4, 2.38, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":87
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)
 *         output_bias = np.random.uniform(-high, high, output_size)             # <<<<<<<<<<<<<<
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_6, __pyx_v_high, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":89
 *         output_bias = np.random.uniform(-high, high, output_size)
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                   output_size, hidden_weights, hidden_bias,
 *                   target_dist_weights, pred_dist_weights,
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "nltkor/tag/libs/networkconv.pyx":90
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,
 *                   output_size, hidden_weights, hidden_bias,             # <<<<<<<<<<<<<<
 *                   target_dist_weights, pred_dist_weights,
 *                   hidden2_weights, hidden2_bias,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "nltkor/tag/libs/networkconv.pyx":89
 *         output_bias = np.random.uniform(-high, high, output_size)
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                   output_size, hidden_weights, hidden_bias,
 *                   target_dist_weights, pred_dist_weights,
 */
  __pyx_t_7 = PyTuple_New(13); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_weights);
  __Pyx_GIVEREF(__pyx_v_hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_v_hidden_weights)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_bias);
  __Pyx_GIVEREF(__pyx_v_hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_v_hidden_bias)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_target_dist_weights);
  __Pyx_GIVEREF(__pyx_v_target_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_v_target_dist_weights)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_pred_dist_weights);
  __Pyx_GIVEREF(__pyx_v_pred_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_v_pred_dist_weights)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden2_weights);
  __Pyx_GIVEREF(__pyx_v_hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_v_hidden2_weights)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden2_bias);
  __Pyx_GIVEREF(__pyx_v_hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 10, __pyx_v_hidden2_bias)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_weights);
  __Pyx_GIVEREF(__pyx_v_output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 11, __pyx_v_output_weights)) __PYX_ERR(1, 89, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_bias);
  __Pyx_GIVEREF(__pyx_v_output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 12, __pyx_v_output_bias)) __PYX_ERR(1, 89, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_net = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":94
 *                   hidden2_weights, hidden2_bias,
 *                   output_weights, output_bias)
 *         net.feature_tables = feature_tables             # <<<<<<<<<<<<<<
 *         net.target_dist_table = target_dist_table
 *         net.pred_dist_table = pred_dist_table
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_n_s_feature_tables, __pyx_v_feature_tables) < 0) __PYX_ERR(1, 94, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":95
 *                   output_weights, output_bias)
 *         net.feature_tables = feature_tables
 *         net.target_dist_table = target_dist_table             # <<<<<<<<<<<<<<
 *         net.pred_dist_table = pred_dist_table
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_n_s_target_dist_table, __pyx_v_target_dist_table) < 0) __PYX_ERR(1, 95, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":96
 *         net.feature_tables = feature_tables
 *         net.target_dist_table = target_dist_table
 *         net.pred_dist_table = pred_dist_table             # <<<<<<<<<<<<<<
 * 
 *         return net
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_n_s_pred_dist_table, __pyx_v_pred_dist_table) < 0) __PYX_ERR(1, 96, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":98
 *         net.pred_dist_table = pred_dist_table
 * 
 *         return net             # <<<<<<<<<<<<<<
 * 
 *     def description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_net);
  __pyx_r = __pyx_v_net;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dist_features_per_token);
  __Pyx_XDECREF(__pyx_v_input_size_with_distance);
  __Pyx_XDECREF(__pyx_v_high);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_num_dist_features);
  __Pyx_XDECREF(__pyx_v_target_dist_weights);
  __Pyx_XDECREF(__pyx_v_pred_dist_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_hidden2_weights);
  __Pyx_XDECREF(__pyx_v_hidden2_bias);
  __Pyx_XDECREF(__pyx_v_output_dim);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_net);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description, "ConvolutionalNetwork.description(self)\nReturns a textual description of the network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description = {"description", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("description", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "description", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  long __pyx_v_hidden2_size;
  PyObject *__pyx_v_table_dims = NULL;
  PyObject *__pyx_v_dist_table_dims = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_UCS4 __pyx_t_8;
  npy_intp *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__33)
  __Pyx_RefNannySetupContext("description", 1);
  __Pyx_TraceCall("description", __pyx_f[1], 100, 0, __PYX_ERR(1, 100, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":102
 *     def description(self):
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size             # <<<<<<<<<<<<<<
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) == Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = 0;
  } else {
    __pyx_t_1 = __pyx_v_self->hidden2_size;
  }
  __pyx_v_hidden2_size = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":103
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]             # <<<<<<<<<<<<<<
 *         table_dims =  ', '.join(table_dims)
 * 
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_v_self->__pyx_base.feature_tables == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 103, __pyx_L5_error)
    }
    __pyx_t_4 = __pyx_v_self->__pyx_base.feature_tables; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 103, __pyx_L5_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(1, 103, __pyx_L5_error)
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_t, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_t, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t); __pyx_8genexpr5__pyx_v_t = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t); __pyx_8genexpr5__pyx_v_t = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_table_dims = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":104
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)             # <<<<<<<<<<<<<<
 * 
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])
 */
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__5, __pyx_v_table_dims); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_table_dims, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":106
 *         table_dims =  ', '.join(table_dims)
 * 
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])             # <<<<<<<<<<<<<<
 * 
 *         desc = """
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_8 = 127;
  __pyx_t_4 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_9 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_9 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_9[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_8;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__5);
  __pyx_t_6 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_9 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_6)); if (unlikely(__pyx_t_9 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_9[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_6), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_8;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dist_table_dims = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":108
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
 */
  __pyx_t_4 = PyTuple_New(15); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_8 = 127;
  __Pyx_INCREF(__pyx_kp_u_Word_window_size);
  __pyx_t_5 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_Word_window_size);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Word_window_size);

  /* "nltkor/tag/libs/networkconv.pyx":116
 * Second hidden layer size: %d
 * Output size: %d
 * """ % (self.word_window_size, table_dims, dist_table_dims, self.input_size, self.hidden_size,             # <<<<<<<<<<<<<<
 *        hidden2_size, self.output_size)
 * 
 */
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.word_window_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_Feature_table_sizes);
  __pyx_t_5 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_Feature_table_sizes);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_Feature_table_sizes);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_table_dims), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_Distance_table_sizes_target_and);
  __pyx_t_5 += 46;
  __Pyx_GIVEREF(__pyx_kp_u_Distance_table_sizes_target_and);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_Distance_table_sizes_target_and);
  __Pyx_INCREF(__pyx_v_dist_table_dims);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_dist_table_dims) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_dist_table_dims) : __pyx_t_8;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_dist_table_dims);
  __Pyx_GIVEREF(__pyx_v_dist_table_dims);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_dist_table_dims);
  __Pyx_INCREF(__pyx_kp_u_Input_layer_size);
  __pyx_t_5 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_Input_layer_size);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u_Input_layer_size);
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.input_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_Convolution_layer_size);
  __pyx_t_5 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_Convolution_layer_size);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_kp_u_Convolution_layer_size);
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.hidden_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_Second_hidden_layer_size);
  __pyx_t_5 += 28;
  __Pyx_GIVEREF(__pyx_kp_u_Second_hidden_layer_size);
  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_kp_u_Second_hidden_layer_size);

  /* "nltkor/tag/libs/networkconv.pyx":117
 * Output size: %d
 * """ % (self.word_window_size, table_dims, dist_table_dims, self.input_size, self.hidden_size,
 *        hidden2_size, self.output_size)             # <<<<<<<<<<<<<<
 * 
 *         return desc
 */
  __pyx_t_3 = __Pyx_PyUnicode_From_long(__pyx_v_hidden2_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_Output_size);
  __pyx_t_5 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_Output_size);
  PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_kp_u_Output_size);
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.output_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 13, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_4, 14, __pyx_kp_u__6);

  /* "nltkor/tag/libs/networkconv.pyx":108
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
 */
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 15, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_desc = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":119
 *        hidden2_size, self.output_size)
 * 
 *         return desc             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_desc);
  __pyx_r = __pyx_v_desc;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_dims);
  __Pyx_XDECREF(__pyx_v_dist_table_dims);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":122
 * 
 * 
 *     def __init__(self, word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden1_weights, hidden1_bias, target_dist_weights,
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
 */

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word_window = 0;
  PyObject *__pyx_v_input_size = 0;
  PyObject *__pyx_v_hidden1_size = 0;
  PyObject *__pyx_v_hidden2_size = 0;
  PyObject *__pyx_v_output_size = 0;
  PyObject *__pyx_v_hidden1_weights = 0;
  PyObject *__pyx_v_hidden1_bias = 0;
  PyObject *__pyx_v_target_dist_weights = 0;
  PyObject *__pyx_v_pred_dist_weights = 0;
  PyObject *__pyx_v_hidden2_weights = 0;
  PyObject *__pyx_v_hidden2_bias = 0;
  PyObject *__pyx_v_output_weights = 0;
  PyObject *__pyx_v_output_bias = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_word_window,&__pyx_n_s_input_size,&__pyx_n_s_hidden1_size,&__pyx_n_s_hidden2_size,&__pyx_n_s_output_size,&__pyx_n_s_hidden1_weights,&__pyx_n_s_hidden1_bias,&__pyx_n_s_target_dist_weights,&__pyx_n_s_pred_dist_weights,&__pyx_n_s_hidden2_weights,&__pyx_n_s_hidden2_bias,&__pyx_n_s_output_weights,&__pyx_n_s_output_bias,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 13: values[12] = __Pyx_Arg_VARARGS(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = __Pyx_Arg_VARARGS(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_VARARGS(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_VARARGS(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_VARARGS(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_word_window)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 1); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden1_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 2); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden2_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 3); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[4]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 4); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden1_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[5]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 5); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden1_bias)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[6]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 6); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_target_dist_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[7]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 7); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pred_dist_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[8]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 8); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden2_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[9]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 9); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hidden2_bias)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[10]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 10); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_weights)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[11]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 11); __PYX_ERR(1, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_bias)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[12]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, 12); __PYX_ERR(1, 122, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
      values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
      values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
      values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
      values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
      values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
      values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
      values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
      values[8] = __Pyx_Arg_VARARGS(__pyx_args, 8);
      values[9] = __Pyx_Arg_VARARGS(__pyx_args, 9);
      values[10] = __Pyx_Arg_VARARGS(__pyx_args, 10);
      values[11] = __Pyx_Arg_VARARGS(__pyx_args, 11);
      values[12] = __Pyx_Arg_VARARGS(__pyx_args, 12);
    }
    __pyx_v_word_window = values[0];
    __pyx_v_input_size = values[1];
    __pyx_v_hidden1_size = values[2];
    __pyx_v_hidden2_size = values[3];
    __pyx_v_output_size = values[4];
    __pyx_v_hidden1_weights = values[5];
    __pyx_v_hidden1_bias = values[6];
    __pyx_v_target_dist_weights = values[7];
    __pyx_v_pred_dist_weights = values[8];
    __pyx_v_hidden2_weights = values[9];
    __pyx_v_hidden2_bias = values[10];
    __pyx_v_output_weights = values[11];
    __pyx_v_output_bias = values[12];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, __pyx_nargs); __PYX_ERR(1, 122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden1_size, __pyx_v_hidden2_size, __pyx_v_output_size, __pyx_v_hidden1_weights, __pyx_v_hidden1_bias, __pyx_v_target_dist_weights, __pyx_v_pred_dist_weights, __pyx_v_hidden2_weights, __pyx_v_hidden2_bias, __pyx_v_output_weights, __pyx_v_output_bias);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden1_size, PyObject *__pyx_v_hidden2_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden1_weights, PyObject *__pyx_v_hidden1_bias, PyObject *__pyx_v_target_dist_weights, PyObject *__pyx_v_pred_dist_weights, PyObject *__pyx_v_hidden2_weights, PyObject *__pyx_v_hidden2_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);
  __Pyx_TraceCall("__init__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":126
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
 *                  output_weights, output_bias):
 *         super(ConvolutionalNetwork, self).__init__(word_window, input_size,             # <<<<<<<<<<<<<<
 *                                                    hidden1_size, output_size,
 *                                                    hidden1_weights, hidden1_bias,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  __Pyx_GIVEREF((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork))) __PYX_ERR(1, 126, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 126, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":129
 *                                                    hidden1_size, output_size,
 *                                                    hidden1_weights, hidden1_bias,
 *                                                    output_weights, output_bias)             # <<<<<<<<<<<<<<
 *         self.half_window = word_window / 2
 *         self.features_per_token = self.input_size / word_window
 */
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_3, __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden1_size, __pyx_v_output_size, __pyx_v_hidden1_weights, __pyx_v_hidden1_bias, __pyx_v_output_weights, __pyx_v_output_bias};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 8+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":130
 *                                                    hidden1_weights, hidden1_bias,
 *                                                    output_weights, output_bias)
 *         self.half_window = word_window / 2             # <<<<<<<<<<<<<<
 *         self.features_per_token = self.input_size / word_window
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_word_window, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->half_window = __pyx_t_5;

  /* "nltkor/tag/libs/networkconv.pyx":131
 *                                                    output_weights, output_bias)
 *         self.half_window = word_window / 2
 *         self.features_per_token = self.input_size / word_window             # <<<<<<<<<<<<<<
 * 
 *         self.transitions = None
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base.features_per_token = __pyx_t_5;

  /* "nltkor/tag/libs/networkconv.pyx":133
 *         self.features_per_token = self.input_size / word_window
 * 
 *         self.transitions = None             # <<<<<<<<<<<<<<
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":134
 * 
 *         self.transitions = None
 *         self.target_dist_lookup = None             # <<<<<<<<<<<<<<
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_v_self->target_dist_lookup = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":135
 *         self.transitions = None
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None             # <<<<<<<<<<<<<<
 *         self.target_dist_weights = target_dist_weights
 *         self.pred_dist_weights = pred_dist_weights
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_v_self->pred_dist_lookup = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":136
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights             # <<<<<<<<<<<<<<
 *         self.pred_dist_weights = pred_dist_weights
 * 
 */
  if (!(likely(((__pyx_v_target_dist_weights) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_target_dist_weights, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 136, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_target_dist_weights;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_weights);
  __pyx_v_self->target_dist_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":137
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights
 *         self.pred_dist_weights = pred_dist_weights             # <<<<<<<<<<<<<<
 * 
 *         self.hidden2_size = hidden2_size
 */
  if (!(likely(((__pyx_v_pred_dist_weights) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pred_dist_weights, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 137, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_pred_dist_weights;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __pyx_v_self->pred_dist_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":139
 *         self.pred_dist_weights = pred_dist_weights
 * 
 *         self.hidden2_size = hidden2_size             # <<<<<<<<<<<<<<
 *         self.hidden2_weights = hidden2_weights
 *         self.hidden2_bias = hidden2_bias
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_hidden2_size); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
  __pyx_v_self->hidden2_size = __pyx_t_5;

  /* "nltkor/tag/libs/networkconv.pyx":140
 * 
 *         self.hidden2_size = hidden2_size
 *         self.hidden2_weights = hidden2_weights             # <<<<<<<<<<<<<<
 *         self.hidden2_bias = hidden2_bias
 * 
 */
  if (!(likely(((__pyx_v_hidden2_weights) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hidden2_weights, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 140, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_hidden2_weights;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
  __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":141
 *         self.hidden2_size = hidden2_size
 *         self.hidden2_weights = hidden2_weights
 *         self.hidden2_bias = hidden2_bias             # <<<<<<<<<<<<<<
 * 
 *         self.validation_predicates = None
 */
  if (!(likely(((__pyx_v_hidden2_bias) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hidden2_bias, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 141, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_hidden2_bias;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
  __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":143
 *         self.hidden2_bias = hidden2_bias
 * 
 *         self.validation_predicates = None             # <<<<<<<<<<<<<<
 *         self.validation_arguments = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_predicates);
  __Pyx_DECREF(__pyx_v_self->validation_predicates);
  __pyx_v_self->validation_predicates = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":144
 * 
 *         self.validation_predicates = None
 *         self.validation_arguments = None             # <<<<<<<<<<<<<<
 * 
 *         self.use_learning_rate_decay = False
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_arguments);
  __Pyx_DECREF(__pyx_v_self->validation_arguments);
  __pyx_v_self->validation_arguments = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":146
 *         self.validation_arguments = None
 * 
 *         self.use_learning_rate_decay = False             # <<<<<<<<<<<<<<
 * 
 *     def _generate_save_dict(self):
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __pyx_v_self->__pyx_base.use_learning_rate_decay = ((PyBoolObject *)Py_False);

  /* "nltkor/tag/libs/networkconv.pyx":122
 * 
 * 
 *     def __init__(self, word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden1_weights, hidden1_bias, target_dist_weights,
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict, "ConvolutionalNetwork._generate_save_dict(self)\n\n        Generates a dictionary with all parameters saved by the model.\n        It is directly used by the numpy savez function.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict = {"_generate_save_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_generate_save_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_generate_save_dict", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_generate_save_dict", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__34)
  __Pyx_RefNannySetupContext("_generate_save_dict", 1);
  __Pyx_TraceCall("_generate_save_dict", __pyx_f[1], 148, 0, __PYX_ERR(1, 148, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":153
 *         It is directly used by the numpy savez function.
 *         """
 *         d = dict(hidden_weights=self.hidden_weights,             # <<<<<<<<<<<<<<
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden_weights, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":154
 *         """
 *         d = dict(hidden_weights=self.hidden_weights,
 *                  target_dist_table=self.target_dist_table,             # <<<<<<<<<<<<<<
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_dist_table, ((PyObject *)__pyx_v_self->target_dist_table)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":155
 *         d = dict(hidden_weights=self.hidden_weights,
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,             # <<<<<<<<<<<<<<
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pred_dist_table, ((PyObject *)__pyx_v_self->pred_dist_table)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":156
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,             # <<<<<<<<<<<<<<
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_dist_weights, ((PyObject *)__pyx_v_self->target_dist_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":157
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,             # <<<<<<<<<<<<<<
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pred_dist_weights, ((PyObject *)__pyx_v_self->pred_dist_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":158
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,             # <<<<<<<<<<<<<<
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_output_weights, ((PyObject *)__pyx_v_self->__pyx_base.output_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":159
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,             # <<<<<<<<<<<<<<
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_transitions, ((PyObject *)__pyx_v_self->__pyx_base.transitions)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":160
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,             # <<<<<<<<<<<<<<
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden_bias, ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_output_bias, ((PyObject *)__pyx_v_self->__pyx_base.output_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":161
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,             # <<<<<<<<<<<<<<
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_word_window_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":162
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,             # <<<<<<<<<<<<<<
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_input_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":163
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,             # <<<<<<<<<<<<<<
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_output_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden2_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":164
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,             # <<<<<<<<<<<<<<
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden2_weights, ((PyObject *)__pyx_v_self->hidden2_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hidden2_bias, ((PyObject *)__pyx_v_self->hidden2_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":165
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,             # <<<<<<<<<<<<<<
 *                  feature_tables=self.feature_tables)
 *         return d
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_padding_left, ((PyObject *)__pyx_v_self->__pyx_base.padding_left)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_padding_right, ((PyObject *)__pyx_v_self->__pyx_base.padding_right)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":166
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)             # <<<<<<<<<<<<<<
 *         return d
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_feature_tables, __pyx_v_self->__pyx_base.feature_tables) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":167
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)
 *         return d             # <<<<<<<<<<<<<<
 * 
 *     def save(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._generate_save_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save, "ConvolutionalNetwork.save(self)\n\n        Saves the neural network to a file.\n        It will save the weights, biases, sizes, padding and \n        distance tables, and other feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save = {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "save", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__35)
  __Pyx_RefNannySetupContext("save", 1);
  __Pyx_TraceCall("save", __pyx_f[1], 169, 0, __PYX_ERR(1, 169, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":175
 *         distance tables, and other feature tables.
 *         """
 *         data = self._generate_save_dict()             # <<<<<<<<<<<<<<
 *         np.savez(self.network_filename, **data)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generate_save_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":176
 *         """
 *         data = self._generate_save_dict()
 *         np.savez(self.network_filename, **data)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_savez); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.network_filename)) __PYX_ERR(1, 176, __pyx_L1_error);
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(1, 176, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_data))) {
    __pyx_t_3 = PyDict_Copy(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file, "ConvolutionalNetwork._load_from_file(cls, data, filename)\n\n        Internal method for setting data read from a npz file.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file = {"_load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_load_from_file", 1, 2, 2, 1); __PYX_ERR(1, 178, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_load_from_file") < 0)) __PYX_ERR(1, 178, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_data = values[0];
    __pyx_v_filename = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_load_from_file", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 178, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_data, __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_hidden2_weights = NULL;
  PyObject *__pyx_v_hidden2_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_word_window_size = NULL;
  PyObject *__pyx_v_input_size = NULL;
  PyObject *__pyx_v_hidden_size = NULL;
  PyObject *__pyx_v_hidden2_size = NULL;
  PyObject *__pyx_v_output_size = NULL;
  PyObject *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__36)
  __Pyx_RefNannySetupContext("_load_from_file", 1);
  __Pyx_TraceCall("_load_from_file", __pyx_f[1], 178, 0, __PYX_ERR(1, 178, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":185
 *         # cython classes don't have the __dict__ attribute
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         hidden_bias = data['hidden_bias']
 *         hidden2_weights = data['hidden2_weights']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":186
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         hidden2_weights = data['hidden2_weights']
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":187
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']
 *         hidden2_weights = data['hidden2_weights']             # <<<<<<<<<<<<<<
 * 
 *         hidden2_bias = data['hidden2_bias']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":189
 *         hidden2_weights = data['hidden2_weights']
 * 
 *         hidden2_bias = data['hidden2_bias']             # <<<<<<<<<<<<<<
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":190
 * 
 *         hidden2_bias = data['hidden2_bias']
 *         output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         output_bias = data['output_bias']
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":191
 *         hidden2_bias = data['hidden2_bias']
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 * 
 *         word_window_size = data['word_window_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":193
 *         output_bias = data['output_bias']
 * 
 *         word_window_size = data['word_window_size']             # <<<<<<<<<<<<<<
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_window_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":194
 * 
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']             # <<<<<<<<<<<<<<
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_input_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":195
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']             # <<<<<<<<<<<<<<
 *         hidden2_size = data['hidden2_size']
 *         output_size = data['output_size']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":196
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']             # <<<<<<<<<<<<<<
 *         output_size = data['output_size']
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":197
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']
 *         output_size = data['output_size']             # <<<<<<<<<<<<<<
 * 
 *         # numpy stores None as an array containing None and with empty shape
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":200
 * 
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():             # <<<<<<<<<<<<<<
 *             hidden2_weights = None
 *             hidden2_size = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hidden2_weights, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "nltkor/tag/libs/networkconv.pyx":201
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():
 *             hidden2_weights = None             # <<<<<<<<<<<<<<
 *             hidden2_size = 0
 *             hidden2_bias = None
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_hidden2_weights, Py_None);

    /* "nltkor/tag/libs/networkconv.pyx":202
 *         if hidden2_weights.shape == ():
 *             hidden2_weights = None
 *             hidden2_size = 0             # <<<<<<<<<<<<<<
 *             hidden2_bias = None
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_hidden2_size, __pyx_int_0);

    /* "nltkor/tag/libs/networkconv.pyx":203
 *             hidden2_weights = None
 *             hidden2_size = 0
 *             hidden2_bias = None             # <<<<<<<<<<<<<<
 * 
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_hidden2_bias, Py_None);

    /* "nltkor/tag/libs/networkconv.pyx":200
 * 
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():             # <<<<<<<<<<<<<<
 *             hidden2_weights = None
 *             hidden2_size = 0
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":207
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,
 *                  output_size, hidden_weights, hidden_bias,
 *                  data['target_dist_weights'], data['pred_dist_weights'],             # <<<<<<<<<<<<<<
 *                  hidden2_weights, hidden2_bias,
 *                  output_weights, output_bias)
 */
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_target_dist_weights); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_pred_dist_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "nltkor/tag/libs/networkconv.pyx":205
 *             hidden2_bias = None
 * 
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden_weights, hidden_bias,
 *                  data['target_dist_weights'], data['pred_dist_weights'],
 */
  __pyx_t_4 = PyTuple_New(13); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_word_window_size);
  __Pyx_GIVEREF(__pyx_v_word_window_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_word_window_size)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_input_size);
  __Pyx_GIVEREF(__pyx_v_input_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_input_size)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_size);
  __Pyx_GIVEREF(__pyx_v_hidden_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_hidden_size)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden2_size);
  __Pyx_GIVEREF(__pyx_v_hidden2_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_hidden2_size)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_size);
  __Pyx_GIVEREF(__pyx_v_output_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_output_size)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_weights);
  __Pyx_GIVEREF(__pyx_v_hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_hidden_weights)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden_bias);
  __Pyx_GIVEREF(__pyx_v_hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_hidden_bias)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden2_weights);
  __Pyx_GIVEREF(__pyx_v_hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_hidden2_weights)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_hidden2_bias);
  __Pyx_GIVEREF(__pyx_v_hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_hidden2_bias)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_weights);
  __Pyx_GIVEREF(__pyx_v_output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_v_output_weights)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_output_bias);
  __Pyx_GIVEREF(__pyx_v_output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_v_output_bias)) __PYX_ERR(1, 205, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_nn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":211
 *                  output_weights, output_bias)
 * 
 *         nn.target_dist_table = data['target_dist_table']             # <<<<<<<<<<<<<<
 *         nn.pred_dist_table = data['pred_dist_table']
 *         #transitions = data['transitions']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_target_dist_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_target_dist_table, __pyx_t_1) < 0) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":212
 * 
 *         nn.target_dist_table = data['target_dist_table']
 *         nn.pred_dist_table = data['pred_dist_table']             # <<<<<<<<<<<<<<
 *         #transitions = data['transitions']
 *         #nn.transitions = transitions if transitions.shape != () else None
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_pred_dist_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_pred_dist_table, __pyx_t_1) < 0) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":215
 *         #transitions = data['transitions']
 *         #nn.transitions = transitions if transitions.shape != () else None
 *         nn.padding_left = data['padding_left']             # <<<<<<<<<<<<<<
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_padding_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_padding_left, __pyx_t_1) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":216
 *         #nn.transitions = transitions if transitions.shape != () else None
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']             # <<<<<<<<<<<<<<
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_padding_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_padding_right, __pyx_t_1) < 0) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":217
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])             # <<<<<<<<<<<<<<
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_n_s_word_window_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_4, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_n_s_padding_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_pre_padding, __pyx_t_1) < 0) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":218
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])             # <<<<<<<<<<<<<<
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_n_s_word_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_n_s_padding_right); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_pos_padding, __pyx_t_1) < 0) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":219
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         nn.network_filename = filename
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_feature_tables, __pyx_t_5) < 0) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":220
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename             # <<<<<<<<<<<<<<
 * 
 *         return nn
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_n_s_network_filename, __pyx_v_filename) < 0) __PYX_ERR(1, 220, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":222
 *         nn.network_filename = filename
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nn);
  __pyx_r = __pyx_v_nn;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_hidden2_weights);
  __Pyx_XDECREF(__pyx_v_hidden2_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_word_window_size);
  __Pyx_XDECREF(__pyx_v_input_size);
  __Pyx_XDECREF(__pyx_v_hidden_size);
  __Pyx_XDECREF(__pyx_v_hidden2_size);
  __Pyx_XDECREF(__pyx_v_output_size);
  __Pyx_XDECREF(__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file, "ConvolutionalNetwork.load_from_file(cls, filename)\n\n        Loads the neural network from a file.\n        It will load weights, biases, sizes, padding and \n        distance tables, and other feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file = {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 224, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_from_file") < 0)) __PYX_ERR(1, 224, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 224, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__37)
  __Pyx_RefNannySetupContext("load_from_file", 1);
  __Pyx_TraceCall("load_from_file", __pyx_f[1], 224, 0, __PYX_ERR(1, 224, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":231
 *         distance tables, and other feature tables.
 *         """
 *         data = np.load(filename, allow_pickle=True) #             # <<<<<<<<<<<<<<
 *         return cls._load_from_file(data, filename)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename)) __PYX_ERR(1, 231, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allow_pickle, Py_True) < 0) __PYX_ERR(1, 231, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_data = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":232
 *         """
 *         data = np.load(filename, allow_pickle=True) #
 *         return cls._load_from_file(data, filename)             # <<<<<<<<<<<<<<
 * 
 *     def _load_parameters(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_load_from_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_filename};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters, "ConvolutionalNetwork._load_parameters(self)\n\n        Loads weights, feature tables, distance tables and \n        transition tables previously saved.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters = {"_load_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_load_parameters", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_load_parameters", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__38)
  __Pyx_RefNannySetupContext("_load_parameters", 1);
  __Pyx_TraceCall("_load_parameters", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":239
 *         transition tables previously saved.
 *         """
 *         data = np.load(self.network_filename)             # <<<<<<<<<<<<<<
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":240
 *         """
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __pyx_v_self->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":241
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __pyx_v_self->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":242
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __pyx_v_self->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":243
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 243, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __pyx_v_self->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":244
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         self.target_dist_table = data['target_dist_table']
 *         self.pred_dist_table = data['pred_dist_table']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.feature_tables);
  __pyx_v_self->__pyx_base.feature_tables = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":245
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']             # <<<<<<<<<<<<<<
 *         self.pred_dist_table = data['pred_dist_table']
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_target_dist_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":246
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']
 *         self.pred_dist_table = data['pred_dist_table']             # <<<<<<<<<<<<<<
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_pred_dist_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":249
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":250
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():
 *             self.transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             self.transitions = None
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 250, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":249
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":252
 *             self.transitions = data['transitions']
 *         else:
 *             self.transitions = None             # <<<<<<<<<<<<<<
 * 
 *         # same for second hidden layer weights
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)Py_None);
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":255
 * 
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():             # <<<<<<<<<<<<<<
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":256
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():
 *             self.hidden2_weights = data['hidden2_weights']             # <<<<<<<<<<<<<<
 *             self.hidden2_bias = data['hidden2_bias']
 *         else:
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":257
 *         if data['hidden2_weights'].shape != ():
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']             # <<<<<<<<<<<<<<
 *         else:
 *             self.hidden2_weights = None
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_hidden2_bias); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
    __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":255
 * 
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():             # <<<<<<<<<<<<<<
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']
 */
    goto __pyx_L4;
  }

  /* "nltkor/tag/libs/networkconv.pyx":259
 *             self.hidden2_bias = data['hidden2_bias']
 *         else:
 *             self.hidden2_weights = None             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list validation_sentences,
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)Py_None);
  }
  __pyx_L4:;

  /* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data, "ConvolutionalNetwork.set_validation_data(self, list validation_sentences, list validation_predicates, list validation_tags, list validation_arguments=None)\n\n        Sets the data to be used in validation during training. If this function\n        is not called before training, the training data itself is used to \n        measure the model's performance.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data = {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_validation_sentences = 0;
  PyObject *__pyx_v_validation_predicates = 0;
  PyObject *__pyx_v_validation_tags = 0;
  PyObject *__pyx_v_validation_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_validation_sentences,&__pyx_n_s_validation_predicates,&__pyx_n_s_validation_tags,&__pyx_n_s_validation_arguments,0};

    /* "nltkor/tag/libs/networkconv.pyx":264
 *                             list validation_predicates,
 *                             list validation_tags,
 *                             list validation_arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 3, 4, 1); __PYX_ERR(1, 261, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 3, 4, 2); __PYX_ERR(1, 261, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validation_arguments);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_validation_data") < 0)) __PYX_ERR(1, 261, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_validation_sentences = ((PyObject*)values[0]);
    __pyx_v_validation_predicates = ((PyObject*)values[1]);
    __pyx_v_validation_tags = ((PyObject*)values[2]);
    __pyx_v_validation_arguments = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 261, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_sentences), (&PyList_Type), 1, "validation_sentences", 1))) __PYX_ERR(1, 261, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_predicates), (&PyList_Type), 1, "validation_predicates", 1))) __PYX_ERR(1, 262, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_tags), (&PyList_Type), 1, "validation_tags", 1))) __PYX_ERR(1, 263, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_arguments), (&PyList_Type), 1, "validation_arguments", 1))) __PYX_ERR(1, 264, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_validation_sentences, __pyx_v_validation_predicates, __pyx_v_validation_tags, __pyx_v_validation_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_predicates, PyObject *__pyx_v_validation_tags, PyObject *__pyx_v_validation_arguments) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__39)
  __Pyx_RefNannySetupContext("set_validation_data", 1);
  __Pyx_TraceCall("set_validation_data", __pyx_f[1], 261, 0, __PYX_ERR(1, 261, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":270
 *         measure the model's performance.
 *         """
 *         self.validation_sentences = validation_sentences             # <<<<<<<<<<<<<<
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags
 */
  __Pyx_INCREF(__pyx_v_validation_sentences);
  __Pyx_GIVEREF(__pyx_v_validation_sentences);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.validation_sentences);
  __pyx_v_self->__pyx_base.validation_sentences = __pyx_v_validation_sentences;

  /* "nltkor/tag/libs/networkconv.pyx":271
 *         """
 *         self.validation_sentences = validation_sentences
 *         self.validation_predicates = validation_predicates             # <<<<<<<<<<<<<<
 *         self.validation_tags = validation_tags
 *         self.validation_arguments = validation_arguments
 */
  __Pyx_INCREF(__pyx_v_validation_predicates);
  __Pyx_GIVEREF(__pyx_v_validation_predicates);
  __Pyx_GOTREF(__pyx_v_self->validation_predicates);
  __Pyx_DECREF(__pyx_v_self->validation_predicates);
  __pyx_v_self->validation_predicates = __pyx_v_validation_predicates;

  /* "nltkor/tag/libs/networkconv.pyx":272
 *         self.validation_sentences = validation_sentences
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags             # <<<<<<<<<<<<<<
 *         self.validation_arguments = validation_arguments
 * 
 */
  __Pyx_INCREF(__pyx_v_validation_tags);
  __Pyx_GIVEREF(__pyx_v_validation_tags);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.validation_tags);
  __pyx_v_self->__pyx_base.validation_tags = __pyx_v_validation_tags;

  /* "nltkor/tag/libs/networkconv.pyx":273
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags
 *         self.validation_arguments = validation_arguments             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list predicates, list tags,
 */
  __Pyx_INCREF(__pyx_v_validation_arguments);
  __Pyx_GIVEREF(__pyx_v_validation_arguments);
  __Pyx_GOTREF(__pyx_v_self->validation_arguments);
  __Pyx_DECREF(__pyx_v_self->validation_arguments);
  __pyx_v_self->validation_arguments = __pyx_v_validation_arguments;

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train, "ConvolutionalNetwork.train(self, list sentences, list predicates, list tags, int epochs, int epochs_between_reports=0, float desired_accuracy=0, list arguments=None)\n\n        Trains the convolutional network. Refer to the basic Network\n        train method for detailed explanation.\n        \n        :param predicates: a list of 1-dim numpy array\n            indicating the indices of predicates in each sentence.\n        :param arguments: (only for argument classifying) a list of 2-dim\n            numpy arrays indicating the start and end of each argument. \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train = {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_predicates,&__pyx_n_s_tags,&__pyx_n_s_epochs,&__pyx_n_s_epochs_between_reports,&__pyx_n_s_desired_accuracy,&__pyx_n_s_arguments,0};

    /* "nltkor/tag/libs/networkconv.pyx":277
 *     def train(self, list sentences, list predicates, list tags,
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Trains the convolutional network. Refer to the basic Network
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, 1); __PYX_ERR(1, 275, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, 2); __PYX_ERR(1, 275, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, 3); __PYX_ERR(1, 275, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs_between_reports);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_desired_accuracy);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "train") < 0)) __PYX_ERR(1, 275, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_predicates = ((PyObject*)values[1]);
    __pyx_v_tags = ((PyObject*)values[2]);
    __pyx_v_epochs = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 276, __pyx_L3_error)
    if (values[4]) {
      __pyx_v_epochs_between_reports = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 276, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[5]) {
      __pyx_v_desired_accuracy = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 277, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
    __pyx_v_arguments = ((PyObject*)values[6]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, __pyx_nargs); __PYX_ERR(1, 275, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), (&PyList_Type), 1, "predicates", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arguments), (&PyList_Type), 1, "arguments", 1))) __PYX_ERR(1, 277, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 288, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_train_locals_genexpr, __pyx_n_s_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __Pyx_TraceCall("genexpr", __pyx_f[1], 288, 0, __PYX_ERR(1, 288, __pyx_L1_error));
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceReturn(Py_None, 0);
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 288, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(1, 288, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 288, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 288, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 288, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 288, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_TraceReturn(__pyx_r, 0);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 288, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_logger = NULL;
  double __pyx_v_last_accuracy;
  double __pyx_v_top_accuracy;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__40)
  __Pyx_RefNannySetupContext("train", 1);
  __Pyx_TraceCall("train", __pyx_f[1], 275, 0, __PYX_ERR(1, 275, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":287
 *             numpy arrays indicating the start and end of each argument.
 *         """
 *         self.num_sentences = len(sentences)             # <<<<<<<<<<<<<<
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 *         self.only_classify = arguments is not None
 */
  if (unlikely(__pyx_v_sentences == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 287, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_sentences); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 287, __pyx_L1_error)
  __pyx_v_self->num_sentences = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
 */
  __pyx_t_2 = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(NULL, __pyx_v_sentences); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base.num_tokens = __pyx_t_4;

  /* "nltkor/tag/libs/networkconv.pyx":289
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 *         self.only_classify = arguments is not None             # <<<<<<<<<<<<<<
 * 
 *         logger = logging.getLogger("Logger")
 */
  __pyx_t_5 = (__pyx_v_arguments != ((PyObject*)Py_None));
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7cpython_4bool_bool)))) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v_self->only_classify);
  __pyx_v_self->only_classify = ((PyBoolObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":291
 *         self.only_classify = arguments is not None
 * 
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_u_Logger};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v_logger = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":292
 * 
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)             # <<<<<<<<<<<<<<
 *         last_accuracy = 0
 *         top_accuracy = 0
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_Training_for_up_to_d_epochs, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":293
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0             # <<<<<<<<<<<<<<
 *         top_accuracy = 0
 *         last_error = np.Infinity
 */
  __pyx_v_last_accuracy = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":294
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0
 *         top_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_error = np.Infinity
 * 
 */
  __pyx_v_top_accuracy = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":295
 *         last_accuracy = 0
 *         top_accuracy = 0
 *         last_error = np.Infinity             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_last_error = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":297
 *         last_error = np.Infinity
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 */
  __pyx_t_5 = (__pyx_v_self->__pyx_base.validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":298
 * 
 *         if self.validation_sentences is None:
 *             self.set_validation_data(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 * 
 *         for i in xrange(epochs):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_validation_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":297
 *         last_error = np.Infinity
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":300
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 *         for i in xrange(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_xrange, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 300, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 300, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":301
 * 
 *         for i in xrange(epochs):
 *             self.decrease_learning_rates(i)             # <<<<<<<<<<<<<<
 *             self._train_epoch(sentences, predicates, tags, arguments)
 *             self._validate()
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decrease_learning_rates); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_i};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":302
 *         for i in xrange(epochs):
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 *             self._validate()
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_train_epoch); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":303
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
 *             self._validate()             # <<<<<<<<<<<<<<
 * 
 *             # Attardi: save model
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_validate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":306
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
 */
    __pyx_t_5 = (__pyx_v_self->__pyx_base.accuracy > __pyx_v_top_accuracy);
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkconv.pyx":307
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *                 self.save()
 *                 logger.debug("Saved model")
 */
      __pyx_t_10 = __pyx_v_self->__pyx_base.accuracy;
      __pyx_v_top_accuracy = __pyx_t_10;

      /* "nltkor/tag/libs/networkconv.pyx":308
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy
 *                 self.save()             # <<<<<<<<<<<<<<
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":309
 *                 top_accuracy = self.accuracy
 *                 self.save()
 *                 logger.debug("Saved model")             # <<<<<<<<<<<<<<
 *             elif self.use_learning_rate_decay:
 *                 # this iteration didn't bring improvements; load the last saved model
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_debug); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_Saved_model};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":306
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
 */
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":310
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 310, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkconv.pyx":313
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 *                 self._load_parameters()             # <<<<<<<<<<<<<<
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_parameters); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":310
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 */
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    __pyx_t_11 = (__pyx_v_epochs_between_reports > 0);
    if (!__pyx_t_11) {
      goto __pyx_L9_next_or;
    } else {
    }
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyNumber_Remainder(__pyx_v_i, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_8, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!__pyx_t_11) {
    } else {
      __pyx_t_5 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_L9_next_or:;

    /* "nltkor/tag/libs/networkconv.pyx":316
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \             # <<<<<<<<<<<<<<
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 */
    __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy >= __pyx_v_desired_accuracy);
    if (__pyx_t_11) {
      __pyx_t_11 = (__pyx_v_desired_accuracy > 0.0);
    }
    if (!__pyx_t_11) {
    } else {
      __pyx_t_5 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }

    /* "nltkor/tag/libs/networkconv.pyx":317
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 * 
 *                 self._print_epoch_report(i + 1)
 */
    __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy < __pyx_v_last_accuracy);
    if (__pyx_t_11) {
    } else {
      __pyx_t_5 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __pyx_t_11;
    __pyx_L8_bool_binop_done:;

    /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkconv.pyx":319
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 *                 self._print_epoch_report(i + 1)             # <<<<<<<<<<<<<<
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_epoch_report); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
 */
      __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy >= __pyx_v_desired_accuracy);
      if (__pyx_t_11) {
        __pyx_t_11 = (__pyx_v_desired_accuracy > 0.0);
      }
      if (!__pyx_t_11) {
      } else {
        __pyx_t_5 = __pyx_t_11;
        goto __pyx_L14_bool_binop_done;
      }

      /* "nltkor/tag/libs/networkconv.pyx":322
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 *                     # accuracy is falling, the network is probably diverging
 *                     # or overfitting
 */
      __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy < __pyx_v_last_accuracy);
      if (__pyx_t_11) {
      } else {
        __pyx_t_5 = __pyx_t_11;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = __pyx_t_11;
      __pyx_L14_bool_binop_done:;

      /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
 */
      if (__pyx_t_5) {

        /* "nltkor/tag/libs/networkconv.pyx":325
 *                     # accuracy is falling, the network is probably diverging
 *                     # or overfitting
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             last_accuracy = self.accuracy
 */
        goto __pyx_L5_break;

        /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
 */
      }

      /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":327
 *                     break
 * 
 *             last_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *             last_error = self.error
 * 
 */
    __pyx_t_10 = __pyx_v_self->__pyx_base.accuracy;
    __pyx_v_last_accuracy = __pyx_t_10;

    /* "nltkor/tag/libs/networkconv.pyx":328
 * 
 *             last_accuracy = self.accuracy
 *             last_error = self.error             # <<<<<<<<<<<<<<
 * 
 *         self.num_sentences = 0
 */
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF_SET(__pyx_v_last_error, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":300
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 *         for i in xrange(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  goto __pyx_L17_for_end;
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  goto __pyx_L17_for_end;
  __pyx_L17_for_end:;

  /* "nltkor/tag/libs/networkconv.pyx":330
 *             last_error = self.error
 * 
 *         self.num_sentences = 0             # <<<<<<<<<<<<<<
 *         self.num_tokens = 0
 *         self._reset_counters()
 */
  __pyx_v_self->num_sentences = 0;

  /* "nltkor/tag/libs/networkconv.pyx":331
 * 
 *         self.num_sentences = 0
 *         self.num_tokens = 0             # <<<<<<<<<<<<<<
 *         self._reset_counters()
 * 
 */
  __pyx_v_self->__pyx_base.num_tokens = 0;

  /* "nltkor/tag/libs/networkconv.pyx":332
 *         self.num_sentences = 0
 *         self.num_tokens = 0
 *         self._reset_counters()             # <<<<<<<<<<<<<<
 * 
 *     def _reset_counters(self):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_counters); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters, "ConvolutionalNetwork._reset_counters(self)\n\n        Reset the performance statistics counters. They are updated during\n        each epoch. \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters = {"_reset_counters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reset_counters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_reset_counters", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_reset_counters", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__41)
  __Pyx_RefNannySetupContext("_reset_counters", 1);
  __Pyx_TraceCall("_reset_counters", __pyx_f[1], 334, 0, __PYX_ERR(1, 334, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":339
 *         each epoch.
 *         """
 *         self.error = 0             # <<<<<<<<<<<<<<
 *         self.skips = 0
 *         self.float_errors = 0
 */
  __pyx_v_self->__pyx_base.error = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":340
 *         """
 *         self.error = 0
 *         self.skips = 0             # <<<<<<<<<<<<<<
 *         self.float_errors = 0
 * 
 */
  __pyx_v_self->__pyx_base.skips = 0;

  /* "nltkor/tag/libs/networkconv.pyx":341
 *         self.error = 0
 *         self.skips = 0
 *         self.float_errors = 0             # <<<<<<<<<<<<<<
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):
 */
  __pyx_v_self->__pyx_base.float_errors = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._reset_counters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data, "ConvolutionalNetwork._shuffle_data(self, sentences, predicates, tags, arguments=None)\n\n        Shuffle the given training data in place.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data = {"_shuffle_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_shuffle_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_predicates,&__pyx_n_s_tags,&__pyx_n_s_arguments,0};
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 343, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 343, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_shuffle_data", 0, 3, 4, 1); __PYX_ERR(1, 343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 343, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_shuffle_data", 0, 3, 4, 2); __PYX_ERR(1, 343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_shuffle_data") < 0)) __PYX_ERR(1, 343, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_tags = values[2];
    __pyx_v_arguments = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_shuffle_data", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._shuffle_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_random_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__42)
  __Pyx_RefNannySetupContext("_shuffle_data", 1);
  __Pyx_TraceCall("_shuffle_data", __pyx_f[1], 343, 0, __PYX_ERR(1, 343, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":349
 *         # get the random number generator state in order to shuffle
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()             # <<<<<<<<<<<<<<
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_random_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":350
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_sentences};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":351
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":352
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_predicates};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":353
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(tags)
 *         if arguments is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":354
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)             # <<<<<<<<<<<<<<
 *         if arguments is not None:
 *             np.random.set_state(random_state)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":355
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)
 */
  __pyx_t_5 = (__pyx_v_arguments != Py_None);
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":356
 *         np.random.shuffle(tags)
 *         if arguments is not None:
 *             np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *             np.random.shuffle(arguments)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":357
 *         if arguments is not None:
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_arguments};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":355
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._shuffle_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_random_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch, "ConvolutionalNetwork._train_epoch(self, sentences, predicates, tags, arguments)\nTrains for one epoch with all examples.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch = {"_train_epoch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_train_epoch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_predicates,&__pyx_n_s_tags,&__pyx_n_s_arguments,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 360, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, 1); __PYX_ERR(1, 360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, 2); __PYX_ERR(1, 360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, 3); __PYX_ERR(1, 360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_train_epoch") < 0)) __PYX_ERR(1, 360, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_sentences = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_tags = values[2];
    __pyx_v_arguments = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 360, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_i_args = NULL;
  PyObject *__pyx_v_sent_args = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_preds = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__43)
  __Pyx_RefNannySetupContext("_train_epoch", 1);
  __Pyx_TraceCall("_train_epoch", __pyx_f[1], 360, 0, __PYX_ERR(1, 360, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":363
 *         """Trains for one epoch with all examples."""
 * 
 *         self._reset_counters()             # <<<<<<<<<<<<<<
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_counters); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":364
 * 
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 *         if arguments is not None:
 *             i_args = iter(arguments)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":365
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(arguments)
 *         else:
 */
  __pyx_t_5 = (__pyx_v_arguments != Py_None);
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":366
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:
 *             i_args = iter(arguments)             # <<<<<<<<<<<<<<
 *         else:
 *             sent_args = None
 */
    __pyx_t_1 = PyObject_GetIter(__pyx_v_arguments); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_i_args = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":365
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(arguments)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":368
 *             i_args = iter(arguments)
 *         else:
 *             sent_args = None             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_sent_args = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":370
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):             # <<<<<<<<<<<<<<
 *             if arguments is not None:
 *                 sent_args = next(i_args)
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_sentences);
  __Pyx_GIVEREF(__pyx_v_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sentences)) __PYX_ERR(1, 370, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_predicates);
  __Pyx_GIVEREF(__pyx_v_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_predicates)) __PYX_ERR(1, 370, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tags);
  __Pyx_GIVEREF(__pyx_v_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_tags)) __PYX_ERR(1, 370, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 370, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 370, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 370, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(1, 370, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 370, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_preds, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":371
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
 */
    __pyx_t_5 = (__pyx_v_arguments != Py_None);
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkconv.pyx":372
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:
 *                 sent_args = next(i_args)             # <<<<<<<<<<<<<<
 *                 #sent_args = i_args.next()
 * 
 */
      if (unlikely(!__pyx_v_i_args)) { __Pyx_RaiseUnboundLocalError("i_args"); __PYX_ERR(1, 372, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_i_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_sent_args, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":371
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "nltkor/tag/libs/networkconv.pyx":376
 * 
 *             try:
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)             # <<<<<<<<<<<<<<
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 376, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(!__pyx_v_sent_args)) { __Pyx_RaiseUnboundLocalError("sent_args"); __PYX_ERR(1, 376, __pyx_L9_error) }
        __pyx_t_8 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_sent, __pyx_v_sent_preds, __pyx_v_sent_tags, __pyx_v_sent_args};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 376, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
 */
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":377
 *             try:
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:             # <<<<<<<<<<<<<<
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1
 */
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_FloatingPointError);
      if (__pyx_t_15) {
        __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(1, 377, __pyx_L11_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);

        /* "nltkor/tag/libs/networkconv.pyx":379
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */
        __pyx_v_self->__pyx_base.float_errors = (__pyx_v_self->__pyx_base.float_errors + 1.0);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_exception_handled;
      }
      goto __pyx_L11_except_error;

      /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
 */
      __pyx_L11_except_error:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_L16_try_end:;
    }

    /* "nltkor/tag/libs/networkconv.pyx":370
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):             # <<<<<<<<<<<<<<
 *             if arguments is not None:
 *                 sent_args = next(i_args)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i_args);
  __Pyx_XDECREF(__pyx_v_sent_args);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_preds);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence, "ConvolutionalNetwork.tag_sentence(self, ndarray sentence, ndarray predicates, list arguments=None, bool logprob=False, bool allow_repeats=True)\n\n        Runs the network for each element in the sentence and returns \n        the sequence of tags.\n        \n        :param sentence: a 2-dim numpy array, where each item encodes a token.\n        :param predicates: a 1-dim numpy array, indicating the position\n            of the predicates in the sentence\n        :param logprob: a boolean indicating whether to return the \n            log-probability for each answer or not.\n        :param allow_repeats: a boolean indicating whether to allow repeated\n            argument classes (only for separate argument classification).\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence = {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_arguments = 0;
  PyBoolObject *__pyx_v_logprob = 0;
  PyBoolObject *__pyx_v_allow_repeats = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicates,&__pyx_n_s_arguments,&__pyx_n_s_logprob,&__pyx_n_s_allow_repeats,0};

    /* "nltkor/tag/libs/networkconv.pyx":382
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,             # <<<<<<<<<<<<<<
 *                      bool allow_repeats=True):
 *         """
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyBoolObject *)Py_False));

    /* "nltkor/tag/libs/networkconv.pyx":383
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyBoolObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 2, 5, 1); __PYX_ERR(1, 381, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_logprob);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allow_repeats);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tag_sentence") < 0)) __PYX_ERR(1, 381, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicates = ((PyArrayObject *)values[1]);
    __pyx_v_arguments = ((PyObject*)values[2]);
    __pyx_v_logprob = ((PyBoolObject *)values[3]);
    __pyx_v_allow_repeats = ((PyBoolObject *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 381, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), __pyx_ptype_5numpy_ndarray, 1, "predicates", 0))) __PYX_ERR(1, 381, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arguments), (&PyList_Type), 1, "arguments", 1))) __PYX_ERR(1, 382, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_logprob), __pyx_ptype_7cpython_4bool_bool, 1, "logprob", 0))) __PYX_ERR(1, 382, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 383, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_arguments, __pyx_v_logprob, __pyx_v_allow_repeats);

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_arguments, PyBoolObject *__pyx_v_logprob, PyBoolObject *__pyx_v_allow_repeats) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__44)
  __Pyx_RefNannySetupContext("tag_sentence", 1);
  __Pyx_TraceCall("tag_sentence", __pyx_f[1], 381, 0, __PYX_ERR(1, 381, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":396
 *             argument classes (only for separate argument classification).
 *         """
 *         self.only_classify = arguments is not None             # <<<<<<<<<<<<<<
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 */
  __pyx_t_1 = (__pyx_v_arguments != ((PyObject*)Py_None));
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v_self->only_classify);
  __pyx_v_self->only_classify = ((PyBoolObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":397
 *         """
 *         self.only_classify = arguments is not None
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,             # <<<<<<<<<<<<<<
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_sentence);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sentence);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_sentence))) __PYX_ERR(1, 397, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_predicates);
  __Pyx_GIVEREF((PyObject *)__pyx_v_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_predicates))) __PYX_ERR(1, 397, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_argument_blocks, __pyx_v_arguments) < 0) __PYX_ERR(1, 397, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":398
 *         self.only_classify = arguments is not None
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,
 *                                   logprob=logprob, allow_repeats=allow_repeats)             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):
 */
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_logprob, ((PyObject *)__pyx_v_logprob)) < 0) __PYX_ERR(1, 397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allow_repeats, ((PyObject *)__pyx_v_allow_repeats)) < 0) __PYX_ERR(1, 397, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":397
 *         """
 *         self.only_classify = arguments is not None
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,             # <<<<<<<<<<<<<<
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":400
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the distance from each token in the sentence to the argument.
 */

static PyArrayObject *__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_positions, PyObject *__pyx_v_argument) {
  PyObject *__pyx_v_distances = NULL;
  PyObject *__pyx_v_lo = NULL;
  PyObject *__pyx_v_hi = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("argument_distances", 1);
  __Pyx_TraceCall("argument_distances", __pyx_f[1], 400, 0, __PYX_ERR(1, 400, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":404
 *         Calculates the distance from each token in the sentence to the argument.
 *         """
 *         distances = positions.copy()             # <<<<<<<<<<<<<<
 * 
 *         # the ones before the argument
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_positions, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":408
 *         # the ones before the argument
 *         #print(argument)
 *         lo = np.less(positions, argument[0])             # <<<<<<<<<<<<<<
 *         distances[lo] -= argument[0]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_less); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_argument, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_positions, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_lo = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":409
 *         #print(argument)
 *         lo = np.less(positions, argument[0])
 *         distances[lo] -= argument[0]             # <<<<<<<<<<<<<<
 * 
 *         # the ones after the argument
 */
  __Pyx_INCREF(__pyx_v_lo);
  __pyx_t_1 = __pyx_v_lo;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_distances, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_argument, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_t_5) < 0))) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":412
 * 
 *         # the ones after the argument
 *         hi = np.greater(positions, argument[1])             # <<<<<<<<<<<<<<
 *         distances[hi] -= argument[1]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_greater); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_argument, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_positions, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_hi = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":413
 *         # the ones after the argument
 *         hi = np.greater(positions, argument[1])
 *         distances[hi] -= argument[1]             # <<<<<<<<<<<<<<
 * 
 *         # the ones inside the argument
 */
  __Pyx_INCREF(__pyx_v_hi);
  __pyx_t_1 = __pyx_v_hi;
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_distances, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_argument, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_t_3) < 0))) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":416
 * 
 *         # the ones inside the argument
 *         distances[np.logical_not(hi | lo)] = 0             # <<<<<<<<<<<<<<
 * 
 *         return distances
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_logical_not); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Or(__pyx_v_hi, __pyx_v_lo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_int_0) < 0))) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":418
 *         distances[np.logical_not(hi | lo)] = 0
 * 
 *         return distances             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_distances) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_distances, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 418, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_distances);
  __pyx_r = ((PyArrayObject *)__pyx_v_distances);
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":400
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the distance from each token in the sentence to the argument.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.argument_distances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_distances);
  __Pyx_XDECREF(__pyx_v_lo);
  __Pyx_XDECREF(__pyx_v_hi);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution, "ConvolutionalNetwork._sentence_convolution(self, sentence, predicate, argument_blocks=None, training=False)\n\n        Perform the convolution for a given predicate.\n        \n        :param sentence: a sequence of tokens, each represented as an array of \n            indices\n        :param predicate: the index of the predicate in the sentence\n        :param argument_blocks: (used only in SRL argument classification) the\n            starting and end positions of all delimited arguments\n        :return: the scores for all tokens with respect to the given predicate\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution = {"_sentence_convolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_v_argument_blocks = 0;
  PyObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_sentence_convolution (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicate,&__pyx_n_s_argument_blocks,&__pyx_n_s_training,0};

    /* "nltkor/tag/libs/networkconv.pyx":423
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,             # <<<<<<<<<<<<<<
 *                               training=False):
 *         """
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "nltkor/tag/libs/networkconv.pyx":424
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 *                               training=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform the convolution for a given predicate.
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicate)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_sentence_convolution", 0, 2, 4, 1); __PYX_ERR(1, 421, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_argument_blocks);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_training);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_sentence_convolution") < 0)) __PYX_ERR(1, 421, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicate = values[1];
    __pyx_v_argument_blocks = values[2];
    __pyx_v_training = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_sentence_convolution", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 421, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._sentence_convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate, __pyx_v_argument_blocks, __pyx_v_training);

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_predicate, PyObject *__pyx_v_argument_blocks, PyObject *__pyx_v_training) {
  PyArrayObject *__pyx_v_convolution_values = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyArrayObject *__pyx_v_input_and_pred_dist_values = 0;
  PyObject *__pyx_v_pred_dist_indices = NULL;
  PyObject *__pyx_v_pred_dist_values = NULL;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_target_dist_indices = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_target_dist_values = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_convolution_values;
  __Pyx_Buffer __pyx_pybuffer_convolution_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_and_pred_dist_values;
  __Pyx_Buffer __pyx_pybuffer_input_and_pred_dist_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  PyArrayObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyArrayObject *__pyx_t_16 = NULL;
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh __pyx_t_17;
  PyArrayObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__45)
  __Pyx_RefNannySetupContext("_sentence_convolution", 1);
  __Pyx_TraceCall("_sentence_convolution", __pyx_f[1], 421, 0, __PYX_ERR(1, 421, __pyx_L1_error));
  __pyx_pybuffer_convolution_values.pybuffer.buf = NULL;
  __pyx_pybuffer_convolution_values.refcount = 0;
  __pyx_pybuffernd_convolution_values.data = NULL;
  __pyx_pybuffernd_convolution_values.rcbuffer = &__pyx_pybuffer_convolution_values;
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  __pyx_pybuffer_input_and_pred_dist_values.pybuffer.buf = NULL;
  __pyx_pybuffer_input_and_pred_dist_values.refcount = 0;
  __pyx_pybuffernd_input_and_pred_dist_values.data = NULL;
  __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer = &__pyx_pybuffer_input_and_pred_dist_values;

  /* "nltkor/tag/libs/networkconv.pyx":444
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_and_pred_dist_values
 * 
 *         self.num_targets = len(sentence) if argument_blocks is None else len(argument_blocks)             # <<<<<<<<<<<<<<
 * 
 *         # maximum values found by convolution
 */
  __pyx_t_2 = (__pyx_v_argument_blocks == Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 444, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_3 = PyObject_Length(__pyx_v_argument_blocks); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 444, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_v_self->num_targets = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":447
 * 
 *         # maximum values found by convolution
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         if training:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(1, 447, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(1, 447, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":449
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 449, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":451
 *         if training:
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))             # <<<<<<<<<<<<<<
 *             self.max_indices = np.empty((self.num_targets, self.hidden_size), int)
 *             #self.max_indices = np.empty((self.num_targets, self.hidden_size), np.int)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(1, 451, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(1, 451, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":452
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 *             self.max_indices = np.empty((self.num_targets, self.hidden_size), int)             # <<<<<<<<<<<<<<
 *             #self.max_indices = np.empty((self.num_targets, self.hidden_size), np.int)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8)) __PYX_ERR(1, 452, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(1, 452, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, ((PyObject *)(&PyInt_Type))};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->max_indices);
    __Pyx_DECREF((PyObject *)__pyx_v_self->max_indices);
    __pyx_v_self->max_indices = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":449
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":456
 * 
 *         # predicate distances are the same across all targets
 *         pred_dist_indices = np.arange(len(sentence)) - predicate             # <<<<<<<<<<<<<<
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,
 *                                                              0, mode='clip')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 456, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_predicate); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_pred_dist_indices = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":457
 *         # predicate distances are the same across all targets
 *         pred_dist_indices = np.arange(len(sentence)) - predicate
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                              0, mode='clip')
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->pred_convolution_lookup), __pyx_n_s_take); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_v_pred_dist_indices, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(1, 457, __pyx_L1_error);
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":458
 *         pred_dist_indices = np.arange(len(sentence)) - predicate
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,
 *                                                              0, mode='clip')             # <<<<<<<<<<<<<<
 * 
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_clip) < 0) __PYX_ERR(1, 458, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":457
 *         # predicate distances are the same across all targets
 *         pred_dist_indices = np.arange(len(sentence)) - predicate
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                              0, mode='clip')
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_pred_dist_values = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":460
 *                                                              0, mode='clip')
 * 
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup             # <<<<<<<<<<<<<<
 * 
 *         for target in range(self.num_targets):
 */
  __pyx_t_7 = PyNumber_Add(__pyx_v_pred_dist_values, ((PyObject *)__pyx_v_self->convolution_lookup)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 460, __pyx_L1_error)
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
    __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_11 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_and_pred_dist_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_input_and_pred_dist_values.diminfo[0].strides = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[0].shape = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[1].strides = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[1].shape = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 460, __pyx_L1_error)
  }
  __pyx_t_10 = 0;
  __pyx_v_input_and_pred_dist_values = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":462
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 *             # loop over targets and add the weighted distance features to each token
 *             # this is necessary for the convolution layer
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7);
    __pyx_t_1 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 462, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_15(__pyx_t_7);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 462, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":470
 *             # if we are classifying arguments, pick the distance to the closest boundary
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:             # <<<<<<<<<<<<<<
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
 */
    __pyx_t_2 = (__pyx_v_argument_blocks == Py_None);
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":471
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:
 *                 target_dist_indices = np.arange(len(sentence)) - target             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = argument_blocks[target]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 471, __pyx_L1_error)
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_v_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dist_indices, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":470
 *             # if we are classifying arguments, pick the distance to the closest boundary
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:             # <<<<<<<<<<<<<<
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
 */
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":473
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
 *                 argument = argument_blocks[target]             # <<<<<<<<<<<<<<
 *                 #print(argument_blocks)
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":475
 *                 argument = argument_blocks[target]
 *                 #print(argument_blocks)
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)             # <<<<<<<<<<<<<<
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 475, __pyx_L1_error)
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 475, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, __pyx_t_6, __pyx_v_argument)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dist_indices, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":477
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                                      0, mode='clip')
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->target_convolution_lookup), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Add(__pyx_v_target_dist_indices, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(1, 477, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0)) __PYX_ERR(1, 477, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":478
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,
 *                                                                      0, mode='clip')             # <<<<<<<<<<<<<<
 * 
 *             convolution_values = target_dist_values + input_and_pred_dist_values
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_clip) < 0) __PYX_ERR(1, 478, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":477
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                                      0, mode='clip')
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_target_dist_values, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":480
 *                                                                      0, mode='clip')
 * 
 *             convolution_values = target_dist_values + input_and_pred_dist_values             # <<<<<<<<<<<<<<
 * 
 *             # now, find the maximum values
 */
    __pyx_t_8 = PyNumber_Add(__pyx_v_target_dist_values, ((PyObject *)__pyx_v_input_and_pred_dist_values)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 480, __pyx_L1_error)
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_convolution_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
        __pyx_t_14 = __pyx_t_13 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_convolution_values.diminfo[0].strides = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_convolution_values.diminfo[0].shape = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_convolution_values.diminfo[1].strides = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_convolution_values.diminfo[1].shape = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 480, __pyx_L1_error)
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF_SET(__pyx_v_convolution_values, ((PyArrayObject *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":483
 * 
 *             # now, find the maximum values
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 483, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":484
 *             # now, find the maximum values
 *             if training:
 *                 self.max_indices[target] = convolution_values.argmax(0)             # <<<<<<<<<<<<<<
 *             self.hidden_values[target] = convolution_values.max(0)
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_convolution_values), __pyx_n_s_argmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_0};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->max_indices), __pyx_v_target, __pyx_t_8) < 0))) __PYX_ERR(1, 484, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":483
 * 
 *             # now, find the maximum values
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":485
 *             if training:
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)             # <<<<<<<<<<<<<<
 * 
 *         # apply the bias and proceed to the next layer
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_convolution_values), __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_0};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 485, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), __pyx_v_target, __pyx_t_8) < 0))) __PYX_ERR(1, 485, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":462
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 *             # loop over targets and add the weighted distance features to each token
 *             # this is necessary for the convolution layer
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":488
 * 
 *         # apply the bias and proceed to the next layer
 *         self.hidden_values += self.hidden_bias             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
 */
  __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 488, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":490
 *         self.hidden_values += self.hidden_bias
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":491
 * 
 *         if self.hidden2_weights is not None:
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias             # <<<<<<<<<<<<<<
 * 
 *             if training:
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), __pyx_n_s_dot); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_weights), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_v_self->hidden2_bias)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_8);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_v_self->hidden2_values = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":493
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 493, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":494
 * 
 *             if training:
 *                 self.hidden2_before_activation = self.hidden2_values.copy()             # <<<<<<<<<<<<<<
 * 
 *             hardtanh(self.hidden2_values, inplace=True)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_values), __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 494, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_before_activation);
      __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_before_activation);
      __pyx_v_self->hidden2_before_activation = ((PyArrayObject *)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":493
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":496
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
 *             hardtanh(self.hidden2_values, inplace=True)             # <<<<<<<<<<<<<<
 *         else:
 *             # apply non-linearity here
 */
    __pyx_t_8 = ((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.inplace = Py_True;
    __pyx_t_7 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_8), &__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":490
 *         self.hidden_values += self.hidden_bias
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 */
    goto __pyx_L9;
  }

  /* "nltkor/tag/libs/networkconv.pyx":499
 *         else:
 *             # apply non-linearity here
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 499, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":500
 *             # apply non-linearity here
 *             if training:
 *                 self.hidden_before_activation = self.hidden_values.copy()             # <<<<<<<<<<<<<<
 * 
 *             self.hidden2_values = self.hidden_values
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 500, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_before_activation);
      __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_before_activation);
      __pyx_v_self->hidden_before_activation = ((PyArrayObject *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":499
 *         else:
 *             # apply non-linearity here
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":502
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
 *             self.hidden2_values = self.hidden_values             # <<<<<<<<<<<<<<
 *             hardtanh(self.hidden_values, inplace=True)
 * 
 */
    __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_v_self->hidden2_values = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":503
 * 
 *             self.hidden2_values = self.hidden_values
 *             hardtanh(self.hidden_values, inplace=True)             # <<<<<<<<<<<<<<
 * 
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias
 */
    __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.inplace = Py_True;
    __pyx_t_8 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_7), &__pyx_t_17); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_L9:;

  /* "nltkor/tag/libs/networkconv.pyx":505
 *             hardtanh(self.hidden_values, inplace=True)
 * 
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias             # <<<<<<<<<<<<<<
 * 
 *         return scores
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_values), __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.output_weights), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_v_self->__pyx_base.output_bias)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 505, __pyx_L1_error)
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
    __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_11 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 505, __pyx_L1_error)
  }
  __pyx_t_18 = 0;
  __pyx_v_scores = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":507
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias
 * 
 *         return scores             # <<<<<<<<<<<<<<
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_scores);
  __pyx_r = ((PyObject *)__pyx_v_scores);
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._sentence_convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_convolution_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_and_pred_dist_values);
  __Pyx_XDECREF(__pyx_v_pred_dist_indices);
  __Pyx_XDECREF(__pyx_v_pred_dist_values);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_target_dist_indices);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_target_dist_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup, "ConvolutionalNetwork._pre_tagging_setup(self, ndarray sentence, bool training)\n\n        Perform some initialization actions before the actual tagging.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup = {"_pre_tagging_setup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyBoolObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_pre_tagging_setup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_training,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 509, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_training)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 509, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_pre_tagging_setup", 1, 2, 2, 1); __PYX_ERR(1, 509, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_pre_tagging_setup") < 0)) __PYX_ERR(1, 509, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_training = ((PyBoolObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_pre_tagging_setup", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 509, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._pre_tagging_setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 509, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_training), __pyx_ptype_7cpython_4bool_bool, 1, "training", 0))) __PYX_ERR(1, 509, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_training);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyBoolObject *__pyx_v_training) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__46)
  __Pyx_RefNannySetupContext("_pre_tagging_setup", 1);
  __Pyx_TraceCall("_pre_tagging_setup", __pyx_f[1], 509, 0, __PYX_ERR(1, 509, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":513
 *         Perform some initialization actions before the actual tagging.
 *         """
 *         if training:             # <<<<<<<<<<<<<<
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_training)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 513, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":516
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))             # <<<<<<<<<<<<<<
 * 
 *         # store the convolution values to save time
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 516, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(1, 516, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
    __pyx_v_self->__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":513
 *         Perform some initialization actions before the actual tagging.
 *         """
 *         if training:             # <<<<<<<<<<<<<<
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":519
 * 
 *         # store the convolution values to save time
 *         self._create_convolution_lookup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_convolution_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, ((PyObject *)__pyx_v_sentence), ((PyObject *)__pyx_v_training)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":521
 *         self._create_convolution_lookup(sentence, training)
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()             # <<<<<<<<<<<<<<
 *         if self.pred_dist_lookup is None: self._create_pred_lookup()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->target_dist_lookup) == Py_None);
  if (__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_target_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":522
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()
 *         if self.pred_dist_lookup is None: self._create_pred_lookup()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->pred_dist_lookup) == Py_None);
  if (__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_pred_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._pre_tagging_setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence, "ConvolutionalNetwork._tag_sentence(self, ndarray sentence, ndarray predicates, list tags=None, list argument_blocks=None, bool allow_repeats=True, bool logprob=False)\n\n        Runs the network for every predicate in the sentence.\n        Refer to the Network class for more information.\n        \n        :param tags: this is a list rather than a numpy array because in\n            argument classification, each predicate may have a differente number\n            of arguments.\n        :param argument_blocks: (used only in SRL argument classification) a list\n            with the starting and end positions of all delimited arguments (one for \n            each predicate)\n        :param predicates: a numpy array with the indices of the predicates in the sentence.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence = {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_argument_blocks = 0;
  PyBoolObject *__pyx_v_allow_repeats = 0;
  PyBoolObject *__pyx_v_logprob = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicates,&__pyx_n_s_tags,&__pyx_n_s_argument_blocks,&__pyx_n_s_allow_repeats,&__pyx_n_s_logprob,0};

    /* "nltkor/tag/libs/networkconv.pyx":528
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,             # <<<<<<<<<<<<<<
 *                       bool allow_repeats=True, bool logprob=False):
 *         """
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "nltkor/tag/libs/networkconv.pyx":529
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,
 *                       bool allow_repeats=True, bool logprob=False):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for every predicate in the sentence.
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyBoolObject *)Py_True));
    values[5] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyBoolObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 2, 6, 1); __PYX_ERR(1, 525, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_argument_blocks);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allow_repeats);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_logprob);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 525, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_tag_sentence") < 0)) __PYX_ERR(1, 525, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicates = ((PyArrayObject *)values[1]);
    __pyx_v_tags = ((PyObject*)values[2]);
    __pyx_v_argument_blocks = ((PyObject*)values[3]);
    __pyx_v_allow_repeats = ((PyBoolObject *)values[4]);
    __pyx_v_logprob = ((PyBoolObject *)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 2, 6, __pyx_nargs); __PYX_ERR(1, 525, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 527, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), __pyx_ptype_5numpy_ndarray, 1, "predicates", 0))) __PYX_ERR(1, 527, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(1, 528, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_argument_blocks), (&PyList_Type), 1, "argument_blocks", 1))) __PYX_ERR(1, 528, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 529, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_logprob), __pyx_ptype_7cpython_4bool_bool, 1, "logprob", 0))) __PYX_ERR(1, 529, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_tags, __pyx_v_argument_blocks, __pyx_v_allow_repeats, __pyx_v_logprob);

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_argument_blocks, PyBoolObject *__pyx_v_allow_repeats, PyBoolObject *__pyx_v_logprob) {
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_training = NULL;
  PyArrayObject *__pyx_v_token_scores = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_predicate = NULL;
  PyObject *__pyx_v_pred_arguments = NULL;
  PyObject *__pyx_v_pred_answer = NULL;
  PyObject *__pyx_v_pred_tags = NULL;
  PyObject *__pyx_v_all_scores = NULL;
  Py_ssize_t __pyx_v_last_token;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_confidence = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_token_scores;
  __Pyx_Buffer __pyx_pybuffer_token_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__47)
  __Pyx_RefNannySetupContext("_tag_sentence", 1);
  __Pyx_TraceCall("_tag_sentence", __pyx_f[1], 525, 0, __PYX_ERR(1, 525, __pyx_L1_error));
  __pyx_pybuffer_token_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_token_scores.refcount = 0;
  __pyx_pybuffernd_token_scores.data = NULL;
  __pyx_pybuffernd_token_scores.rcbuffer = &__pyx_pybuffer_token_scores;

  /* "nltkor/tag/libs/networkconv.pyx":542
 *         :param predicates: a numpy array with the indices of the predicates in the sentence.
 *         """
 *         answer = []             # <<<<<<<<<<<<<<
 *         training = tags is not None
 *         self._pre_tagging_setup(sentence, training)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_answer = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":543
 *         """
 *         answer = []
 *         training = tags is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 */
  __pyx_t_2 = (__pyx_v_tags != ((PyObject*)Py_None));
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_training = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":544
 *         answer = []
 *         training = tags is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pre_tagging_setup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":547
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
 *         for i, predicate in enumerate(predicates):             # <<<<<<<<<<<<<<
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_predicates))) || PyTuple_CheckExact(((PyObject *)__pyx_v_predicates))) {
    __pyx_t_3 = ((PyObject *)__pyx_v_predicates); __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_predicates)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 547, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 547, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_predicate, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":548
 * 
 *         for i, predicate in enumerate(predicates):
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]             # <<<<<<<<<<<<<<
 *             pred_arguments = argument_blocks[i]
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 548, __pyx_L1_error)
    __pyx_t_8 = (!__pyx_t_2);
    if (__pyx_t_8) {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    } else {
      if (unlikely(__pyx_v_argument_blocks == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 548, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_pred_arguments, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":549
 *         for i, predicate in enumerate(predicates):
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]             # <<<<<<<<<<<<<<
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)
 */
    if (unlikely(__pyx_v_argument_blocks == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 549, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_pred_arguments, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":551
 *             pred_arguments = argument_blocks[i]
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)             # <<<<<<<<<<<<<<
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sentence_convolution); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_10, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate, __pyx_v_pred_arguments, __pyx_v_training};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 551, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 551, __pyx_L1_error)
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_token_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        }
        __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
      }
      __pyx_pybuffernd_token_scores.diminfo[0].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_token_scores.diminfo[0].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_token_scores.diminfo[1].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_token_scores.diminfo[1].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 551, __pyx_L1_error)
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_token_scores, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":552
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)
 *             pred_answer = self._viterbi(token_scores, allow_repeats)             # <<<<<<<<<<<<<<
 * 
 *             if training:
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_viterbi); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_token_scores), ((PyObject *)__pyx_v_allow_repeats)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_pred_answer, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":554
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 554, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":555
 * 
 *             if training:
 *                 pred_tags = tags[i]             # <<<<<<<<<<<<<<
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()
 */
      if (unlikely(__pyx_v_tags == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 555, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_tags, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_pred_tags, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":556
 *             if training:
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_pred_tags, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 556, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {

        /* "nltkor/tag/libs/networkconv.pyx":557
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backpropagate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":558
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(predicate, pred_arguments)
 *                     self._adjust_features(sentence, predicate)
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_input_deltas); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_10, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate, __pyx_v_pred_arguments};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":559
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, predicate)
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_weights); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_predicate, __pyx_v_pred_arguments};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":560
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)
 *                     self._adjust_features(sentence, predicate)             # <<<<<<<<<<<<<<
 * 
 *             if logprob:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_features); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 560, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 560, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":556
 *             if training:
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 */
      }

      /* "nltkor/tag/libs/networkconv.pyx":554
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":562
 *                     self._adjust_features(sentence, predicate)
 * 
 *             if logprob:             # <<<<<<<<<<<<<<
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_logprob)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 562, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":563
 * 
 *             if logprob:
 *                 if self.only_classify:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 563, __pyx_L1_error)
      if (unlikely(__pyx_t_8)) {

        /* "nltkor/tag/libs/networkconv.pyx":564
 *             if logprob:
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')             # <<<<<<<<<<<<<<
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 564, __pyx_L1_error)

        /* "nltkor/tag/libs/networkconv.pyx":563
 * 
 *             if logprob:
 *                 if self.only_classify:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
 */
      }

      /* "nltkor/tag/libs/networkconv.pyx":566
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)             # <<<<<<<<<<<<<<
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_all_scores); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_all_scores, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":567
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)
 *                 last_token = len(sentence) - 1             # <<<<<<<<<<<<<<
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd
 */
      __pyx_t_16 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
      __pyx_v_last_token = (__pyx_t_16 - 1);

      /* "nltkor/tag/libs/networkconv.pyx":568
 *                 all_scores = self._calculate_all_scores(token_scores)
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))             # <<<<<<<<<<<<<<
 *                 confidence = self.answer_score - logadd
 *                 pred_answer = (pred_answer, confidence)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_sum); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_exp); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_all_scores, __pyx_v_last_token, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_21 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_21)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_21);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_19};
        __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
      __pyx_t_20 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_18))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_18);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_18, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_17};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      }
      __pyx_t_18 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_9};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":569
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd             # <<<<<<<<<<<<<<
 *                 pred_answer = (pred_answer, confidence)
 * 
 */
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.answer_score); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = PyNumber_Subtract(__pyx_t_4, __pyx_v_logadd); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_confidence, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":570
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd
 *                 pred_answer = (pred_answer, confidence)             # <<<<<<<<<<<<<<
 * 
 *             answer.append(pred_answer)
 */
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_pred_answer);
      __Pyx_GIVEREF(__pyx_v_pred_answer);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_pred_answer)) __PYX_ERR(1, 570, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_confidence);
      __Pyx_GIVEREF(__pyx_v_confidence);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_confidence)) __PYX_ERR(1, 570, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_pred_answer, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":562
 *                     self._adjust_features(sentence, predicate)
 * 
 *             if logprob:             # <<<<<<<<<<<<<<
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":572
 *                 pred_answer = (pred_answer, confidence)
 * 
 *             answer.append(pred_answer)             # <<<<<<<<<<<<<<
 * 
 *         return answer
 */
    __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_answer, __pyx_v_pred_answer); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(1, 572, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":547
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
 *         for i, predicate in enumerate(predicates):             # <<<<<<<<<<<<<<
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":574
 *             answer.append(pred_answer)
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF((PyObject *)__pyx_v_token_scores);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_predicate);
  __Pyx_XDECREF(__pyx_v_pred_arguments);
  __Pyx_XDECREF(__pyx_v_pred_answer);
  __Pyx_XDECREF(__pyx_v_pred_tags);
  __Pyx_XDECREF(__pyx_v_all_scores);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_confidence);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate, "ConvolutionalNetwork._validate(self)\n\n        Evaluates the network performance, updating its hits count.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate = {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_validate", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_items = NULL;
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_i_args = NULL;
  PyObject *__pyx_v_sent_args = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_preds = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_predicate_answer = NULL;
  PyObject *__pyx_v_predicate_tags = NULL;
  PyObject *__pyx_v_net_tag = NULL;
  PyObject *__pyx_v_gold_tag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  unsigned int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  float __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__49)
  __Pyx_RefNannySetupContext("_validate", 1);
  __Pyx_TraceCall("_validate", __pyx_f[1], 576, 0, __PYX_ERR(1, 576, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":582
 *         # call it "item" instead of token because the same token may be counted
 *         # more than once (sentences with multiple predicates)
 *         num_items = 0             # <<<<<<<<<<<<<<
 *         hits = 0
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_num_items = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":583
 *         # more than once (sentences with multiple predicates)
 *         num_items = 0
 *         hits = 0             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_arguments is not None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_hits = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":585
 *         hits = 0
 * 
 *         if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(self.validation_arguments)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":586
 * 
 *         if self.validation_arguments is not None:
 *             i_args = iter(self.validation_arguments)             # <<<<<<<<<<<<<<
 *         else:
 *             sent_args = None
 */
    __pyx_t_2 = __pyx_v_self->validation_arguments;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i_args = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":585
 *         hits = 0
 * 
 *         if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(self.validation_arguments)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":588
 *             i_args = iter(self.validation_arguments)
 *         else:
 *             sent_args = None             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_sent_args = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":590
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,             # <<<<<<<<<<<<<<
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.validation_sentences)) __PYX_ERR(1, 590, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_predicates);
  __Pyx_GIVEREF(__pyx_v_self->validation_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->validation_predicates)) __PYX_ERR(1, 590, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->__pyx_base.validation_tags)) __PYX_ERR(1, 590, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 590, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 590, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(1, 590, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 590, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_preds, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":593
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
 */
    __pyx_t_1 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":594
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:
 *                 sent_args = next(i_args)             # <<<<<<<<<<<<<<
 *                 #sent_args = i_args.next()
 * 
 */
      if (unlikely(!__pyx_v_i_args)) { __Pyx_RaiseUnboundLocalError("i_args"); __PYX_ERR(1, 594, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_i_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_sent_args, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":593
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":597
 *                 #sent_args = i_args.next()
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)             # <<<<<<<<<<<<<<
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely(!__pyx_v_sent_args)) { __Pyx_RaiseUnboundLocalError("sent_args"); __PYX_ERR(1, 597, __pyx_L1_error) }
    __pyx_t_7 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_sent, __pyx_v_sent_preds, Py_None, __pyx_v_sent_args};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 4+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":598
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):             # <<<<<<<<<<<<<<
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_answer);
    __Pyx_GIVEREF(__pyx_v_answer);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_answer)) __PYX_ERR(1, 598, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_sent_tags);
    __Pyx_GIVEREF(__pyx_v_sent_tags);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sent_tags)) __PYX_ERR(1, 598, __pyx_L1_error);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 598, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_13(__pyx_t_2);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 598, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(1, 598, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
        index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(1, 598, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(1, 598, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_predicate_answer, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_predicate_tags, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":599
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):             # <<<<<<<<<<<<<<
 *                     if net_tag == gold_tag:
 *                         hits += 1
 */
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_predicate_answer);
      __Pyx_GIVEREF(__pyx_v_predicate_answer);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_predicate_answer)) __PYX_ERR(1, 599, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_predicate_tags);
      __Pyx_GIVEREF(__pyx_v_predicate_tags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_predicate_tags)) __PYX_ERR(1, 599, __pyx_L1_error);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_8 = __pyx_t_6; __Pyx_INCREF(__pyx_t_8);
        __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 599, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_15(__pyx_t_8);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(1, 599, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
          PyObject* sequence = __pyx_t_6;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 599, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_9);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
          index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_16); if (unlikely(!__pyx_t_7)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_16), 2) < 0) __PYX_ERR(1, 599, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L16_unpacking_done;
          __pyx_L15_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 599, __pyx_L1_error)
          __pyx_L16_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_net_tag, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_gold_tag, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":600
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:             # <<<<<<<<<<<<<<
 *                         hits += 1
 * 
 */
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_v_gold_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_1) {

          /* "nltkor/tag/libs/networkconv.pyx":601
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
 *                         hits += 1             # <<<<<<<<<<<<<<
 * 
 *                 num_items += len(predicate_answer)
 */
          __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_hits, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "nltkor/tag/libs/networkconv.pyx":600
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:             # <<<<<<<<<<<<<<
 *                         hits += 1
 * 
 */
        }

        /* "nltkor/tag/libs/networkconv.pyx":599
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):             # <<<<<<<<<<<<<<
 *                     if net_tag == gold_tag:
 *                         hits += 1
 */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":603
 *                         hits += 1
 * 
 *                 num_items += len(predicate_answer)             # <<<<<<<<<<<<<<
 * 
 *         self.accuracy = float(hits) / num_items
 */
      __pyx_t_14 = PyObject_Length(__pyx_v_predicate_answer); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(1, 603, __pyx_L1_error)
      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_num_items, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_num_items, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":598
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):             # <<<<<<<<<<<<<<
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":590
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,             # <<<<<<<<<<<<<<
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":605
 *                 num_items += len(predicate_answer)
 * 
 *         self.accuracy = float(hits) / num_items             # <<<<<<<<<<<<<<
 *         # normalize error
 *         self.error /= num_items
 */
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_num_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_17 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base.accuracy = __pyx_t_17;

  /* "nltkor/tag/libs/networkconv.pyx":607
 *         self.accuracy = float(hits) / num_items
 *         # normalize error
 *         self.error /= num_items             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients(self, tags, scores):
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_v_num_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_17 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base.error = __pyx_t_17;

  /* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_items);
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_i_args);
  __Pyx_XDECREF(__pyx_v_sent_args);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_preds);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_predicate_answer);
  __Pyx_XDECREF(__pyx_v_predicate_tags);
  __Pyx_XDECREF(__pyx_v_net_tag);
  __Pyx_XDECREF(__pyx_v_gold_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients, "ConvolutionalNetwork._calculate_gradients(self, tags, scores)\nDelegates the call to the appropriate function.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients = {"_calculate_gradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tags,&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 609, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 609, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, 1); __PYX_ERR(1, 609, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_gradients") < 0)) __PYX_ERR(1, 609, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__50)
  __Pyx_RefNannySetupContext("_calculate_gradients", 1);
  __Pyx_TraceCall("_calculate_gradients", __pyx_f[1], 609, 0, __PYX_ERR(1, 609, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":611
 *     def _calculate_gradients(self, tags, scores):
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:             # <<<<<<<<<<<<<<
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 611, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":612
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 *             return self._calculate_gradients_classify(tags, scores)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._calculate_gradients_sll(tags, scores)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients_classify); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_tags, __pyx_v_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkconv.pyx":611
 *     def _calculate_gradients(self, tags, scores):
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:             # <<<<<<<<<<<<<<
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":614
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
 *             return self._calculate_gradients_sll(tags, scores)             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients_classify(self, tags, scores):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients_sll); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_tags, __pyx_v_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify, "ConvolutionalNetwork._calculate_gradients_classify(self, tags, scores)\n\n        Calculates the output deltas for each target in a network that only \n        classifies predelimited arguments.\n        The aim is to minimize the cost, for each argument:\n        logadd(score for all possible tags) - score(correct tag)\n        \n        :returns: whether a correction is necessary or not.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify = {"_calculate_gradients_classify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_classify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tags,&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tags)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 616, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 616, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_gradients_classify", 1, 2, 2, 1); __PYX_ERR(1, 616, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_gradients_classify") < 0)) __PYX_ERR(1, 616, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_classify", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 616, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients_classify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  int __pyx_v_correction;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_tag_scores = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_exponentials = NULL;
  PyObject *__pyx_v_exp_sum = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  float __pyx_t_9;
  int __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__51)
  __Pyx_RefNannySetupContext("_calculate_gradients_classify", 1);
  __Pyx_TraceCall("_calculate_gradients_classify", __pyx_f[1], 616, 0, __PYX_ERR(1, 616, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":625
 *         :returns: whether a correction is necessary or not.
 *         """
 *         self.net_gradients = np.zeros_like(scores, float)             # <<<<<<<<<<<<<<
 *         #self.net_gradients = np.zeros_like(scores, np.float)
 *         correction = False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_scores, ((PyObject *)(&PyFloat_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":627
 *         self.net_gradients = np.zeros_like(scores, float)
 *         #self.net_gradients = np.zeros_like(scores, np.float)
 *         correction = False             # <<<<<<<<<<<<<<
 * 
 *         for i, tag_scores in enumerate(scores):
 */
  __pyx_v_correction = 0;

  /* "nltkor/tag/libs/networkconv.pyx":629
 *         correction = False
 * 
 *         for i, tag_scores in enumerate(scores):             # <<<<<<<<<<<<<<
 *             tag = tags[i]
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_scores)) || PyTuple_CheckExact(__pyx_v_scores)) {
    __pyx_t_3 = __pyx_v_scores; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_scores); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 629, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 629, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_tag_scores, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":630
 * 
 *         for i, tag_scores in enumerate(scores):
 *             tag = tags[i]             # <<<<<<<<<<<<<<
 * 
 *             exponentials = np.exp(tag_scores)
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_tags, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":632
 *             tag = tags[i]
 * 
 *             exponentials = np.exp(tag_scores)             # <<<<<<<<<<<<<<
 *             exp_sum = np.sum(exponentials)
 *             logadd = np.log(exp_sum)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_tag_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_exponentials, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":633
 * 
 *             exponentials = np.exp(tag_scores)
 *             exp_sum = np.sum(exponentials)             # <<<<<<<<<<<<<<
 *             logadd = np.log(exp_sum)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_exponentials};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_exp_sum, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":634
 *             exponentials = np.exp(tag_scores)
 *             exp_sum = np.sum(exponentials)
 *             logadd = np.log(exp_sum)             # <<<<<<<<<<<<<<
 * 
 *             # update the total error
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_log); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_exp_sum};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":637
 * 
 *             # update the total error
 *             error = logadd - tag_scores[tag]             # <<<<<<<<<<<<<<
 *             self.error += error
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_tag_scores, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyNumber_Subtract(__pyx_v_logadd, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":638
 *             # update the total error
 *             error = logadd - tag_scores[tag]
 *             self.error += error             # <<<<<<<<<<<<<<
 * 
 *             # like the non-convolutional network, don't adjust weights if the error
 */
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_v_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->__pyx_base.error = __pyx_t_9;

    /* "nltkor/tag/libs/networkconv.pyx":643
 *             # is too low. An error of 0.01 means a log-prob of -0.01 for the right
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:             # <<<<<<<<<<<<<<
 *                 self.skips += 1
 *                 continue
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_error, __pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "nltkor/tag/libs/networkconv.pyx":644
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:
 *                 self.skips += 1             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_v_self->__pyx_base.skips = (__pyx_v_self->__pyx_base.skips + 1);

      /* "nltkor/tag/libs/networkconv.pyx":645
 *             if error <= 0.01:
 *                 self.skips += 1
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             correction = True
 */
      goto __pyx_L3_continue;

      /* "nltkor/tag/libs/networkconv.pyx":643
 *             # is too low. An error of 0.01 means a log-prob of -0.01 for the right
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:             # <<<<<<<<<<<<<<
 *                 self.skips += 1
 *                 continue
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":647
 *                 continue
 * 
 *             correction = True             # <<<<<<<<<<<<<<
 *             self.net_gradients[i] = - exponentials / exp_sum
 *             self.net_gradients[i, tag] += 1
 */
    __pyx_v_correction = 1;

    /* "nltkor/tag/libs/networkconv.pyx":648
 * 
 *             correction = True
 *             self.net_gradients[i] = - exponentials / exp_sum             # <<<<<<<<<<<<<<
 *             self.net_gradients[i, tag] += 1
 * 
 */
    __pyx_t_2 = PyNumber_Negative(__pyx_v_exponentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_exp_sum); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_v_i, __pyx_t_8) < 0))) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":649
 *             correction = True
 *             self.net_gradients[i] = - exponentials / exp_sum
 *             self.net_gradients[i, tag] += 1             # <<<<<<<<<<<<<<
 * 
 *         return correction
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
    __pyx_t_11 = __pyx_v_self->__pyx_base.net_gradients;
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_i)) __PYX_ERR(1, 649, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_GIVEREF(__pyx_v_tag);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_tag)) __PYX_ERR(1, 649, __pyx_L1_error);
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_11), __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_11), __pyx_t_8, __pyx_t_7) < 0))) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_11); __pyx_t_11 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":629
 *         correction = False
 * 
 *         for i, tag_scores in enumerate(scores):             # <<<<<<<<<<<<<<
 *             tag = tags[i]
 * 
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":651
 *             self.net_gradients[i, tag] += 1
 * 
 *         return correction             # <<<<<<<<<<<<<<
 * 
 *     def _backpropagate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_correction); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF((PyObject *)__pyx_t_11);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients_classify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_tag_scores);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_exponentials);
  __Pyx_XDECREF(__pyx_v_exp_sum);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate, "ConvolutionalNetwork._backpropagate(self)\nBackpropagates the error gradient.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate = {"_backpropagate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_backpropagate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_backpropagate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_backpropagate", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_dCd_tanh = NULL;
  PyObject *__pyx_v_dCd_hidden2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__52)
  __Pyx_RefNannySetupContext("_backpropagate", 1);
  __Pyx_TraceCall("_backpropagate", __pyx_f[1], 653, 0, __PYX_ERR(1, 653, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":663
 * 
 *         # derivative with respect to the non-linearity layer (tanh)
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->__pyx_base.output_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_dCd_tanh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":665
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_5) {

    /* "nltkor/tag/libs/networkconv.pyx":667
 *         if self.hidden2_weights is not None:
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)             # <<<<<<<<<<<<<<
 *             self.hidden2_gradients = dCd_hidden2
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden2_before_activation);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_dCd_tanh, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_dCd_hidden2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":668
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
 *             self.hidden2_gradients = dCd_hidden2             # <<<<<<<<<<<<<<
 * 
 *             self.hidden_gradients = self.hidden2_gradients.dot(self.hidden2_weights)
 */
    if (!(likely(((__pyx_v_dCd_hidden2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dCd_hidden2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 668, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_dCd_hidden2;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_gradients);
    __pyx_v_self->hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":670
 *             self.hidden2_gradients = dCd_hidden2
 * 
 *             self.hidden_gradients = self.hidden2_gradients.dot(self.hidden2_weights)             # <<<<<<<<<<<<<<
 *         else:
 *             # the non-linearity appears right after the convolution max
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->hidden2_weights)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_gradients);
    __pyx_v_self->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":665
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":673
 *         else:
 *             # the non-linearity appears right after the convolution max
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden_before_activation);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_dCd_tanh, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_gradients);
    __pyx_v_self->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dCd_tanh);
  __Pyx_XDECREF(__pyx_v_dCd_hidden2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights, "ConvolutionalNetwork._adjust_weights(self, predicate, arguments=None)\n\n        Adjusts the network weights after gradients have been calculated.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights = {"_adjust_weights", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_adjust_weights (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_arguments,0};

    /* "nltkor/tag/libs/networkconv.pyx":677
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Adjusts the network weights after gradients have been calculated.
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicate)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 675, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 675, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_adjust_weights") < 0)) __PYX_ERR(1, 675, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_predicate = values[0];
    __pyx_v_arguments = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_adjust_weights", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 675, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_predicate, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_arguments) {
  int __pyx_v_i;
  PyArrayObject *__pyx_v_gradients_t = 0;
  PyArrayObject *__pyx_v_last_values = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  PyArrayObject *__pyx_v_grad_matrix = 0;
  PyArrayObject *__pyx_v_input_values = 0;
  PyObject *__pyx_v_neuron_maxes = NULL;
  PyObject *__pyx_v_target_dists = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_dist_features = NULL;
  PyObject *__pyx_v_pred_dists = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas;
  __Pyx_Buffer __pyx_pybuffer_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_grad_matrix;
  __Pyx_Buffer __pyx_pybuffer_grad_matrix;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_gradients_t;
  __Pyx_Buffer __pyx_pybuffer_gradients_t;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_values;
  __Pyx_Buffer __pyx_pybuffer_input_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
  __Pyx_Buffer __pyx_pybuffer_last_values;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  PyArrayObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  npy_intp *__pyx_t_17;
  npy_intp *__pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__53)
  __Pyx_RefNannySetupContext("_adjust_weights", 1);
  __Pyx_TraceCall("_adjust_weights", __pyx_f[1], 675, 0, __PYX_ERR(1, 675, __pyx_L1_error));
  __pyx_pybuffer_gradients_t.pybuffer.buf = NULL;
  __pyx_pybuffer_gradients_t.refcount = 0;
  __pyx_pybuffernd_gradients_t.data = NULL;
  __pyx_pybuffernd_gradients_t.rcbuffer = &__pyx_pybuffer_gradients_t;
  __pyx_pybuffer_last_values.pybuffer.buf = NULL;
  __pyx_pybuffer_last_values.refcount = 0;
  __pyx_pybuffernd_last_values.data = NULL;
  __pyx_pybuffernd_last_values.rcbuffer = &__pyx_pybuffer_last_values;
  __pyx_pybuffer_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_deltas.refcount = 0;
  __pyx_pybuffernd_deltas.data = NULL;
  __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas;
  __pyx_pybuffer_grad_matrix.pybuffer.buf = NULL;
  __pyx_pybuffer_grad_matrix.refcount = 0;
  __pyx_pybuffernd_grad_matrix.data = NULL;
  __pyx_pybuffernd_grad_matrix.rcbuffer = &__pyx_pybuffer_grad_matrix;
  __pyx_pybuffer_input_values.pybuffer.buf = NULL;
  __pyx_pybuffer_input_values.refcount = 0;
  __pyx_pybuffernd_input_values.data = NULL;
  __pyx_pybuffernd_input_values.rcbuffer = &__pyx_pybuffer_input_values;

  /* "nltkor/tag/libs/networkconv.pyx":685
 *         cdef np.ndarray[FLOAT_t, ndim=2] last_values, deltas, grad_matrix, input_values
 * 
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values             # <<<<<<<<<<<<<<
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden2_values);
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  }
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_last_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }
      __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
    }
    __pyx_pybuffernd_last_values.diminfo[0].strides = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_last_values.diminfo[0].shape = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_last_values.diminfo[1].strides = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_last_values.diminfo[1].shape = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 685, __pyx_L1_error)
  }
  __pyx_v_last_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":686
 * 
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.output_weights += deltas
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_last_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 686, __pyx_L1_error)
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      }
      __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
    }
    __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_deltas.diminfo[1].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_deltas.diminfo[1].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 686, __pyx_L1_error)
  }
  __pyx_t_10 = 0;
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":687
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas             # <<<<<<<<<<<<<<
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
 */
  __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.output_weights), ((PyObject *)__pyx_v_deltas)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 687, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __pyx_v_self->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":688
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_n_s_sum); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_int_0};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.output_bias), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __pyx_v_self->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":690
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":691
 * 
 *         if self.hidden2_weights is not None:
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate             # <<<<<<<<<<<<<<
 *             self.hidden2_weights += deltas
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_gradients), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->__pyx_base.hidden_values)};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 691, __pyx_L1_error)
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_deltas.diminfo[1].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_deltas.diminfo[1].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 691, __pyx_L1_error)
    }
    __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":692
 *         if self.hidden2_weights is not None:
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas             # <<<<<<<<<<<<<<
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate
 * 
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden2_weights), ((PyObject *)__pyx_v_deltas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 692, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":693
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         # now adjust weights from input to convolution. these will be trickier.
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_gradients), __pyx_n_s_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden2_bias), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
    __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":690
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":700
 *         # I tried vectorizing this loop but it got a bit slower, probably because
 *         # of the overhead in building matrices/tensors with the max indices
 *         for i, neuron_maxes in enumerate(self.max_indices):             # <<<<<<<<<<<<<<
 *             # i indicates the i-th target
 * 
 */
  __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self->max_indices))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self->max_indices))) {
    __pyx_t_7 = ((PyObject *)__pyx_v_self->max_indices); __Pyx_INCREF(__pyx_t_7);
    __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(((PyObject *)__pyx_v_self->max_indices)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 700, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_12(__pyx_t_7);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 700, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_neuron_maxes, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = (__pyx_t_3 + 1);

    /* "nltkor/tag/libs/networkconv.pyx":703
 *             # i indicates the i-th target
 * 
 *             gradients_t = self.hidden_gradients[i] * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *             # table containing in each line the input values selected for each convolution neuron
 */
    __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->hidden_gradients), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 703, __pyx_L1_error)
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_gradients_t, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
        __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
      }
      __pyx_pybuffernd_gradients_t.diminfo[0].strides = __pyx_pybuffernd_gradients_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gradients_t.diminfo[0].shape = __pyx_pybuffernd_gradients_t.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 703, __pyx_L1_error)
    }
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_gradients_t, ((PyArrayObject *)__pyx_t_13));
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":706
 * 
 *             # table containing in each line the input values selected for each convolution neuron
 *             input_values = self.input_sent_values.take(neuron_maxes, 0)             # <<<<<<<<<<<<<<
 * 
 *             # stack the gradients to multiply all weights for a neuron
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.input_sent_values), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_neuron_maxes, __pyx_int_0};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 706, __pyx_L1_error)
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_13);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_input_values.diminfo[0].strides = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_values.diminfo[0].shape = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_values.diminfo[1].strides = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_values.diminfo[1].shape = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 706, __pyx_L1_error)
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_input_values, ((PyArrayObject *)__pyx_t_13));
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":709
 * 
 *             # stack the gradients to multiply all weights for a neuron
 *             grad_matrix = np.tile(gradients_t, [self.input_size, 1]).T             # <<<<<<<<<<<<<<
 *             self.hidden_weights += grad_matrix * input_values
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tile); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_int_1)) __PYX_ERR(1, 709, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_gradients_t), __pyx_t_16};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_T); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 709, __pyx_L1_error)
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
        __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
      }
      __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 709, __pyx_L1_error)
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":710
 *             # stack the gradients to multiply all weights for a neuron
 *             grad_matrix = np.tile(gradients_t, [self.input_size, 1]).T
 *             self.hidden_weights += grad_matrix * input_values             # <<<<<<<<<<<<<<
 * 
 *             # target distance weights
 */
    __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), ((PyObject *)__pyx_v_input_values)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_weights), __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_13);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
    __pyx_v_self->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_13);
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":714
 *             # target distance weights
 *             # get the relative distance from each max token to its target
 *             if arguments is None:             # <<<<<<<<<<<<<<
 *                 target_dists = neuron_maxes - i
 *             else:
 */
    __pyx_t_2 = (__pyx_v_arguments == Py_None);
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":715
 *             # get the relative distance from each max token to its target
 *             if arguments is None:
 *                 target_dists = neuron_maxes - i             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = arguments[i]
 */
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_8 = PyNumber_Subtract(__pyx_v_neuron_maxes, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dists, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":714
 *             # target distance weights
 *             # get the relative distance from each max token to its target
 *             if arguments is None:             # <<<<<<<<<<<<<<
 *                 target_dists = neuron_maxes - i
 *             else:
 */
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":717
 *                 target_dists = neuron_maxes - i
 *             else:
 *                 argument = arguments[i]             # <<<<<<<<<<<<<<
 *                 target_dists = self.argument_distances(neuron_maxes, argument)
 * 
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_arguments, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":718
 *             else:
 *                 argument = arguments[i]
 *                 target_dists = self.argument_distances(neuron_maxes, argument)             # <<<<<<<<<<<<<<
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,
 */
      __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, __pyx_v_neuron_maxes, __pyx_v_argument)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_target_dists, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":720
 *                 target_dists = self.argument_distances(neuron_maxes, argument)
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->target_dist_lookup), __pyx_n_s_take); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_16 = PyNumber_Add(__pyx_v_target_dists, __pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_16)) __PYX_ERR(1, 720, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_0)) __PYX_ERR(1, 720, __pyx_L1_error);
    __pyx_t_16 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":721
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,
 *                                                          0, mode='clip')             # <<<<<<<<<<<<<<
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
 *             self.target_dist_weights += (grad_matrix * dist_features).T
 */
    __pyx_t_16 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_mode, __pyx_n_u_clip) < 0) __PYX_ERR(1, 721, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":720
 *                 target_dists = self.argument_distances(neuron_maxes, argument)
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dist_features, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":722
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T             # <<<<<<<<<<<<<<
 *             self.target_dist_weights += (grad_matrix * dist_features).T
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_tile); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_16 = ((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_INCREF(__pyx_t_16);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_16)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_16 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_17[0])); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_16)) __PYX_ERR(1, 722, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_1)) __PYX_ERR(1, 722, __pyx_L1_error);
    __pyx_t_16 = 0;
    __pyx_t_16 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_16)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_16, ((PyObject *)__pyx_v_gradients_t), __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 722, __pyx_L1_error)
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_13);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 722, __pyx_L1_error)
    }
    __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_13));
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":723
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
 *             self.target_dist_weights += (grad_matrix * dist_features).T             # <<<<<<<<<<<<<<
 * 
 *             # predicate distance weights
 */
    __pyx_t_13 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), __pyx_v_dist_features); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->target_dist_weights), __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_13);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_weights);
    __pyx_v_self->target_dist_weights = ((PyArrayObject *)__pyx_t_13);
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":727
 *             # predicate distance weights
 *             # get the distance from each max token to its predicate
 *             pred_dists = neuron_maxes - predicate             # <<<<<<<<<<<<<<
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,
 *                                                        0, mode='clip')
 */
    __pyx_t_13 = PyNumber_Subtract(__pyx_v_neuron_maxes, __pyx_v_predicate); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_XDECREF_SET(__pyx_v_pred_dists, __pyx_t_13);
    __pyx_t_13 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":728
 *             # get the distance from each max token to its predicate
 *             pred_dists = neuron_maxes - predicate
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 */
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->pred_dist_lookup), __pyx_n_s_take); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyNumber_Add(__pyx_v_pred_dists, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(1, 728, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(1, 728, __pyx_L1_error);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":729
 *             pred_dists = neuron_maxes - predicate
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,
 *                                                        0, mode='clip')             # <<<<<<<<<<<<<<
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:
 */
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_n_u_clip) < 0) __PYX_ERR(1, 729, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":728
 *             # get the distance from each max token to its predicate
 *             pred_dists = neuron_maxes - predicate
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 */
    __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_features, __pyx_t_16);
    __pyx_t_16 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":731
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:             # <<<<<<<<<<<<<<
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
 */
    __pyx_t_16 = ((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_INCREF(__pyx_t_16);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_16)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_16 = ((PyObject *)__pyx_v_self->pred_dist_weights);
    __Pyx_INCREF(__pyx_t_16);
    __pyx_t_18 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_16)); if (unlikely(__pyx_t_18 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_2 = ((__pyx_t_17[0]) != (__pyx_t_18[0]));
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":732
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T             # <<<<<<<<<<<<<<
 * 
 *             self.pred_dist_weights += (grad_matrix * dist_features).T
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_tile); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = ((PyObject *)__pyx_v_self->pred_dist_weights);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_18 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_8)); if (unlikely(__pyx_t_18 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_18[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_8);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_8)) __PYX_ERR(1, 732, __pyx_L1_error);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_int_1)) __PYX_ERR(1, 732, __pyx_L1_error);
      __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, ((PyObject *)__pyx_v_gradients_t), __pyx_t_13};
        __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 732, __pyx_L1_error)
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
        __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_15 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
        if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 732, __pyx_L1_error)
      }
      __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":731
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:             # <<<<<<<<<<<<<<
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":734
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
 *             self.pred_dist_weights += (grad_matrix * dist_features).T             # <<<<<<<<<<<<<<
 * 
 *         self.hidden_bias += self.hidden_gradients.sum(0) * self.learning_rate
 */
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), __pyx_v_dist_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->pred_dist_weights), __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_weights);
    __pyx_v_self->pred_dist_weights = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":700
 *         # I tried vectorizing this loop but it got a bit slower, probably because
 *         # of the overhead in building matrices/tensors with the max indices
 *         for i, neuron_maxes in enumerate(self.max_indices):             # <<<<<<<<<<<<<<
 *             # i indicates the i-th target
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":736
 *             self.pred_dist_weights += (grad_matrix * dist_features).T
 * 
 *         self.hidden_bias += self.hidden_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden_gradients), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_16 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_int_0};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_16 = PyNumber_Multiply(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_bias), __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __pyx_v_self->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":739
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 */
  __pyx_t_19 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(1, 739, __pyx_L1_error)
  __pyx_t_20 = (!__pyx_t_19);
  if (__pyx_t_20) {
  } else {
    __pyx_t_2 = __pyx_t_20;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_20 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) != Py_None);
  __pyx_t_2 = __pyx_t_20;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":740
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:
 *             self.transitions += self.trans_gradients * self.learning_rate_trans             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = PyNumber_Multiply(((PyObject *)__pyx_v_self->__pyx_base.trans_gradients), __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.transitions), __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":739
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_gradients_t);
  __Pyx_XDECREF((PyObject *)__pyx_v_last_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF((PyObject *)__pyx_v_grad_matrix);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_values);
  __Pyx_XDECREF(__pyx_v_neuron_maxes);
  __Pyx_XDECREF(__pyx_v_target_dists);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_dist_features);
  __Pyx_XDECREF(__pyx_v_pred_dists);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas, "ConvolutionalNetwork._calculate_input_deltas(self, ndarray sentence, int predicate, arguments=None)\n\n        Calculates the input deltas to be applied in the feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas = {"_calculate_input_deltas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  int __pyx_v_predicate;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_input_deltas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicate,&__pyx_n_s_arguments,0};

    /* "nltkor/tag/libs/networkconv.pyx":745
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 *                                  object arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the input deltas to be applied in the feature tables.
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 742, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicate)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 742, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_input_deltas", 0, 2, 3, 1); __PYX_ERR(1, 742, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arguments);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 742, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_input_deltas") < 0)) __PYX_ERR(1, 742, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicate = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_predicate == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 744, __pyx_L3_error)
    __pyx_v_arguments = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_input_deltas", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_input_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 744, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, int __pyx_v_predicate, PyObject *__pyx_v_arguments) {
  PyArrayObject *__pyx_v_hidden_gradients = 0;
  PyArrayObject *__pyx_v_input_gradients = 0;
  PyArrayObject *__pyx_v_target_dist_gradients = 0;
  PyArrayObject *__pyx_v_pred_dist_gradients = 0;
  PyArrayObject *__pyx_v_gradients = 0;
  PyArrayObject *__pyx_v_convolution_max = 0;
  PyArrayObject *__pyx_v_target_dists = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_column_numbers = 0;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_pred_dists = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_column_numbers;
  __Pyx_Buffer __pyx_pybuffer_column_numbers;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_convolution_max;
  __Pyx_Buffer __pyx_pybuffer_convolution_max;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_gradients;
  __Pyx_Buffer __pyx_pybuffer_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_hidden_gradients;
  __Pyx_Buffer __pyx_pybuffer_hidden_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_gradients;
  __Pyx_Buffer __pyx_pybuffer_input_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pred_dist_gradients;
  __Pyx_Buffer __pyx_pybuffer_pred_dist_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_target_dist_gradients;
  __Pyx_Buffer __pyx_pybuffer_target_dist_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_target_dists;
  __Pyx_Buffer __pyx_pybuffer_target_dists;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  npy_intp *__pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyArrayObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyArrayObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__54)
  __Pyx_RefNannySetupContext("_calculate_input_deltas", 1);
  __Pyx_TraceCall("_calculate_input_deltas", __pyx_f[1], 742, 0, __PYX_ERR(1, 742, __pyx_L1_error));
  __pyx_pybuffer_hidden_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_hidden_gradients.refcount = 0;
  __pyx_pybuffernd_hidden_gradients.data = NULL;
  __pyx_pybuffernd_hidden_gradients.rcbuffer = &__pyx_pybuffer_hidden_gradients;
  __pyx_pybuffer_input_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_input_gradients.refcount = 0;
  __pyx_pybuffernd_input_gradients.data = NULL;
  __pyx_pybuffernd_input_gradients.rcbuffer = &__pyx_pybuffer_input_gradients;
  __pyx_pybuffer_target_dist_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_target_dist_gradients.refcount = 0;
  __pyx_pybuffernd_target_dist_gradients.data = NULL;
  __pyx_pybuffernd_target_dist_gradients.rcbuffer = &__pyx_pybuffer_target_dist_gradients;
  __pyx_pybuffer_pred_dist_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_pred_dist_gradients.refcount = 0;
  __pyx_pybuffernd_pred_dist_gradients.data = NULL;
  __pyx_pybuffernd_pred_dist_gradients.rcbuffer = &__pyx_pybuffer_pred_dist_gradients;
  __pyx_pybuffer_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_gradients.refcount = 0;
  __pyx_pybuffernd_gradients.data = NULL;
  __pyx_pybuffernd_gradients.rcbuffer = &__pyx_pybuffer_gradients;
  __pyx_pybuffer_convolution_max.pybuffer.buf = NULL;
  __pyx_pybuffer_convolution_max.refcount = 0;
  __pyx_pybuffernd_convolution_max.data = NULL;
  __pyx_pybuffernd_convolution_max.rcbuffer = &__pyx_pybuffer_convolution_max;
  __pyx_pybuffer_target_dists.pybuffer.buf = NULL;
  __pyx_pybuffer_target_dists.refcount = 0;
  __pyx_pybuffernd_target_dists.data = NULL;
  __pyx_pybuffernd_target_dists.rcbuffer = &__pyx_pybuffer_target_dists;
  __pyx_pybuffer_column_numbers.pybuffer.buf = NULL;
  __pyx_pybuffer_column_numbers.refcount = 0;
  __pyx_pybuffernd_column_numbers.data = NULL;
  __pyx_pybuffernd_column_numbers.rcbuffer = &__pyx_pybuffer_column_numbers;

  /* "nltkor/tag/libs/networkconv.pyx":756
 *         # matrices accumulating gradients over each target
 *         # each matrix has a whole window in each line
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 756, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(1, 756, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 756, __pyx_L1_error)
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_input_gradients.diminfo[0].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_gradients.diminfo[0].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_gradients.diminfo[1].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_gradients.diminfo[1].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_v_input_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":757
 *         # each matrix has a whole window in each line
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))             # <<<<<<<<<<<<<<
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_13[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(1, 757, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(1, 757, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 757, __pyx_L1_error)
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dist_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
      __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
    }
    __pyx_pybuffernd_target_dist_gradients.diminfo[0].strides = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dist_gradients.diminfo[0].shape = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_target_dist_gradients.diminfo[1].strides = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_target_dist_gradients.diminfo[1].shape = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 757, __pyx_L1_error)
  }
  __pyx_t_14 = 0;
  __pyx_v_target_dist_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":758
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         # avoid multiplying by the learning rate multiple times
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_6)); if (unlikely(__pyx_t_13 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_13[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(1, 758, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(1, 758, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 758, __pyx_L1_error)
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_pred_dist_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_pred_dist_gradients.diminfo[0].strides = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pred_dist_gradients.diminfo[0].shape = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pred_dist_gradients.diminfo[1].strides = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pred_dist_gradients.diminfo[1].shape = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 758, __pyx_L1_error)
  }
  __pyx_t_14 = 0;
  __pyx_v_pred_dist_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":761
 * 
 *         # avoid multiplying by the learning rate multiple times
 *         hidden_gradients = self.hidden_gradients * self.learning_rate_features             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_self->hidden_gradients), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 761, __pyx_L1_error)
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_hidden_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
      __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
    }
    __pyx_pybuffernd_hidden_gradients.diminfo[0].strides = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hidden_gradients.diminfo[0].shape = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_hidden_gradients.diminfo[1].strides = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_hidden_gradients.diminfo[1].shape = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 761, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_v_hidden_gradients = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":762
 *         # avoid multiplying by the learning rate multiple times
 *         hidden_gradients = self.hidden_gradients * self.learning_rate_features
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)             # <<<<<<<<<<<<<<
 * 
 *         for target in range(self.num_targets):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 762, __pyx_L1_error)
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_column_numbers = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(1, 762, __pyx_L1_error)
    } else {__pyx_pybuffernd_column_numbers.diminfo[0].strides = __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_column_numbers.diminfo[0].shape = __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_15 = 0;
  __pyx_v_column_numbers = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":764
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 * 
 *             # array with the tokens that yielded the maximum value in each neuron
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_16 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 764, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_16)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_16(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 764, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":768
 *             # array with the tokens that yielded the maximum value in each neuron
 *             # for this target
 *             convolution_max = self.max_indices[target]             # <<<<<<<<<<<<<<
 * 
 *             if not self.only_classify:
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->max_indices), __pyx_v_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 768, __pyx_L1_error)
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer, (PyObject*)__pyx_v_convolution_max, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_convolution_max.diminfo[0].strides = __pyx_pybuffernd_convolution_max.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_convolution_max.diminfo[0].shape = __pyx_pybuffernd_convolution_max.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 768, __pyx_L1_error)
    }
    __pyx_t_17 = 0;
    __Pyx_XDECREF_SET(__pyx_v_convolution_max, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":770
 *             convolution_max = self.max_indices[target]
 * 
 *             if not self.only_classify:             # <<<<<<<<<<<<<<
 *                 target_dists = convolution_max - target
 *             else:
 */
    __pyx_t_18 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 770, __pyx_L1_error)
    __pyx_t_19 = (!__pyx_t_18);
    if (__pyx_t_19) {

      /* "nltkor/tag/libs/networkconv.pyx":771
 * 
 *             if not self.only_classify:
 *                 target_dists = convolution_max - target             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = arguments[target]
 */
      __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_convolution_max), __pyx_v_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 771, __pyx_L1_error)
      __pyx_t_17 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
        __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_9 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
          }
          __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
        }
        __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 771, __pyx_L1_error)
      }
      __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":770
 *             convolution_max = self.max_indices[target]
 * 
 *             if not self.only_classify:             # <<<<<<<<<<<<<<
 *                 target_dists = convolution_max - target
 *             else:
 */
      goto __pyx_L5;
    }

    /* "nltkor/tag/libs/networkconv.pyx":773
 *                 target_dists = convolution_max - target
 *             else:
 *                 argument = arguments[target]             # <<<<<<<<<<<<<<
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_arguments, __pyx_v_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":774
 *             else:
 *                 argument = arguments[target]
 *                 target_dists = self.argument_distances(convolution_max, argument)             # <<<<<<<<<<<<<<
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
 */
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, ((PyObject *)__pyx_v_convolution_max), __pyx_v_argument)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
        __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_9 < 0)) {
          PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          }
          __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
        }
        __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 774, __pyx_L1_error)
      }
      __Pyx_XDECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
    }
    __pyx_L5:;

    /* "nltkor/tag/libs/networkconv.pyx":776
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_v_target_dists), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":777
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
 *                                    self.target_dist_lookup.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_lookup);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_long(((__pyx_t_13[0]) - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_20 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_20)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_20, __pyx_t_6, __pyx_int_0, __pyx_t_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":776
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
 */
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 776, __pyx_L1_error)
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 776, __pyx_L1_error)
    }
    __pyx_t_17 = 0;
    __Pyx_DECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":778
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate             # <<<<<<<<<<<<<<
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
 *                                  self.pred_dist_lookup.shape[0] - 1)
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_predicate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(((PyObject *)__pyx_v_convolution_max), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pred_dists, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":779
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                  self.pred_dist_lookup.shape[0] - 1)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyNumber_Add(__pyx_v_pred_dists, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":780
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
 *                                  self.pred_dist_lookup.shape[0] - 1)             # <<<<<<<<<<<<<<
 * 
 *             gradients = hidden_gradients[target]
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long(((__pyx_t_13[0]) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_20 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_20)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_20, __pyx_t_6, __pyx_int_0, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_pred_dists, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":782
 *                                  self.pred_dist_lookup.shape[0] - 1)
 * 
 *             gradients = hidden_gradients[target]             # <<<<<<<<<<<<<<
 * 
 *             # sparse matrix with gradients to be applied over the input
 */
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_hidden_gradients), __pyx_v_target); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 782, __pyx_L1_error)
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_gradients.diminfo[0].strides = __pyx_pybuffernd_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gradients.diminfo[0].shape = __pyx_pybuffernd_gradients.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 782, __pyx_L1_error)
    }
    __pyx_t_21 = 0;
    __Pyx_XDECREF_SET(__pyx_v_gradients, ((PyArrayObject *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":786
 *             # sparse matrix with gradients to be applied over the input
 *             # line i has the gradients for the i-th token in the sentence
 *             input_gradients[convolution_max, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 * 
 *             # distance deltas
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_convolution_max);
    __Pyx_GIVEREF((PyObject *)__pyx_v_convolution_max);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_convolution_max))) __PYX_ERR(1, 786, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(1, 786, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_input_gradients), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_5, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_input_gradients), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":789
 * 
 *             # distance deltas
 *             target_dist_gradients[target_dists, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF((PyObject *)__pyx_v_target_dists);
    __Pyx_GIVEREF((PyObject *)__pyx_v_target_dists);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_target_dists))) __PYX_ERR(1, 789, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 789, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_target_dist_gradients), __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_target_dist_gradients), __pyx_t_5, __pyx_t_1) < 0))) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":790
 *             # distance deltas
 *             target_dist_gradients[target_dists, np.arange(self.hidden_size)] += gradients
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_pred_dists);
    __Pyx_GIVEREF(__pyx_v_pred_dists);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pred_dists)) __PYX_ERR(1, 790, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(1, 790, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pred_dist_gradients), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_5, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_pred_dist_gradients), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":764
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 * 
 *             # array with the tokens that yielded the maximum value in each neuron
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":792
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)             # <<<<<<<<<<<<<<
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->input_deltas);
  __pyx_v_self->input_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":793
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)             # <<<<<<<<<<<<<<
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target_dist_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->target_dist_weights), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __pyx_v_self->target_dist_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":794
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pred_dist_gradients), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->pred_dist_weights), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __pyx_v_self->pred_dist_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_input_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_hidden_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_target_dist_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_pred_dist_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_convolution_max);
  __Pyx_XDECREF((PyObject *)__pyx_v_target_dists);
  __Pyx_XDECREF((PyObject *)__pyx_v_column_numbers);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_pred_dists);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features, "ConvolutionalNetwork._adjust_features(self, sentence, predicate)\nAdjusts the features in all feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features = {"_adjust_features", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  CYTHON_UNUSED PyObject *__pyx_v_predicate = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_adjust_features (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicate,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 797, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicate)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 797, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_adjust_features", 1, 2, 2, 1); __PYX_ERR(1, 797, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_adjust_features") < 0)) __PYX_ERR(1, 797, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicate = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_adjust_features", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 797, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicate) {
  PyObject *__pyx_v_start_from = NULL;
  PyObject *__pyx_v_dist_target_from = NULL;
  PyObject *__pyx_v_dist_pred_from = NULL;
  PyObject *__pyx_v_pre_dist = NULL;
  PyObject *__pyx_v_pos_dist = NULL;
  PyObject *__pyx_v_padded_sentence = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_table_deltas = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_deltas = NULL;
  PyObject *__pyx_v_dist_deltas = NULL;
  PyObject *__pyx_v_pre_deltas = NULL;
  PyObject *__pyx_v_pos_deltas = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  npy_intp *__pyx_t_17;
  PyArrayObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__55)
  __Pyx_RefNannySetupContext("_adjust_features", 1);
  __Pyx_TraceCall("_adjust_features", __pyx_f[1], 797, 0, __PYX_ERR(1, 797, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":801
 *         # compute each token in the window separately and
 *         # separate the feature deltas into tables
 *         start_from = 0             # <<<<<<<<<<<<<<
 *         dist_target_from = 0
 *         dist_pred_from = 0
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_start_from = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":802
 *         # separate the feature deltas into tables
 *         start_from = 0
 *         dist_target_from = 0             # <<<<<<<<<<<<<<
 *         dist_pred_from = 0
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_dist_target_from = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":803
 *         start_from = 0
 *         dist_target_from = 0
 *         dist_pred_from = 0             # <<<<<<<<<<<<<<
 * 
 *         # number of times that the minimum and maximum distances are repeated
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_dist_pred_from = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":807
 *         # number of times that the minimum and maximum distances are repeated
 *         # in the lookup distance tables
 *         pre_dist = self.word_window_size             # <<<<<<<<<<<<<<
 *         pos_dist = 1
 *         if self.word_window_size > 1:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pre_dist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":808
 *         # in the lookup distance tables
 *         pre_dist = self.word_window_size
 *         pos_dist = 1             # <<<<<<<<<<<<<<
 *         if self.word_window_size > 1:
 *             padded_sentence = np.concatenate((self.pre_padding,
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_pos_dist = __pyx_int_1;

  /* "nltkor/tag/libs/networkconv.pyx":809
 *         pre_dist = self.word_window_size
 *         pos_dist = 1
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
 */
  __pyx_t_2 = (__pyx_v_self->__pyx_base.word_window_size > 1);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":810
 *         pos_dist = 1
 *         if self.word_window_size > 1:
 *             padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                               sentence,
 *                                               self.pos_padding))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":812
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
 *                                               self.pos_padding))             # <<<<<<<<<<<<<<
 *         else:
 *             padded_sentence = sentence
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding))) __PYX_ERR(1, 810, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_sentence);
    __Pyx_GIVEREF(__pyx_v_sentence);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sentence)) __PYX_ERR(1, 810, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding))) __PYX_ERR(1, 810, __pyx_L1_error);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_padded_sentence = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":809
 *         pre_dist = self.word_window_size
 *         pos_dist = 1
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":814
 *                                               self.pos_padding))
 *         else:
 *             padded_sentence = sentence             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.word_window_size):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_sentence);
    __pyx_v_padded_sentence = __pyx_v_sentence;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":816
 *             padded_sentence = sentence
 * 
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 * 
 *             for j, table in enumerate(self.feature_tables):
 */
  __pyx_t_7 = __pyx_v_self->__pyx_base.word_window_size;
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "nltkor/tag/libs/networkconv.pyx":818
 *         for i in range(self.word_window_size):
 * 
 *             for j, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
    __pyx_t_4 = __pyx_v_self->__pyx_base.feature_tables; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_10 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 818, __pyx_L1_error)
        #endif
        if (__pyx_t_10 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(1, 818, __pyx_L1_error)
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":821
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
 *                 table_deltas = self.input_deltas[:, start_from:start_from + table.shape[1]]             # <<<<<<<<<<<<<<
 *                 start_from += table.shape[1]
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_start_from, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PySlice_New(__pyx_v_start_from, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_slice__8);
      __Pyx_GIVEREF(__pyx_slice__8);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__8)) __PYX_ERR(1, 821, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(1, 821, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->input_deltas), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_table_deltas, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":822
 *                 # regarding features from the j-th table
 *                 table_deltas = self.input_deltas[:, start_from:start_from + table.shape[1]]
 *                 start_from += table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_start_from, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_start_from, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":824
 *                 start_from += table.shape[1]
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):             # <<<<<<<<<<<<<<
 *                     table[token[j]] += deltas
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_padded_sentence, __pyx_v_i, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(1, 824, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_table_deltas);
      __Pyx_GIVEREF(__pyx_v_table_deltas);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_table_deltas)) __PYX_ERR(1, 824, __pyx_L1_error);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 824, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 824, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 824, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_12(__pyx_t_3);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(1, 824, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
          PyObject* sequence = __pyx_t_5;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 824, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_14);
          #else
          __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
          index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_13)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_14);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(1, 824, __pyx_L1_error)
          __pyx_t_16 = NULL;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 824, __pyx_L1_error)
          __pyx_L11_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v_deltas, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":825
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):
 *                     table[token[j]] += deltas             # <<<<<<<<<<<<<<
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
 */
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_token, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_v_table, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_v_deltas); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely((PyObject_SetItem(__pyx_v_table, __pyx_t_5, __pyx_t_13) < 0))) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":824
 *                 start_from += table.shape[1]
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):             # <<<<<<<<<<<<<<
 *                     table[token[j]] += deltas
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":818
 *         for i in range(self.word_window_size):
 * 
 *             for j, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":827
 *                     table[token[j]] += deltas
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]             # <<<<<<<<<<<<<<
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Add(__pyx_v_dist_target_from, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PySlice_New(__pyx_v_dist_target_from, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__8)) __PYX_ERR(1, 827, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->target_dist_deltas), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dist_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":828
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)             # <<<<<<<<<<<<<<
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dist_deltas, __pyx_n_s_take); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_arange); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_pre_dist};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __pyx_t_14 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_5, __pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_pre_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":829
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)             # <<<<<<<<<<<<<<
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dist_deltas, __pyx_n_s_take); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_arange); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_14, __pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_5, __pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_pos_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":830
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_18 = __pyx_v_self->target_dist_table;
    __Pyx_INCREF(__pyx_tuple__57);
    __pyx_t_19 = __pyx_tuple__57;
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_18), __pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_dist_deltas, 0, 0, &__pyx_v_pre_dist, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_18), __pyx_t_19, __pyx_t_4) < 0))) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":831
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas             # <<<<<<<<<<<<<<
 *             self.target_dist_table[-1] += pos_deltas
 *             dist_target_from += self.target_dist_table.shape[1]
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_18 = __pyx_v_self->target_dist_table;
    __pyx_t_10 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_pre_deltas); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":832
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas             # <<<<<<<<<<<<<<
 *             dist_target_from += self.target_dist_table.shape[1]
 * 
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_18 = __pyx_v_self->target_dist_table;
    __pyx_t_10 = -1L;
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_pos_deltas); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":833
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
 *             dist_target_from += self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
 */
    __pyx_t_4 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_dist_target_from, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_target_from, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":835
 *             dist_target_from += self.target_dist_table.shape[1]
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]             # <<<<<<<<<<<<<<
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Add(__pyx_v_dist_pred_from, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PySlice_New(__pyx_v_dist_pred_from, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__8)) __PYX_ERR(1, 835, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->pred_dist_deltas), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_deltas, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":836
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)             # <<<<<<<<<<<<<<
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dist_deltas, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_arange); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_pre_dist};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __pyx_t_14 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_5, __pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_pre_deltas, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":837
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dist_deltas, __pyx_n_s_take); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_arange); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_14, __pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_5, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_pos_deltas, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":838
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[0] += pre_deltas
 *             self.pred_dist_table[-1] += pos_deltas
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_18 = __pyx_v_self->pred_dist_table;
    __Pyx_INCREF(__pyx_tuple__57);
    __pyx_t_19 = __pyx_tuple__57;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_18), __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dist_deltas, 0, 0, &__pyx_v_pre_dist, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_18), __pyx_t_19, __pyx_t_4) < 0))) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":839
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[-1] += pos_deltas
 * 
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_18 = __pyx_v_self->pred_dist_table;
    __pyx_t_10 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_pre_deltas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":840
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas
 *             self.pred_dist_table[-1] += pos_deltas             # <<<<<<<<<<<<<<
 * 
 *             pre_dist -= 1
 */
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_18 = __pyx_v_self->pred_dist_table;
    __pyx_t_10 = -1L;
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_pos_deltas); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_18), __pyx_t_10, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_18); __pyx_t_18 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":842
 *             self.pred_dist_table[-1] += pos_deltas
 * 
 *             pre_dist -= 1             # <<<<<<<<<<<<<<
 *             pos_dist += 1
 *             dist_pred_from += self.pred_dist_table.shape[1]
 */
    __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_pre_dist, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_pre_dist, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":843
 * 
 *             pre_dist -= 1
 *             pos_dist += 1             # <<<<<<<<<<<<<<
 *             dist_pred_from += self.pred_dist_table.shape[1]
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pos_dist, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_pos_dist, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":844
 *             pre_dist -= 1
 *             pos_dist += 1
 *             dist_pred_from += self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self._create_target_lookup()
 */
    __pyx_t_4 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_dist_pred_from, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_pred_from, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":846
 *             dist_pred_from += self.pred_dist_table.shape[1]
 * 
 *         self._create_target_lookup()             # <<<<<<<<<<<<<<
 *         self._create_pred_lookup()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_target_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":847
 * 
 *         self._create_target_lookup()
 *         self._create_pred_lookup()             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_pred_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF((PyObject *)__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_from);
  __Pyx_XDECREF(__pyx_v_dist_target_from);
  __Pyx_XDECREF(__pyx_v_dist_pred_from);
  __Pyx_XDECREF(__pyx_v_pre_dist);
  __Pyx_XDECREF(__pyx_v_pos_dist);
  __Pyx_XDECREF(__pyx_v_padded_sentence);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_table_deltas);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_dist_deltas);
  __Pyx_XDECREF(__pyx_v_pre_deltas);
  __Pyx_XDECREF(__pyx_v_pos_deltas);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi, "ConvolutionalNetwork._viterbi(self, ndarray scores, bool allow_repeats=True)\n\n        Performs a Viterbi search over the scores for each tag using\n        the transitions matrix. If a matrix wasn't supplied, \n        it will return the tags with the highest scores individually.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi = {"_viterbi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_scores = 0;
  PyBoolObject *__pyx_v_allow_repeats = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_viterbi (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scores,&__pyx_n_s_allow_repeats,0};

    /* "nltkor/tag/libs/networkconv.pyx":850
 * 
 *     @cython.boundscheck(False)
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs a Viterbi search over the scores for each tag using
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyBoolObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 849, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allow_repeats);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 849, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_viterbi") < 0)) __PYX_ERR(1, 849, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_scores = ((PyArrayObject *)values[0]);
    __pyx_v_allow_repeats = ((PyBoolObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_viterbi", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 849, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scores), __pyx_ptype_5numpy_ndarray, 1, "scores", 0))) __PYX_ERR(1, 850, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 850, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_scores, __pyx_v_allow_repeats);

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_scores, PyBoolObject *__pyx_v_allow_repeats) {
  PyObject *__pyx_v_best_scores = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_logprobs = NULL;
  PyObject *__pyx_v_counts = NULL;
  PyObject *__pyx_v_conflicting_tag = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_conflicting_probs = NULL;
  PyObject *__pyx_v_highest_prob_arg = NULL;
  PyObject *__pyx_v_other_args = NULL;
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_path_backtrack = NULL;
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_prev_score_and_trans = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_previous_tag = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  float __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__58)
  __Pyx_RefNannySetupContext("_viterbi", 1);
  __Pyx_TraceCall("_viterbi", __pyx_f[1], 849, 0, __PYX_ERR(1, 849, __pyx_L1_error));
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 849, __pyx_L1_error)
  }
  __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/networkconv.pyx":856
 *         it will return the tags with the highest scores individually.
 *         """
 *         if self.transitions is None:             # <<<<<<<<<<<<<<
 *             best_scores = scores.argmax(1)
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":857
 *         """
 *         if self.transitions is None:
 *             best_scores = scores.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *             if allow_repeats:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_best_scores = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":859
 *             best_scores = scores.argmax(1)
 * 
 *             if allow_repeats:             # <<<<<<<<<<<<<<
 *                 return best_scores
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_allow_repeats)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 859, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":860
 * 
 *             if allow_repeats:
 *                 return best_scores             # <<<<<<<<<<<<<<
 * 
 *             # we must find the combination of tags that maximizes the probabilities
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_best_scores);
      __pyx_r = __pyx_v_best_scores;
      goto __pyx_L0;

      /* "nltkor/tag/libs/networkconv.pyx":859
 *             best_scores = scores.argmax(1)
 * 
 *             if allow_repeats:             # <<<<<<<<<<<<<<
 *                 return best_scores
 * 
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":863
 * 
 *             # we must find the combination of tags that maximizes the probabilities
 *             logadd = np.log(np.sum(np.exp(scores), 1))             # <<<<<<<<<<<<<<
 *             logprobs = (scores.T - logadd).T
 *             counts = np.bincount(best_scores)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exp); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_scores)};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_9 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_6, __pyx_int_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_logadd = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":864
 *             # we must find the combination of tags that maximizes the probabilities
 *             logadd = np.log(np.sum(np.exp(scores), 1))
 *             logprobs = (scores.T - logadd).T             # <<<<<<<<<<<<<<
 *             counts = np.bincount(best_scores)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_v_logadd); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_logprobs = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":865
 *             logadd = np.log(np.sum(np.exp(scores), 1))
 *             logprobs = (scores.T - logadd).T
 *             counts = np.bincount(best_scores)             # <<<<<<<<<<<<<<
 * 
 *             while counts.max() != 1:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bincount); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_best_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_counts = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":867
 *             counts = np.bincount(best_scores)
 * 
 *             while counts.max() != 1:             # <<<<<<<<<<<<<<
 *                 # find the tag with the most conflicting args
 *                 conflicting_tag = counts.argmax()
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_counts, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_1 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_2, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!__pyx_t_1) break;

      /* "nltkor/tag/libs/networkconv.pyx":869
 *             while counts.max() != 1:
 *                 # find the tag with the most conflicting args
 *                 conflicting_tag = counts.argmax()             # <<<<<<<<<<<<<<
 * 
 *                 # arguments with that tag as current maximum
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_counts, __pyx_n_s_argmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 869, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_conflicting_tag, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":872
 * 
 *                 # arguments with that tag as current maximum
 *                 args = np.where(best_scores == conflicting_tag)[0]             # <<<<<<<<<<<<<<
 * 
 *                 # get the logprobs for those args having this tag
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_best_scores, __pyx_v_conflicting_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 872, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 872, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":875
 * 
 *                 # get the logprobs for those args having this tag
 *                 conflicting_probs = logprobs[args, conflicting_tag]             # <<<<<<<<<<<<<<
 * 
 *                 # find the argument with the highest probability for that tag
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_args)) __PYX_ERR(1, 875, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_conflicting_tag);
      __Pyx_GIVEREF(__pyx_v_conflicting_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_conflicting_tag)) __PYX_ERR(1, 875, __pyx_L1_error);
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_logprobs, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_conflicting_probs, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":878
 * 
 *                 # find the argument with the highest probability for that tag
 *                 highest_prob_arg = args[conflicting_probs.argmax()]             # <<<<<<<<<<<<<<
 * 
 *                 # set the score for other arguments in that tag to a low value
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_conflicting_probs, __pyx_n_s_argmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_highest_prob_arg, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":881
 * 
 *                 # set the score for other arguments in that tag to a low value
 *                 other_args = args[args != highest_prob_arg]             # <<<<<<<<<<<<<<
 *                 scores[other_args, conflicting_tag] = -1000
 * 
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_args, __pyx_v_highest_prob_arg, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_args, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_other_args, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":882
 *                 # set the score for other arguments in that tag to a low value
 *                 other_args = args[args != highest_prob_arg]
 *                 scores[other_args, conflicting_tag] = -1000             # <<<<<<<<<<<<<<
 * 
 *                 # and find the new maxes, without recalculating probabilities
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_other_args);
      __Pyx_GIVEREF(__pyx_v_other_args);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_args)) __PYX_ERR(1, 882, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_conflicting_tag);
      __Pyx_GIVEREF(__pyx_v_conflicting_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_conflicting_tag)) __PYX_ERR(1, 882, __pyx_L1_error);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_scores), __pyx_t_2, __pyx_int_neg_1000) < 0))) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":885
 * 
 *                 # and find the new maxes, without recalculating probabilities
 *                 best_scores = scores.argmax(1)             # <<<<<<<<<<<<<<
 *                 counts = np.bincount(best_scores)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_best_scores, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":886
 *                 # and find the new maxes, without recalculating probabilities
 *                 best_scores = scores.argmax(1)
 *                 counts = np.bincount(best_scores)             # <<<<<<<<<<<<<<
 * 
 *             return best_scores
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bincount); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_best_scores};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_counts, __pyx_t_2);
      __pyx_t_2 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":888
 *                 counts = np.bincount(best_scores)
 * 
 *             return best_scores             # <<<<<<<<<<<<<<
 * 
 *         path_scores = np.empty_like(scores)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_best_scores);
    __pyx_r = __pyx_v_best_scores;
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkconv.pyx":856
 *         it will return the tags with the highest scores individually.
 *         """
 *         if self.transitions is None:             # <<<<<<<<<<<<<<
 *             best_scores = scores.argmax(1)
 * 
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":890
 *             return best_scores
 * 
 *         path_scores = np.empty_like(scores)             # <<<<<<<<<<<<<<
 *         path_backtrack = np.empty_like(scores, int)
 *         #path_backtrack = np.empty_like(scores, np.int)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_scores)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_path_scores = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":891
 * 
 *         path_scores = np.empty_like(scores)
 *         path_backtrack = np.empty_like(scores, int)             # <<<<<<<<<<<<<<
 *         #path_backtrack = np.empty_like(scores, np.int)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_scores), ((PyObject *)(&PyInt_Type))};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_path_backtrack = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":897
 *         # first, get the scores for each tag at token 0
 *         # the last row of the transitions table has the scores for the first tag
 *         path_scores[0] = scores[0] + self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         for i, token in enumerate(scores[1:], 1):
 */
  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.transitions), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0))) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_t_4 = __pyx_int_1;
  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_scores), __pyx_slice__59); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 899, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 899, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":902
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 *             prev_score_and_trans = (path_scores[i - 1] + self.transitions[:-1].T).T             # <<<<<<<<<<<<<<
 * 
 *             # find the previous tag that yielded the max score
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_path_scores, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.transitions), 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_T); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_T); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_prev_score_and_trans, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":905
 * 
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)             # <<<<<<<<<<<<<<
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prev_score_and_trans, __pyx_n_s_argmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_int_0};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (unlikely((PyObject_SetItem(__pyx_v_path_backtrack, __pyx_v_i, __pyx_t_6) < 0))) __PYX_ERR(1, 905, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_path_backtrack, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "nltkor/tag/libs/networkconv.pyx":907
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
 */
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(1, 906, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(1, 906, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_prev_score_and_trans, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":907
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 */
    __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_scores), __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
 */
    if (unlikely((PyObject_SetItem(__pyx_v_path_scores, __pyx_v_i, __pyx_t_6) < 0))) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":910
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 *         answer = np.empty(len(scores), dtype=int)             # <<<<<<<<<<<<<<
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 910, __pyx_L1_error)
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(1, 910, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(1, 910, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_answer = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":912
 *         answer = np.empty(len(scores), dtype=int)
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()             # <<<<<<<<<<<<<<
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_argmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, -1L, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 0) < 0))) __PYX_ERR(1, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":913
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]             # <<<<<<<<<<<<<<
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 */
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->__pyx_base.answer_score = __pyx_t_12;

  /* "nltkor/tag/libs/networkconv.pyx":914
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_path_backtrack, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_previous_tag = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":916
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 916, __pyx_L1_error)
  __pyx_t_9 = PyInt_FromSsize_t((__pyx_t_10 - 2)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9)) __PYX_ERR(1, 916, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0)) __PYX_ERR(1, 916, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_neg_1)) __PYX_ERR(1, 916, __pyx_L1_error);
  __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
    __pyx_t_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 916, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
        #else
        __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 916, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
        #else
        __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 916, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_11(__pyx_t_6);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 916, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":917
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag             # <<<<<<<<<<<<<<
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 */
    if (unlikely((PyObject_SetItem(__pyx_v_answer, __pyx_v_i, __pyx_v_previous_tag) < 0))) __PYX_ERR(1, 917, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":918
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]             # <<<<<<<<<<<<<<
 * 
 *         answer[0] = previous_tag
 */
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_path_backtrack, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_previous_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v_previous_tag, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":916
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":920
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 *         answer[0] = previous_tag             # <<<<<<<<<<<<<<
 *         return answer
 * 
 */
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, 0, __pyx_v_previous_tag, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0))) __PYX_ERR(1, 920, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":921
 * 
 *         answer[0] = previous_tag
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _create_target_lookup(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_best_scores);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_logprobs);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_conflicting_tag);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_conflicting_probs);
  __Pyx_XDECREF(__pyx_v_highest_prob_arg);
  __Pyx_XDECREF(__pyx_v_other_args);
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_path_backtrack);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_prev_score_and_trans);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_previous_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup, "ConvolutionalNetwork._create_target_lookup(self)\n\n        Creates a lookup table with the window value for each different distance\n        to the target token (target_dist_lookup) and one with the precomputed\n        values in the convolution layer (target_convolution_lookup). \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup = {"_create_target_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_target_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_create_target_lookup", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_create_target_lookup", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_distances = NULL;
  PyObject *__pyx_v_window_from = NULL;
  PyObject *__pyx_v_window_to = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_inds = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__60)
  __Pyx_RefNannySetupContext("_create_target_lookup", 1);
  __Pyx_TraceCall("_create_target_lookup", __pyx_f[1], 923, 0, __PYX_ERR(1, 923, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":931
 *         # consider padding. if the table has 10 entries, with a word window of 3,
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1             # <<<<<<<<<<<<<<
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_long((((__pyx_t_2[0]) + __pyx_v_self->__pyx_base.word_window_size) - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":932
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":933
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))             # <<<<<<<<<<<<<<
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->__pyx_base.word_window_size * (__pyx_t_2[1]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/networkconv.pyx":932
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
 */
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_num_distances);
  __Pyx_GIVEREF(__pyx_v_num_distances);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_num_distances)) __PYX_ERR(1, 932, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 932, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_v_self->target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":934
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2             # <<<<<<<<<<<<<<
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
 */
  __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_num_distances, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->target_dist_offset = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":935
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0             # <<<<<<<<<<<<<<
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_window_from = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":936
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_window_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":937
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 937, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 937, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 937, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 937, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":939
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window             # <<<<<<<<<<<<<<
 * 
 *             # discount half window size because of the extra distances we added for padding
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shift, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":942
 * 
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window             # <<<<<<<<<<<<<<
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_v_num_distances, __pyx_v_shift); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_shift, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_inds, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":943
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_clip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long(((__pyx_t_2[0]) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_inds, __pyx_int_0, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 943, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_inds, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":944
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]             # <<<<<<<<<<<<<<
 * 
 *             window_from = window_to
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_inds);
    __Pyx_GIVEREF(__pyx_v_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_inds)) __PYX_ERR(1, 944, __pyx_L1_error);
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->target_dist_table), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PySlice_New(__pyx_v_window_from, __pyx_v_window_to, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__8)) __PYX_ERR(1, 944, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(1, 944, __pyx_L1_error);
    __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->target_dist_lookup), __pyx_t_3, __pyx_t_5) < 0))) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":946
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
 * 
 *             window_from = window_to             # <<<<<<<<<<<<<<
 *             window_to += self.target_dist_table.shape[1]
 * 
 */
    __Pyx_INCREF(__pyx_v_window_to);
    __Pyx_DECREF_SET(__pyx_v_window_from, __pyx_v_window_to);

    /* "nltkor/tag/libs/networkconv.pyx":947
 * 
 *             window_from = window_to
 *             window_to += self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self.target_convolution_lookup = self.target_dist_lookup.dot(self.target_dist_weights)
 */
    __pyx_t_5 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_5)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_window_to, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_window_to, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":937
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":949
 *             window_to += self.target_dist_table.shape[1]
 * 
 *         self.target_convolution_lookup = self.target_dist_lookup.dot(self.target_dist_weights)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->target_dist_lookup), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->target_dist_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 949, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __pyx_v_self->target_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_target_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_distances);
  __Pyx_XDECREF(__pyx_v_window_from);
  __Pyx_XDECREF(__pyx_v_window_to);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup, "ConvolutionalNetwork._create_pred_lookup(self)\n\n        Creates a lookup table with the window value for each different distance\n        to the predicate token (pred_dist_lookup) and one with the precomputed\n        values in the convolution layer (pred_convolution_lookup). \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup = {"_create_pred_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_pred_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_create_pred_lookup", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_create_pred_lookup", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_distances = NULL;
  PyObject *__pyx_v_window_from = NULL;
  PyObject *__pyx_v_window_to = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_inds = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__61)
  __Pyx_RefNannySetupContext("_create_pred_lookup", 1);
  __Pyx_TraceCall("_create_pred_lookup", __pyx_f[1], 952, 0, __PYX_ERR(1, 952, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":960
 *         # consider padding. if the table has 10 entries, with a word window of 3,
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1             # <<<<<<<<<<<<<<
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_long((((__pyx_t_2[0]) + __pyx_v_self->__pyx_base.word_window_size) - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":961
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":962
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))             # <<<<<<<<<<<<<<
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->__pyx_base.word_window_size * (__pyx_t_2[1]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/networkconv.pyx":961
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
 */
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_num_distances);
  __Pyx_GIVEREF(__pyx_v_num_distances);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_num_distances)) __PYX_ERR(1, 961, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 961, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_v_self->pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":963
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2             # <<<<<<<<<<<<<<
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
 */
  __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_num_distances, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->pred_dist_offset = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":964
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0             # <<<<<<<<<<<<<<
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_window_from = __pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":965
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_window_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":966
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 966, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 966, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":968
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window             # <<<<<<<<<<<<<<
 * 
 *             # discount half window size because of the extra distances we added for padding
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shift, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":971
 * 
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window             # <<<<<<<<<<<<<<
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_v_num_distances, __pyx_v_shift); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_shift, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_inds, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":972
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_clip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long(((__pyx_t_2[0]) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_inds, __pyx_int_0, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_inds, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":973
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]             # <<<<<<<<<<<<<<
 * 
 *             window_from = window_to
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_inds);
    __Pyx_GIVEREF(__pyx_v_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_inds)) __PYX_ERR(1, 973, __pyx_L1_error);
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->pred_dist_table), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PySlice_New(__pyx_v_window_from, __pyx_v_window_to, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_slice__8);
    __Pyx_GIVEREF(__pyx_slice__8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__8)) __PYX_ERR(1, 973, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(1, 973, __pyx_L1_error);
    __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->pred_dist_lookup), __pyx_t_3, __pyx_t_5) < 0))) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":975
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
 * 
 *             window_from = window_to             # <<<<<<<<<<<<<<
 *             window_to += self.pred_dist_table.shape[1]
 * 
 */
    __Pyx_INCREF(__pyx_v_window_to);
    __Pyx_DECREF_SET(__pyx_v_window_from, __pyx_v_window_to);

    /* "nltkor/tag/libs/networkconv.pyx":976
 * 
 *             window_from = window_to
 *             window_to += self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 */
    __pyx_t_5 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_5)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_window_to, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_window_to, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":966
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":978
 *             window_to += self.pred_dist_table.shape[1]
 * 
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)             # <<<<<<<<<<<<<<
 * 
 *     def _create_convolution_lookup(self, sentence, training):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->pred_dist_lookup), __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->pred_dist_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 978, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __pyx_v_self->pred_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_pred_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_distances);
  __Pyx_XDECREF(__pyx_v_window_from);
  __Pyx_XDECREF(__pyx_v_window_to);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup, "ConvolutionalNetwork._create_convolution_lookup(self, sentence, training)\n\n        Creates a lookup table storing the values found by each\n        convolutional neuron before summing distance features.\n        The table has the format len(sent) x len(convol layer)\n        Biases are not included.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup = {"_create_convolution_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_convolution_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_training,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 980, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_training)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 980, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_create_convolution_lookup", 1, 2, 2, 1); __PYX_ERR(1, 980, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_create_convolution_lookup") < 0)) __PYX_ERR(1, 980, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_sentence = values[0];
    __pyx_v_training = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_convolution_lookup", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 980, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_convolution_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_training);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_training) {
  PyArrayObject *__pyx_v_padded_sentence = 0;
  PyArrayObject *__pyx_v_window = 0;
  PyArrayObject *__pyx_v_input_data = 0;
  PyArrayObject *__pyx_v_new_data = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_element = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_token_indices = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_table = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_table = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new_data;
  __Pyx_Buffer __pyx_pybuffer_new_data;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__62)
  __Pyx_RefNannySetupContext("_create_convolution_lookup", 1);
  __Pyx_TraceCall("_create_convolution_lookup", __pyx_f[1], 980, 0, __PYX_ERR(1, 980, __pyx_L1_error));
  __pyx_pybuffer_new_data.pybuffer.buf = NULL;
  __pyx_pybuffer_new_data.refcount = 0;
  __pyx_pybuffernd_new_data.data = NULL;
  __pyx_pybuffernd_new_data.rcbuffer = &__pyx_pybuffer_new_data;

  /* "nltkor/tag/libs/networkconv.pyx":990
 * 
 *         # add padding to the sentence
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.word_window_size > 1);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":991
 *         # add padding to the sentence
 *         if self.word_window_size > 1:
 *             padded_sentence = np.vstack((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                          sentence,
 *                                          self.pos_padding))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_vstack); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":993
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
 *                                          self.pos_padding))             # <<<<<<<<<<<<<<
 *         else:
 *             padded_sentence = sentence
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding))) __PYX_ERR(1, 991, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_sentence);
    __Pyx_GIVEREF(__pyx_v_sentence);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sentence)) __PYX_ERR(1, 991, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding))) __PYX_ERR(1, 991, __pyx_L1_error);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":991
 *         # add padding to the sentence
 *         if self.word_window_size > 1:
 *             padded_sentence = np.vstack((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                          sentence,
 *                                          self.pos_padding))
 */
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 991, __pyx_L1_error)
    __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":990
 * 
 *         # add padding to the sentence
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":995
 *                                          self.pos_padding))
 *         else:
 *             padded_sentence = sentence             # <<<<<<<<<<<<<<
 * 
 *         self.convolution_lookup = np.empty((len(sentence), self.hidden_size))
 */
  /*else*/ {
    if (!(likely(((__pyx_v_sentence) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sentence, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 995, __pyx_L1_error)
    __pyx_t_2 = __pyx_v_sentence;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":997
 *             padded_sentence = sentence
 * 
 *         self.convolution_lookup = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *         #print(len(sentence), self.hidden_size, len(self.convolution_lookup[0]))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 997, __pyx_L1_error)
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5)) __PYX_ERR(1, 997, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->convolution_lookup);
  __pyx_v_self->convolution_lookup = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1001
 * 
 *         # first window
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]             # <<<<<<<<<<<<<<
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
 */
  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_padded_sentence), 0, __pyx_v_self->__pyx_base.word_window_size, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1001, __pyx_L1_error)
  __pyx_v_window = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1003
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(             # <<<<<<<<<<<<<<
 *                                     [table[index]
 *                                      for token_indices in window
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  { /* enter inner scope */

    /* "nltkor/tag/libs/networkconv.pyx":1004
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
 *                                     [table[index]             # <<<<<<<<<<<<<<
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1004, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "nltkor/tag/libs/networkconv.pyx":1005
 *         input_data = np.concatenate(
 *                                     [table[index]
 *                                      for token_indices in window             # <<<<<<<<<<<<<<
 *                                      for index, table in zip(token_indices,
 *                                                              self.feature_tables)
 */
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_window))) || PyTuple_CheckExact(((PyObject *)__pyx_v_window))) {
      __pyx_t_5 = ((PyObject *)__pyx_v_window); __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_window)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1005, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1005, __pyx_L6_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1005, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1005, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1005, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_token_indices, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":1006
 *                                     [table[index]
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,             # <<<<<<<<<<<<<<
 *                                                              self.feature_tables)
 *                                      ]
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1006, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_8genexpr7__pyx_v_token_indices);
      __Pyx_GIVEREF(__pyx_8genexpr7__pyx_v_token_indices);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_8genexpr7__pyx_v_token_indices)) __PYX_ERR(1, 1006, __pyx_L6_error);
      __Pyx_INCREF(__pyx_v_self->__pyx_base.feature_tables);
      __Pyx_GIVEREF(__pyx_v_self->__pyx_base.feature_tables);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->__pyx_base.feature_tables)) __PYX_ERR(1, 1006, __pyx_L6_error);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1006, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1006, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1006, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
            #else
            __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1006, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
            #else
            __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1006, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          }
        } else {
          __pyx_t_10 = __pyx_t_12(__pyx_t_4);
          if (unlikely(!__pyx_t_10)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(1, 1006, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
          PyObject* sequence = __pyx_t_10;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 1006, __pyx_L6_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_14);
          #else
          __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_15 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
          index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_13)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_14);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(1, 1006, __pyx_L6_error)
          __pyx_t_16 = NULL;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 1006, __pyx_L6_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_index, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_table, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1004
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
 *                                     [table[index]             # <<<<<<<<<<<<<<
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,
 */
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_8genexpr7__pyx_v_table, __pyx_8genexpr7__pyx_v_index); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1004, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(1, 1004, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1006
 *                                     [table[index]
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,             # <<<<<<<<<<<<<<
 *                                                              self.feature_tables)
 *                                      ]
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":1005
 *         input_data = np.concatenate(
 *                                     [table[index]
 *                                      for token_indices in window             # <<<<<<<<<<<<<<
 *                                      for index, table in zip(token_indices,
 *                                                              self.feature_tables)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index); __pyx_8genexpr7__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table); __pyx_8genexpr7__pyx_v_table = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices); __pyx_8genexpr7__pyx_v_token_indices = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index); __pyx_8genexpr7__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table); __pyx_8genexpr7__pyx_v_table = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices); __pyx_8genexpr7__pyx_v_token_indices = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":1003
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(             # <<<<<<<<<<<<<<
 *                                     [table[index]
 *                                      for token_indices in window
 */
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1003, __pyx_L1_error)
  __pyx_v_input_data = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1010
 *                                      ]
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)             # <<<<<<<<<<<<<<
 *         if training:
 *             # store the values of each input -- needed when adjusting features
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.hidden_weights), __pyx_n_s_dot); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_input_data)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->convolution_lookup), 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(1, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1011
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)
 *         if training:             # <<<<<<<<<<<<<<
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1011, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":1013
 *         if training:
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 */
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base.input_sent_values), 0, ((PyObject *)__pyx_v_input_data), long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(1, 1013, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":1011
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)
 *         if training:             # <<<<<<<<<<<<<<
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data
 */
  }

  /* "nltkor/tag/libs/networkconv.pyx":1016
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):             # <<<<<<<<<<<<<<
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_t_2 = __pyx_int_1;
  __pyx_t_8 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_padded_sentence), __pyx_v_self->__pyx_base.word_window_size, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1016, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1016, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1017
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for             # <<<<<<<<<<<<<<
 *                                        index, table in zip(element, self.feature_tables)])
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    { /* enter inner scope */
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1017, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "nltkor/tag/libs/networkconv.pyx":1018
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])             # <<<<<<<<<<<<<<
 * 
 *             # slide the window to the next element
 */
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1018, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_element);
      __Pyx_GIVEREF(__pyx_v_element);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_element)) __PYX_ERR(1, 1018, __pyx_L21_error);
      __Pyx_INCREF(__pyx_v_self->__pyx_base.feature_tables);
      __Pyx_GIVEREF(__pyx_v_self->__pyx_base.feature_tables);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->__pyx_base.feature_tables)) __PYX_ERR(1, 1018, __pyx_L21_error);
      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_10, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1018, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (likely(PyList_CheckExact(__pyx_t_14)) || PyTuple_CheckExact(__pyx_t_14)) {
        __pyx_t_10 = __pyx_t_14; __Pyx_INCREF(__pyx_t_10);
        __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1018, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1018, __pyx_L21_error)
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_14 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_14); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
            #else
            __pyx_t_14 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1018, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_14);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_14); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
            #else
            __pyx_t_14 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1018, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_14);
            #endif
          }
        } else {
          __pyx_t_14 = __pyx_t_12(__pyx_t_10);
          if (unlikely(!__pyx_t_14)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(1, 1018, __pyx_L21_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_14);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
          PyObject* sequence = __pyx_t_14;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 1018, __pyx_L21_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_15);
          #else
          __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_15);
          #endif
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_17 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_17);
          index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_17); if (unlikely(!__pyx_t_13)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          index = 1; __pyx_t_15 = __pyx_t_16(__pyx_t_17); if (unlikely(!__pyx_t_15)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_15);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_17), 2) < 0) __PYX_ERR(1, 1018, __pyx_L21_error)
          __pyx_t_16 = NULL;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          goto __pyx_L25_unpacking_done;
          __pyx_L24_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_16 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 1018, __pyx_L21_error)
          __pyx_L25_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_index, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_table, __pyx_t_15);
        __pyx_t_15 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1017
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for             # <<<<<<<<<<<<<<
 *                                        index, table in zip(element, self.feature_tables)])
 * 
 */
        __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_8genexpr8__pyx_v_table, __pyx_8genexpr8__pyx_v_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1017, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_14))) __PYX_ERR(1, 1017, __pyx_L21_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index); __pyx_8genexpr8__pyx_v_index = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table); __pyx_8genexpr8__pyx_v_table = 0;
      goto __pyx_L27_exit_scope;
      __pyx_L21_error:;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index); __pyx_8genexpr8__pyx_v_index = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table); __pyx_8genexpr8__pyx_v_table = 0;
      goto __pyx_L1_error;
      __pyx_L27_exit_scope:;
    } /* exit inner scope */
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1017, __pyx_L1_error)
    __pyx_t_18 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
      __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_19 < 0)) {
        PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_data, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
        }
        __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0;
      }
      __pyx_pybuffernd_new_data.diminfo[0].strides = __pyx_pybuffernd_new_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_data.diminfo[0].shape = __pyx_pybuffernd_new_data.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(1, 1017, __pyx_L1_error)
    }
    __pyx_t_18 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_data, ((PyArrayObject *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1021
 * 
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],             # <<<<<<<<<<<<<<
 *                                          new_data))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input_data), __pyx_v_self->__pyx_base.features_per_token, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "nltkor/tag/libs/networkconv.pyx":1022
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],
 *                                          new_data))             # <<<<<<<<<<<<<<
 * 
 *             #print(i, input_data)
 */
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(1, 1021, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_new_data);
    __Pyx_GIVEREF((PyObject *)__pyx_v_new_data);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_new_data))) __PYX_ERR(1, 1021, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1021, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":1021
 * 
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],             # <<<<<<<<<<<<<<
 *                                          new_data))
 * 
 */
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_input_data, ((PyArrayObject *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1025
 * 
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)             # <<<<<<<<<<<<<<
 *             if training:
 *                 self.input_sent_values[i] = input_data
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.hidden_weights), __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_v_input_data)};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->convolution_lookup), __pyx_v_i, __pyx_t_8) < 0))) __PYX_ERR(1, 1025, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1026
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1026, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":1027
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:
 *                 self.input_sent_values[i] = input_data             # <<<<<<<<<<<<<<
 * 
 */
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.input_sent_values), __pyx_v_i, ((PyObject *)__pyx_v_input_data)) < 0))) __PYX_ERR(1, 1027, __pyx_L1_error)

      /* "nltkor/tag/libs/networkconv.pyx":1026
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 * 
 */
    }

    /* "nltkor/tag/libs/networkconv.pyx":1016
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):             # <<<<<<<<<<<<<<
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_convolution_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_padded_sentence);
  __Pyx_XDECREF((PyObject *)__pyx_v_window);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_data);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_element);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":14
 * 
 *     # transition and distance feature tables
 *     cdef public np.ndarray target_dist_table, pred_dist_table             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_table);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 14, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_table);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 1);
  __Pyx_TraceCall("__set__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 14, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 1);
  __Pyx_TraceCall("__del__", __pyx_f[1], 14, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":15
 *     # transition and distance feature tables
 *     cdef public np.ndarray target_dist_table, pred_dist_table
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights             # <<<<<<<<<<<<<<
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 15, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 15, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":16
 *     cdef public np.ndarray target_dist_table, pred_dist_table
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":17
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 17, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_lookup);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 17, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_lookup);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":18
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 18, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->target_convolution_lookup);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_convolution_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 18, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_convolution_lookup);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_convolution_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":19
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas             # <<<<<<<<<<<<<<
 * 
 *     # the second hidden layer
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 19, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_deltas);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_deltas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 19, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_deltas);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_deltas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":22
 * 
 *     # the second hidden layer
 *     cdef readonly int hidden2_size             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 22, 0, __PYX_ERR(1, 22, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":23
 *     # the second hidden layer
 *     cdef readonly int hidden2_size
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_values
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 23, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 23, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_bias);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":24
 *     cdef readonly int hidden2_size
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 24, 0, __PYX_ERR(1, 24, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_values);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":25
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation             # <<<<<<<<<<<<<<
 * 
 *     # lookup of convolution values (the same for each sentence, used to save time)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 25, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_before_activation);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_before_activation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 25, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_before_activation);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_before_activation);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden_before_activation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":31
 * 
 *     # maximum convolution indices
 *     cdef readonly np.ndarray max_indices             # <<<<<<<<<<<<<<
 * 
 *     # number of targets (all tokens in a sentence or the provided arguments)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[1], 31, 0, __PYX_ERR(1, 31, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->max_indices);
  __pyx_r = ((PyObject *)__pyx_v_self->max_indices);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.max_indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__, "ConvolutionalNetwork.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__63)
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);
  __Pyx_TraceCall("__reduce_cython__", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_self->num_sentences); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_tokens); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.skips); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_23 = PyTuple_New(69); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, ((PyObject *)__pyx_v_self->convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 4, __pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 5, __pyx_v_self->__pyx_base.feature_tables)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 6, __pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 7, __pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 8, __pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 9, ((PyObject *)__pyx_v_self->hidden2_before_activation))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 10, ((PyObject *)__pyx_v_self->hidden2_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 11, ((PyObject *)__pyx_v_self->hidden2_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 12, __pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 13, ((PyObject *)__pyx_v_self->hidden2_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 14, ((PyObject *)__pyx_v_self->hidden2_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 15, ((PyObject *)__pyx_v_self->hidden_before_activation))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 16, ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 17, ((PyObject *)__pyx_v_self->hidden_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 18, ((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 19, __pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 20, ((PyObject *)__pyx_v_self->__pyx_base.hidden_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 21, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 22, ((PyObject *)__pyx_v_self->input_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 23, ((PyObject *)__pyx_v_self->__pyx_base.input_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 24, __pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 25, ((PyObject *)__pyx_v_self->__pyx_base.input_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 26, ((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 27, ((PyObject *)__pyx_v_self->__pyx_base.layer2_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 28, __pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 29, __pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 30, __pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->max_indices);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->max_indices);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 31, ((PyObject *)__pyx_v_self->max_indices))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 32, ((PyObject *)__pyx_v_self->__pyx_base.net_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 33, __pyx_v_self->__pyx_base.network_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 34, __pyx_v_self->__pyx_base.network_text_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 35, __pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 36, __pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 37, __pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->only_classify);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 38, ((PyObject *)__pyx_v_self->only_classify))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 39, ((PyObject *)__pyx_v_self->__pyx_base.output_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 40, __pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 41, ((PyObject *)__pyx_v_self->__pyx_base.output_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 42, ((PyObject *)__pyx_v_self->__pyx_base.padding_left))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 43, ((PyObject *)__pyx_v_self->__pyx_base.padding_right))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 44, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 45, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 46, ((PyObject *)__pyx_v_self->pred_convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 47, ((PyObject *)__pyx_v_self->pred_dist_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 48, ((PyObject *)__pyx_v_self->pred_dist_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_18);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 49, __pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 50, ((PyObject *)__pyx_v_self->pred_dist_table))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 51, ((PyObject *)__pyx_v_self->pred_dist_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_19);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 52, __pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 53, ((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_20);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 54, __pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 55, ((PyObject *)__pyx_v_self->target_convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 56, ((PyObject *)__pyx_v_self->target_dist_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 57, ((PyObject *)__pyx_v_self->target_dist_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_21);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 58, __pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 59, ((PyObject *)__pyx_v_self->target_dist_table))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 60, ((PyObject *)__pyx_v_self->target_dist_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 61, ((PyObject *)__pyx_v_self->__pyx_base.trans_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 62, ((PyObject *)__pyx_v_self->__pyx_base.transitions))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 63, ((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_arguments);
  __Pyx_GIVEREF(__pyx_v_self->validation_arguments);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 64, __pyx_v_self->validation_arguments)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_predicates);
  __Pyx_GIVEREF(__pyx_v_self->validation_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 65, __pyx_v_self->validation_predicates)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 66, __pyx_v_self->__pyx_base.validation_sentences)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 67, __pyx_v_self->__pyx_base.validation_tags)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_22);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 68, __pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_23);
  __pyx_t_23 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_23 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __pyx_v__dict = __pyx_t_23;
  __pyx_t_23 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_24 = (__pyx_v__dict != Py_None);
  if (__pyx_t_24) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v__dict)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_22 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_22));
    __pyx_t_22 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 */
  /*else*/ {
    __pyx_t_25 = (((PyObject *)__pyx_v_self->convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->input_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.layer2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->max_indices) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.net_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->only_classify) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.output_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.output_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.padding_left) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.padding_right) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pos_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pre_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.trans_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_predicates != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_tags != ((PyObject*)Py_None));
    __pyx_t_24 = __pyx_t_25;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_24;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_pyx_unpickle_ConvolutionalNetw); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_49696698);
    __Pyx_GIVEREF(__pyx_int_49696698);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_int_49696698)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, Py_None)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_22);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_v_state)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_22 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_21;
    __pyx_t_21 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_pyx_unpickle_ConvolutionalNetw); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_49696698);
    __Pyx_GIVEREF(__pyx_int_49696698);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_int_49696698)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_v_state)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_GIVEREF(__pyx_t_21);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_21 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_22;
    __pyx_t_22 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__, "ConvolutionalNetwork.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(4, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__64)
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);
  __Pyx_TraceCall("__setstate_cython__", __pyx_f[4], 16, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save, "ConvolutionalDependencyNetwork.save(self)\n\n        Saves the neural network to a file.\n        It will save the weights, biases, sizes, padding and \n        distance tables, and other feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save = {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "save", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__65)
  __Pyx_RefNannySetupContext("save", 1);
  __Pyx_TraceCall("save", __pyx_f[5], 19, 0, __PYX_ERR(5, 19, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":25
 *         distance tables, and other feature tables.
 *         """
 *         data = self._generate_save_dict()             # <<<<<<<<<<<<<<
 * 
 *         np.savez(self.network_filename, **data)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_generate_save_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":27
 *         data = self._generate_save_dict()
 * 
 *         np.savez(self.network_filename, **data)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_savez); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.__pyx_base.network_filename)) __PYX_ERR(5, 27, __pyx_L1_error);
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(5, 27, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_data))) {
    __pyx_t_3 = PyDict_Copy(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file, "ConvolutionalDependencyNetwork.load_from_file(cls, filename)\n\n        Loads the neural network from a file.\n        It will load weights, biases, sizes, padding and \n        distance tables, and other feature tables.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file = {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 29, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_from_file") < 0)) __PYX_ERR(5, 29, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 29, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__66)
  __Pyx_RefNannySetupContext("load_from_file", 1);
  __Pyx_TraceCall("load_from_file", __pyx_f[5], 29, 0, __PYX_ERR(5, 29, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":36
 *         distance tables, and other feature tables.
 *         """
 *         data = np.load(filename, allow_pickle=True)             # <<<<<<<<<<<<<<
 *         nn = cls._load_from_file(data, filename)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename)) __PYX_ERR(5, 36, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allow_pickle, Py_True) < 0) __PYX_ERR(5, 36, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_data = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":37
 *         """
 *         data = np.load(filename, allow_pickle=True)
 *         nn = cls._load_from_file(data, filename)             # <<<<<<<<<<<<<<
 * 
 *         return nn
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_load_from_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_filename};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_nn = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":39
 *         nn = cls._load_from_file(data, filename)
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list heads, int epochs,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nn);
  __pyx_r = __pyx_v_nn;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train, "ConvolutionalDependencyNetwork.train(self, list sentences, list heads, int epochs, int epochs_between_reports=0, float desired_accuracy=0, list labels=None)\n\n        Trains the convolutional network. Refer to the basic Network\n        train method for detailed explanation. \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train = {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_heads = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_heads,&__pyx_n_s_epochs,&__pyx_n_s_epochs_between_reports,&__pyx_n_s_desired_accuracy,&__pyx_n_s_labels,0};

    /* "nltkor/tag/libs/networkdependencyconv.pyx":43
 *     def train(self, list sentences, list heads, int epochs,
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Trains the convolutional network. Refer to the basic Network
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 3, 6, 1); __PYX_ERR(5, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("train", 0, 3, 6, 2); __PYX_ERR(5, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_epochs_between_reports);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_desired_accuracy);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_labels);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "train") < 0)) __PYX_ERR(5, 41, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_heads = ((PyObject*)values[1]);
    __pyx_v_epochs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_epochs_between_reports = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 42, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[4]) {
      __pyx_v_desired_accuracy = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 42, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
    __pyx_v_labels = ((PyObject*)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 3, 6, __pyx_nargs); __PYX_ERR(5, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(5, 41, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), (&PyList_Type), 1, "heads", 1))) __PYX_ERR(5, 41, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(5, 43, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_heads, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy, __pyx_v_labels);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_labels) {
  PyObject *__pyx_v_predicates = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_sentence = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__67)
  __Pyx_RefNannySetupContext("train", 1);
  __Pyx_TraceCall("train", __pyx_f[5], 41, 0, __PYX_ERR(5, 41, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":50
 *         # the ConvolutionalNetwork class was written primarily for SRL
 *         # every token acts as a predicate, and we don't need to tell it explicitely
 *         predicates = [np.arange(len(sentence)) for sentence in sentences]             # <<<<<<<<<<<<<<
 * 
 *         # the last argument in ConvolutionalNetwork.train is actually the argument
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_sentences == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(5, 50, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_sentences; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 50, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(5, 50, __pyx_L5_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_sentence, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = PyObject_Length(__pyx_8genexpr9__pyx_v_sentence); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 50, __pyx_L5_error)
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence); __pyx_8genexpr9__pyx_v_sentence = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence); __pyx_8genexpr9__pyx_v_sentence = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":56
 *         # argument, which is correctly handled by the DependencyNetwork._tag(...) method.
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, heads, labels)
 * 
 */
  __pyx_t_10 = (__pyx_v_self->__pyx_base.__pyx_base.validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_10) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":57
 * 
 *         if self.validation_sentences is None:
 *             self.set_validation_data(sentences, heads, labels)             # <<<<<<<<<<<<<<
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_validation_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_sentences, __pyx_v_heads, __pyx_v_labels};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 57, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":56
 *         # argument, which is correctly handled by the DependencyNetwork._tag(...) method.
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, heads, labels)
 * 
 */
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":59
 *             self.set_validation_data(sentences, heads, labels)
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,             # <<<<<<<<<<<<<<
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  __Pyx_GIVEREF((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork))) __PYX_ERR(5, 59, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(5, 59, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_train); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":60
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
 *                                                           heads, epochs,             # <<<<<<<<<<<<<<
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":61
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,             # <<<<<<<<<<<<<<
 *                                                           desired_accuracy,
 *                                                           labels)
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":62
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,             # <<<<<<<<<<<<<<
 *                                                           labels)
 * 
 */
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_desired_accuracy); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":63
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,
 *                                                           labels)             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):
 */
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_8, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_heads, __pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_v_labels};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 7+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_predicates);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data, "ConvolutionalDependencyNetwork.set_validation_data(self, list sentences, list heads, list labels=None)\n\n        Sets the data to be used in validation during training. If this function\n        is not called before training, the training data itself is used to \n        measure the model's performance.\n        \n        :param labels: only used when learning labels\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data = {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentences,&__pyx_n_s_heads,&__pyx_n_s_labels,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentences)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 65, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 65, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 2, 3, 1); __PYX_ERR(5, 65, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_labels);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 65, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_validation_data") < 0)) __PYX_ERR(5, 65, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_heads = ((PyObject*)values[1]);
    __pyx_v_labels = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 2, 3, __pyx_nargs); __PYX_ERR(5, 65, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), (&PyList_Type), 1, "heads", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_heads, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__68)
  __Pyx_RefNannySetupContext("set_validation_data", 1);
  __Pyx_TraceCall("set_validation_data", __pyx_f[5], 65, 0, __PYX_ERR(5, 65, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":73
 *         :param labels: only used when learning labels
 *         """
 *         self.validation_sentences = sentences             # <<<<<<<<<<<<<<
 *         self.validation_tags = labels
 *         self.validation_heads = heads
 */
  __Pyx_INCREF(__pyx_v_sentences);
  __Pyx_GIVEREF(__pyx_v_sentences);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __pyx_v_self->__pyx_base.__pyx_base.validation_sentences = __pyx_v_sentences;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":74
 *         """
 *         self.validation_sentences = sentences
 *         self.validation_tags = labels             # <<<<<<<<<<<<<<
 *         self.validation_heads = heads
 * 
 */
  __Pyx_INCREF(__pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __pyx_v_self->__pyx_base.__pyx_base.validation_tags = __pyx_v_labels;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":75
 *         self.validation_sentences = sentences
 *         self.validation_tags = labels
 *         self.validation_heads = heads             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):
 */
  __Pyx_INCREF(__pyx_v_heads);
  __Pyx_GIVEREF(__pyx_v_heads);
  __Pyx_GOTREF(__pyx_v_self->validation_heads);
  __Pyx_DECREF(__pyx_v_self->validation_heads);
  __pyx_v_self->validation_heads = __pyx_v_heads;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence, "ConvolutionalDependencyNetwork._tag_sentence(self, sentence, predicates=None, heads=None, labels=None)\n\n        This function is just an interface to the _tag_sentence signature\n        defined in ConvolutionalNetwork.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence = {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  CYTHON_UNUSED PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_predicates,&__pyx_n_s_heads,&__pyx_n_s_labels,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 77, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_predicates);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 77, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 77, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_labels);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 77, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_tag_sentence") < 0)) __PYX_ERR(5, 77, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_heads = values[2];
    __pyx_v_labels = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 4, __pyx_nargs); __PYX_ERR(5, 77, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_heads, __pyx_v_labels);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicates, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__69)
  __Pyx_RefNannySetupContext("_tag_sentence", 1);
  __Pyx_TraceCall("_tag_sentence", __pyx_f[5], 77, 0, __PYX_ERR(5, 77, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":82
 *         defined in ConvolutionalNetwork.
 *         """
 *         if labels is None:             # <<<<<<<<<<<<<<
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_labels == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":83
 *         """
 *         if labels is None:
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)             # <<<<<<<<<<<<<<
 *         else:
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_unlabeled_dependen); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sentence, __pyx_v_heads};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":82
 *         defined in ConvolutionalNetwork.
 *         """
 *         if labels is None:             # <<<<<<<<<<<<<<
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":85
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_labeled_dependency); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_sentence, __pyx_v_heads, __pyx_v_labels};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency, "ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency(self, ndarray sentence, ndarray heads=None)\n\n        Run the network for the unlabeled dependency task.\n        A graph with all weights for possible dependencies is built \n        and the final answer is obtained applying the Chu-Liu-Edmond's\n        algorithm.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency = {"_tag_sentence_unlabeled_dependency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence_unlabeled_dependency (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_heads,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyArrayObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 87, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 87, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_tag_sentence_unlabeled_dependency") < 0)) __PYX_ERR(5, 87, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence_unlabeled_dependency", 0, 1, 2, __pyx_nargs); __PYX_ERR(5, 87, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 87, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 87, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads) {
  PyObject *__pyx_v_training = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyArrayObject *__pyx_v_token_scores = 0;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_answer = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_token_scores;
  __Pyx_Buffer __pyx_pybuffer_token_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__70)
  __Pyx_RefNannySetupContext("_tag_sentence_unlabeled_dependency", 1);
  __Pyx_TraceCall("_tag_sentence_unlabeled_dependency", __pyx_f[5], 87, 0, __PYX_ERR(5, 87, __pyx_L1_error));
  __pyx_pybuffer_token_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_token_scores.refcount = 0;
  __pyx_pybuffernd_token_scores.data = NULL;
  __pyx_pybuffernd_token_scores.rcbuffer = &__pyx_pybuffer_token_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":94
 *         algorithm.
 *         """
 *         training = heads is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_heads) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_training = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":95
 *         """
 *         training = heads is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         num_tokens = len(sentence)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pre_tagging_setup); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":97
 *         self._pre_tagging_setup(sentence, training)
 * 
 *         num_tokens = len(sentence)             # <<<<<<<<<<<<<<
 *         # dependency_weights [i, j] has the score for token i having j as a head.
 *         # the main diagonal has the values for dependencies from the root and is
 */
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_num_tokens = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":101
 *         # the main diagonal has the values for dependencies from the root and is
 *         # later copied to the last column for easier processing
 *         self.dependency_weights = np.empty((num_tokens, num_tokens + 1))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] token_scores
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_num_tokens, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_num_tokens);
  __Pyx_GIVEREF(__pyx_v_num_tokens);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_num_tokens)) __PYX_ERR(5, 101, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(5, 101, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->dependency_weights);
  __pyx_v_self->dependency_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":108
 *         # sentence tokens are scored with respect to it (in order to determine the
 *         # dependency weights)
 *         for token in range(num_tokens):             # <<<<<<<<<<<<<<
 * 
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_num_tokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 108, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(5, 108, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":112
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,             # <<<<<<<<<<<<<<
 *                                                       training=training).reshape(num_tokens)
 *             self.dependency_weights[token, :-1] = token_scores
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sentence_convolution); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_sentence);
    __Pyx_GIVEREF((PyObject *)__pyx_v_sentence);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_sentence))) __PYX_ERR(5, 112, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_token);
    __Pyx_GIVEREF(__pyx_v_token);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_token)) __PYX_ERR(5, 112, __pyx_L1_error);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":113
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,
 *                                                       training=training).reshape(num_tokens)             # <<<<<<<<<<<<<<
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 */
    __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_training, __pyx_v_training) < 0) __PYX_ERR(5, 113, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":112
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,             # <<<<<<<<<<<<<<
 *                                                       training=training).reshape(num_tokens)
 *             self.dependency_weights[token, :-1] = token_scores
 */
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":113
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,
 *                                                       training=training).reshape(num_tokens)             # <<<<<<<<<<<<<<
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_num_tokens};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 113, __pyx_L1_error)
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_token_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        }
        __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
      }
      __pyx_pybuffernd_token_scores.diminfo[0].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_token_scores.diminfo[0].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(5, 112, __pyx_L1_error)
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_token_scores, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":114
 *             token_scores = self._sentence_convolution(sentence, token,
 *                                                       training=training).reshape(num_tokens)
 *             self.dependency_weights[token, :-1] = token_scores             # <<<<<<<<<<<<<<
 * 
 *             if training:
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_token);
    __Pyx_GIVEREF(__pyx_v_token);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_token)) __PYX_ERR(5, 114, __pyx_L1_error);
    __Pyx_INCREF(__pyx_slice__12);
    __Pyx_GIVEREF(__pyx_slice__12);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__12)) __PYX_ERR(5, 114, __pyx_L1_error);
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_2, ((PyObject *)__pyx_v_token_scores)) < 0))) __PYX_ERR(5, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":116
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 head = heads[token]
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 116, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":117
 * 
 *             if training:
 *                 head = heads[token]             # <<<<<<<<<<<<<<
 * 
 *                 if self._calculate_gradients(head, token_scores):
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_heads), __pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":119
 *                 head = heads[token]
 * 
 *                 if self._calculate_gradients(head, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_head, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 119, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 119, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":120
 * 
 *                 if self._calculate_gradients(head, token_scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backpropagate); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 120, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":121
 *                 if self._calculate_gradients(head, token_scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(token)
 *                     self._adjust_features(sentence, token)
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_input_deltas); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_sentence), __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":122
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, token)
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_weights); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 122, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 122, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":123
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)
 *                     self._adjust_features(sentence, token)             # <<<<<<<<<<<<<<
 * 
 *         # copy dependency weights from the root to each token to the last column and
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_features); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 123, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_sentence), __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 123, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":119
 *                 head = heads[token]
 * 
 *                 if self._calculate_gradients(head, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
 */
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":116
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 head = heads[token]
 * 
 */
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":108
 *         # sentence tokens are scored with respect to it (in order to determine the
 *         # dependency weights)
 *         for token in range(num_tokens):             # <<<<<<<<<<<<<<
 * 
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":128
 *         # effectively ignore the main diagonal (dependency to the token itself)
 *         self.dependency_weights[np.arange(num_tokens),
 *                                 -1] = self.dependency_weights.diagonal()             # <<<<<<<<<<<<<<
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
 *         answer = self._find_maximum_spanning_tree()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dependency_weights), __pyx_n_s_diagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":127
 *         # copy dependency weights from the root to each token to the last column and
 *         # effectively ignore the main diagonal (dependency to the token itself)
 *         self.dependency_weights[np.arange(num_tokens),             # <<<<<<<<<<<<<<
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_num_tokens};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(5, 127, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_neg_1)) __PYX_ERR(5, 127, __pyx_L1_error);
  __pyx_t_2 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_10, __pyx_t_4) < 0))) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":129
 *         self.dependency_weights[np.arange(num_tokens),
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)             # <<<<<<<<<<<<<<
 *         answer = self._find_maximum_spanning_tree()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_fill_diagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Negative(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_10};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":130
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
 *         answer = self._find_maximum_spanning_tree()             # <<<<<<<<<<<<<<
 * 
 *         return answer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find_maximum_spanning_tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_answer = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":132
 *         answer = self._find_maximum_spanning_tree()
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF((PyObject *)__pyx_v_token_scores);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency, "ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency(self, ndarray sentence, ndarray heads, ndarray labels=None)\n\n        Run the network for labeling pre determined dependency edges between tokens.\n        This is similar to the classification step in SRL.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency = {"_tag_sentence_labeled_dependency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  PyArrayObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence_labeled_dependency (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_heads,&__pyx_n_s_labels,0};

    /* "nltkor/tag/libs/networkdependencyconv.pyx":135
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,
 *                                          np.ndarray labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for labeling pre determined dependency edges between tokens.
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyArrayObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 134, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 134, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_tag_sentence_labeled_dependency", 0, 2, 3, 1); __PYX_ERR(5, 134, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_labels);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 134, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_tag_sentence_labeled_dependency") < 0)) __PYX_ERR(5, 134, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
    __pyx_v_labels = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence_labeled_dependency", 0, 2, 3, __pyx_nargs); __PYX_ERR(5, 134, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 134, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 134, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(5, 135, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads, __pyx_v_labels);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads, PyArrayObject *__pyx_v_labels) {
  PyArrayObject *__pyx_v_answer = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyObject *__pyx_v_training = NULL;
  Py_ssize_t __pyx_v_token;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_label = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_answer;
  __Pyx_Buffer __pyx_pybuffer_answer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyArrayObject *__pyx_t_15 = NULL;
  __pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__71)
  __Pyx_RefNannySetupContext("_tag_sentence_labeled_dependency", 1);
  __Pyx_TraceCall("_tag_sentence_labeled_dependency", __pyx_f[5], 134, 0, __PYX_ERR(5, 134, __pyx_L1_error));
  __pyx_pybuffer_answer.pybuffer.buf = NULL;
  __pyx_pybuffer_answer.refcount = 0;
  __pyx_pybuffernd_answer.data = NULL;
  __pyx_pybuffernd_answer.rcbuffer = &__pyx_pybuffer_answer;
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":142
 *         cdef np.ndarray[FLOAT_t, ndim=1] answer
 *         cdef np.ndarray[FLOAT_t, ndim=2] scores
 *         training = labels is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_labels) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_training = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":143
 *         cdef np.ndarray[FLOAT_t, ndim=2] scores
 *         training = labels is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         answer = np.zeros(len(sentence))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pre_tagging_setup); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":145
 *         self._pre_tagging_setup(sentence, training)
 * 
 *         answer = np.zeros(len(sentence))             # <<<<<<<<<<<<<<
 * 
 *         # as in unlabeled dependency, each token is treated as a predicate from the
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(5, 145, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 145, __pyx_L1_error)
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_answer.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_answer.rcbuffer->pybuffer, (PyObject*)__pyx_v_answer, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_answer.diminfo[0].strides = __pyx_pybuffernd_answer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_answer.diminfo[0].shape = __pyx_pybuffernd_answer.rcbuffer->pybuffer.shape[0];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(5, 145, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_v_answer = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":149
 *         # as in unlabeled dependency, each token is treated as a predicate from the
 *         # SRL point of view. The only target is its head
 *         for token in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             head = heads[token]
 * 
 */
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(5, 149, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_6;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_token = __pyx_t_14;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":150
 *         # SRL point of view. The only target is its head
 *         for token in range(len(sentence)):
 *             head = heads[token]             # <<<<<<<<<<<<<<
 * 
 *             # weird format just to take advantage of the SRL classification code
 */
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_heads), __pyx_v_token, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":154
 *             # weird format just to take advantage of the SRL classification code
 *             # it means that the target starts at position *head* and ends at *head*
 *             head = [[head, head]]             # <<<<<<<<<<<<<<
 * 
 *             # it will return a 2-dim array, but we only have one target
 */
    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_head);
    __Pyx_GIVEREF(__pyx_v_head);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_head)) __PYX_ERR(5, 154, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_head);
    __Pyx_GIVEREF(__pyx_v_head);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_head)) __PYX_ERR(5, 154, __pyx_L1_error);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(5, 154, __pyx_L1_error);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_head, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":158
 *             # it will return a 2-dim array, but we only have one target
 *             # argmax() works as expected
 *             scores = self._sentence_convolution(sentence, token, head, training)             # <<<<<<<<<<<<<<
 *             answer[token] = scores.argmax()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sentence_convolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_7, ((PyObject *)__pyx_v_sentence), __pyx_t_3, __pyx_v_head, __pyx_v_training};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 158, __pyx_L1_error)
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(5, 158, __pyx_L1_error)
    }
    __pyx_t_15 = 0;
    __Pyx_XDECREF_SET(__pyx_v_scores, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":159
 *             # argmax() works as expected
 *             scores = self._sentence_convolution(sentence, token, head, training)
 *             answer[token] = scores.argmax()             # <<<<<<<<<<<<<<
 * 
 *             if training:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(5, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __pyx_v_token;
    __pyx_t_9 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_answer.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_answer.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      __PYX_ERR(5, 159, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t *, __pyx_pybuffernd_answer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_answer.diminfo[0].strides) = __pyx_t_16;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":161
 *             answer[token] = scores.argmax()
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 161, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":162
 * 
 *             if training:
 *                 label = labels[token]             # <<<<<<<<<<<<<<
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()
 */
      __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_labels), __pyx_v_token, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":163
 *             if training:
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_gradients_classify); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_label);
      __Pyx_GIVEREF(__pyx_v_label);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_label)) __PYX_ERR(5, 163, __pyx_L1_error);
      __pyx_t_7 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_v_scores)};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 163, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":164
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backpropagate); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":165
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(token, head)
 *                     self._adjust_features(sentence, token)
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_input_deltas); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, ((PyObject *)__pyx_v_sentence), __pyx_t_3, __pyx_v_head};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":166
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, token)
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_weights); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_3, __pyx_v_head};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":167
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)
 *                     self._adjust_features(sentence, token)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_adjust_features); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, ((PyObject *)__pyx_v_sentence), __pyx_t_3};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":163
 *             if training:
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
 */
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":161
 *             answer[token] = scores.argmax()
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
 */
    }
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":170
 * 
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients(self, gold_head, scores):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_answer);
  __pyx_r = ((PyObject *)__pyx_v_answer);
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_answer);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients, "ConvolutionalDependencyNetwork._calculate_gradients(self, gold_head, scores)\n\n        Calculate the gradients to be applied in the backpropagation. Gradients\n        are calculated after the network has output the scores for assigning \n        each token as head of a given token. \n        \n        We aim at maximizing the log probability of the right head:\n        log(p(head)) = score(head) - logadd(scores for all heads)\n        \n        :param gold_head: the index of the token that should have the highest \n            score\n        :param scores: the scores output by the network\n        :returns: if True, normal gradient calculation was performed.\n            If False, the error was too low and weight correction should be\n            skipped. \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients = {"_calculate_gradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gold_head = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gold_head,&__pyx_n_s_scores,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gold_head)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 172, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scores)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 172, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, 1); __PYX_ERR(5, 172, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calculate_gradients") < 0)) __PYX_ERR(5, 172, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gold_head = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_gold_head, __pyx_v_scores);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_gold_head, PyObject *__pyx_v_scores) {
  PyArrayObject *__pyx_v_exp_scores = 0;
  PyObject *__pyx_v_exp_sum = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_new_shape = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_exp_scores;
  __Pyx_Buffer __pyx_pybuffer_exp_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyArrayObject *__pyx_t_5 = NULL;
  float __pyx_t_6;
  int __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  npy_intp *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__72)
  __Pyx_RefNannySetupContext("_calculate_gradients", 1);
  __Pyx_TraceCall("_calculate_gradients", __pyx_f[5], 172, 0, __PYX_ERR(5, 172, __pyx_L1_error));
  __pyx_pybuffer_exp_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_exp_scores.refcount = 0;
  __pyx_pybuffernd_exp_scores.data = NULL;
  __pyx_pybuffernd_exp_scores.rcbuffer = &__pyx_pybuffer_exp_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":191
 *         # -exp(score(token)) / sum_j exp(score(token_j))
 *         # i.e., the negative of its probability
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)             # <<<<<<<<<<<<<<
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 191, __pyx_L1_error)
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_exp_scores = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(5, 191, __pyx_L1_error)
    } else {__pyx_pybuffernd_exp_scores.diminfo[0].strides = __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exp_scores.diminfo[0].shape = __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_5 = 0;
  __pyx_v_exp_scores = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":192
 *         # i.e., the negative of its probability
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)
 *         exp_sum = np.sum(exp_scores)             # <<<<<<<<<<<<<<
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_exp_scores)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_exp_sum = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":193
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum             # <<<<<<<<<<<<<<
 *         error = 1 + self.net_gradients[gold_head]
 *         self.error += error
 */
  __pyx_t_1 = PyNumber_Negative(((PyObject *)__pyx_v_exp_scores)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_exp_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":194
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]             # <<<<<<<<<<<<<<
 *         self.error += error
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients), __pyx_v_gold_head); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_error = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":195
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         # check if the error is too small - if so, not worth to continue
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base.__pyx_base.error = __pyx_t_6;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":198
 * 
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_error, __pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 198, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_7) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":199
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:
 *             self.skips += 1             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_v_self->__pyx_base.__pyx_base.skips = (__pyx_v_self->__pyx_base.__pyx_base.skips + 1);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":200
 *         if error <= 0.01:
 *             self.skips += 1
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # and add 1 to the right head
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":198
 * 
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
 */
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":203
 * 
 *         # and add 1 to the right head
 *         self.net_gradients[gold_head] += 1             # <<<<<<<<<<<<<<
 * 
 *         # the ConvolutionalNetwork class deals with multi dimensional gradients
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx_base.net_gradients;
  __Pyx_INCREF(__pyx_v_gold_head);
  __pyx_t_2 = __pyx_v_gold_head;
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_8), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_8), __pyx_t_2, __pyx_t_3) < 0))) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":207
 *         # the ConvolutionalNetwork class deals with multi dimensional gradients
 *         # (because of more than one output neuron), so let's reshape
 *         new_shape = (self.net_gradients.shape[0], 1)             # <<<<<<<<<<<<<<
 *         self.net_gradients = self.net_gradients.reshape(new_shape)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_9 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_t_9[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(5, 207, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1)) __PYX_ERR(5, 207, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_v_new_shape = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":208
 *         # (because of more than one output neuron), so let's reshape
 *         new_shape = (self.net_gradients.shape[0], 1)
 *         self.net_gradients = self.net_gradients.reshape(new_shape)             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients), __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_new_shape};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 208, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":210
 *         self.net_gradients = self.net_gradients.reshape(new_shape)
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF((PyObject *)__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_exp_scores);
  __Pyx_XDECREF(__pyx_v_exp_sum);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_new_shape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate, "ConvolutionalDependencyNetwork._validate(self)\n\n        Evaluate the network performance by token hit and whole sentence hit.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate = {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_validate", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyObject *__pyx_v_sentence_hits = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_heads = NULL;
  int __pyx_v_sentence_hit;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_gold_tags = NULL;
  Py_ssize_t __pyx_v_j;
  PyObject *__pyx_v_net_tag = NULL;
  PyObject *__pyx_v_gold_tag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  float __pyx_t_14;
  double __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__73)
  __Pyx_RefNannySetupContext("_validate", 1);
  __Pyx_TraceCall("_validate", __pyx_f[5], 212, 0, __PYX_ERR(5, 212, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":216
 *         Evaluate the network performance by token hit and whole sentence hit.
 *         """
 *         hits = 0             # <<<<<<<<<<<<<<
 *         num_tokens = 0
 *         sentence_hits = 0
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_hits = __pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":217
 *         """
 *         hits = 0
 *         num_tokens = 0             # <<<<<<<<<<<<<<
 *         sentence_hits = 0
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_num_tokens = __pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":218
 *         hits = 0
 *         num_tokens = 0
 *         sentence_hits = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(self.validation_sentences)):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_sentence_hits = __pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":220
 *         sentence_hits = 0
 * 
 *         for i in range(len(self.validation_sentences)):             # <<<<<<<<<<<<<<
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.validation_sentences;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(5, 220, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":221
 * 
 *         for i in range(len(self.validation_sentences)):
 *             sent = self.validation_sentences[i]             # <<<<<<<<<<<<<<
 *             heads = self.validation_heads[i]
 *             sentence_hit = True
 */
    if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(5, 221, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":222
 *         for i in range(len(self.validation_sentences)):
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]             # <<<<<<<<<<<<<<
 *             sentence_hit = True
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->validation_heads, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_heads, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":223
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]
 *             sentence_hit = True             # <<<<<<<<<<<<<<
 * 
 *             if self.validation_tags is None:
 */
    __pyx_v_sentence_hit = 1;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":225
 *             sentence_hit = True
 * 
 *             if self.validation_tags is None:             # <<<<<<<<<<<<<<
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
 */
    __pyx_t_5 = (__pyx_v_self->__pyx_base.__pyx_base.validation_tags == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":227
 *             if self.validation_tags is None:
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)             # <<<<<<<<<<<<<<
 *                 gold_tags = heads
 *             else:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_unlabeled_dependen); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_sent};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":228
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
 *                 gold_tags = heads             # <<<<<<<<<<<<<<
 *             else:
 *                 # labeled dependency
 */
      __Pyx_INCREF(__pyx_v_heads);
      __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_v_heads);

      /* "nltkor/tag/libs/networkdependencyconv.pyx":225
 *             sentence_hit = True
 * 
 *             if self.validation_tags is None:             # <<<<<<<<<<<<<<
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
 */
      goto __pyx_L5;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":231
 *             else:
 *                 # labeled dependency
 *                 gold_tags = self.validation_tags[i]             # <<<<<<<<<<<<<<
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)
 * 
 */
    /*else*/ {
      if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.validation_tags == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 231, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->__pyx_base.__pyx_base.validation_tags, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":232
 *                 # labeled dependency
 *                 gold_tags = self.validation_tags[i]
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)             # <<<<<<<<<<<<<<
 * 
 *             for j in range(len(gold_tags)):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_labeled_dependency); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_sent, __pyx_v_heads};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":234
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)
 * 
 *             for j in range(len(gold_tags)):             # <<<<<<<<<<<<<<
 *                 net_tag = answer[j]
 *                 gold_tag = gold_tags[j]
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_gold_tags); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(5, 234, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_j = __pyx_t_11;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":235
 * 
 *             for j in range(len(gold_tags)):
 *                 net_tag = answer[j]             # <<<<<<<<<<<<<<
 *                 gold_tag = gold_tags[j]
 * 
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_answer, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_net_tag, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":236
 *             for j in range(len(gold_tags)):
 *                 net_tag = answer[j]
 *                 gold_tag = gold_tags[j]             # <<<<<<<<<<<<<<
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_gold_tags, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_gold_tag, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":238
 *                 gold_tag = gold_tags[j]
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):             # <<<<<<<<<<<<<<
 *                     hits += 1
 *                 else:
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_v_gold_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_12) {
      } else {
        __pyx_t_5 = __pyx_t_12;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_gold_tag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_5 = __pyx_t_12;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_13 = PyObject_Length(__pyx_v_sent); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(5, 238, __pyx_L1_error)
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __pyx_t_12;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_5) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":239
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):
 *                     hits += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     sentence_hit = False
 */
        __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_hits, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":238
 *                 gold_tag = gold_tags[j]
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):             # <<<<<<<<<<<<<<
 *                     hits += 1
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":241
 *                     hits += 1
 *                 else:
 *                     sentence_hit = False             # <<<<<<<<<<<<<<
 * 
 *             if sentence_hit:
 */
      /*else*/ {
        __pyx_v_sentence_hit = 0;
      }
      __pyx_L8:;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":243
 *                     sentence_hit = False
 * 
 *             if sentence_hit:             # <<<<<<<<<<<<<<
 *                 sentence_hits += 1
 *             num_tokens += len(sent)
 */
    if (__pyx_v_sentence_hit) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":244
 * 
 *             if sentence_hit:
 *                 sentence_hits += 1             # <<<<<<<<<<<<<<
 *             num_tokens += len(sent)
 * 
 */
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_sentence_hits, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_sentence_hits, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":243
 *                     sentence_hit = False
 * 
 *             if sentence_hit:             # <<<<<<<<<<<<<<
 *                 sentence_hits += 1
 *             num_tokens += len(sent)
 */
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":245
 *             if sentence_hit:
 *                 sentence_hits += 1
 *             num_tokens += len(sent)             # <<<<<<<<<<<<<<
 * 
 *         self.accuracy = float(hits) / num_tokens
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_sent); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(5, 245, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_num_tokens, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_num_tokens, __pyx_t_6);
    __pyx_t_6 = 0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":247
 *             num_tokens += len(sent)
 * 
 *         self.accuracy = float(hits) / num_tokens             # <<<<<<<<<<<<<<
 *         self.sentence_accuracy = float(sentence_hits) / len(self.validation_sentences)
 * 
 */
  __pyx_t_6 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_num_tokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base.__pyx_base.accuracy = __pyx_t_14;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":248
 * 
 *         self.accuracy = float(hits) / num_tokens
 *         self.sentence_accuracy = float(sentence_hits) / len(self.validation_sentences)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_v_sentence_hits); if (unlikely(__pyx_t_15 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(5, 248, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.validation_sentences;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(5, 248, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(5, 248, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy = (__pyx_t_15 / ((double)__pyx_t_2));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF(__pyx_v_sentence_hits);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_heads);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_gold_tags);
  __Pyx_XDECREF(__pyx_v_net_tag);
  __Pyx_XDECREF(__pyx_v_gold_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error, "ConvolutionalDependencyNetwork._average_error(self)\n\n        Average the network error over tokens.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error = {"_average_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_average_error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_average_error", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_average_error", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__74)
  __Pyx_RefNannySetupContext("_average_error", 1);
  __Pyx_TraceCall("_average_error", __pyx_f[5], 251, 0, __PYX_ERR(5, 251, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":255
 *         Average the network error over tokens.
 *         """
 *         self.error = self.error / self.num_tokens             # <<<<<<<<<<<<<<
 * 
 *     def _print_epoch_report(self, int num):
 */
  if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.num_tokens == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(5, 255, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base.error = (__pyx_v_self->__pyx_base.__pyx_base.error / ((float)__pyx_v_self->__pyx_base.__pyx_base.num_tokens));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._average_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report, "ConvolutionalDependencyNetwork._print_epoch_report(self, int num)\n\n        Reports the status of the network in the given training\n        epoch, including error, token and sentence accuracy.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report = {"_print_epoch_report", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_print_epoch_report (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 257, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_print_epoch_report") < 0)) __PYX_ERR(5, 257, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_num = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 257, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_num);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, int __pyx_v_num) {
  PyObject *__pyx_v_logger = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__75)
  __Pyx_RefNannySetupContext("_print_epoch_report", 1);
  __Pyx_TraceCall("_print_epoch_report", __pyx_f[5], 257, 0, __PYX_ERR(5, 257, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":262
 *         epoch, including error, token and sentence accuracy.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \
 *                     "Sentence accuracy: %f    " \
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":263
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \             # <<<<<<<<<<<<<<
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_logger, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":266
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
 *                     "Learning rate: %f"  % (num,             # <<<<<<<<<<<<<<
 *                                             self.error,
 *                                             self.accuracy,
 */
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_epochs_Error);
  __pyx_t_5 += 17;
  __Pyx_GIVEREF(__pyx_kp_u_epochs_Error);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_epochs_Error);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":267
 *                     "%d corrections skipped   " \
 *                     "Learning rate: %f"  % (num,
 *                                             self.error,             # <<<<<<<<<<<<<<
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_Token_accuracy);
  __pyx_t_5 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_Token_accuracy);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u_Token_accuracy);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":268
 *                     "Learning rate: %f"  % (num,
 *                                             self.error,
 *                                             self.accuracy,             # <<<<<<<<<<<<<<
 *                                             self.sentence_accuracy,
 *                                             self.skips,
 */
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.accuracy); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_8, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_Sentence_accuracy);
  __pyx_t_5 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_Sentence_accuracy);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u_Sentence_accuracy);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":269
 *                                             self.error,
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,             # <<<<<<<<<<<<<<
 *                                             self.skips,
 *                                             self.learning_rate))
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u__76);
  __pyx_t_5 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__76);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u__76);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":270
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,
 *                                             self.skips,             # <<<<<<<<<<<<<<
 *                                             self.learning_rate))
 * 
 */
  __pyx_t_8 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.__pyx_base.skips, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_corrections_skipped_Learning_ra);
  __pyx_t_5 += 38;
  __Pyx_GIVEREF(__pyx_kp_u_corrections_skipped_Learning_ra);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_kp_u_corrections_skipped_Learning_ra);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":271
 *                                             self.sentence_accuracy,
 *                                             self.skips,
 *                                             self.learning_rate))             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):
 */
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_8, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":263
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \             # <<<<<<<<<<<<<<
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence, "ConvolutionalDependencyNetwork.tag_sentence(self, ndarray sentence, ndarray heads=None)\n\n        If heads is not given, compute the dependency edges in the sentence.\n        If it is given, compute the label of each dependency.\n        \n        :returns: a numpy 1-dim array with the head for each token or label\n            of each edge. In the first case, a dependency from the root is \n            represented as a value equal to the sentence length. \n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence = {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentence,&__pyx_n_s_heads,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((PyArrayObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sentence)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 273, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 273, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tag_sentence") < 0)) __PYX_ERR(5, 273, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 1, 2, __pyx_nargs); __PYX_ERR(5, 273, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 273, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 273, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__77)
  __Pyx_RefNannySetupContext("tag_sentence", 1);
  __Pyx_TraceCall("tag_sentence", __pyx_f[5], 273, 0, __PYX_ERR(5, 273, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":282
 *             represented as a value equal to the sentence length.
 *         """
 *         if heads is None:             # <<<<<<<<<<<<<<
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_heads) == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":283
 *         """
 *         if heads is None:
 *             return self._tag_sentence_unlabeled_dependency(sentence)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_unlabeled_dependen); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_sentence)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":282
 *             represented as a value equal to the sentence length.
 *         """
 *         if heads is None:             # <<<<<<<<<<<<<<
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
 */
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":285
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
 *             return self._tag_sentence_labeled_dependency(sentence, heads)             # <<<<<<<<<<<<<<
 * 
 *     def _find_cycles(self, np.ndarray graph):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag_sentence_labeled_dependency); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_sentence), ((PyObject *)__pyx_v_heads)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles, "ConvolutionalDependencyNetwork._find_cycles(self, ndarray graph)\n\n        Check if the given graph has cycles and returns the first one\n        to be found.\n        \n        :param graph: an array where graph[i] has the number of a\n            vertex with an incoming connection to i\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles = {"_find_cycles", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_graph = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_cycles (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_graph)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 287, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_find_cycles") < 0)) __PYX_ERR(5, 287, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_graph = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_cycles", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 287, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_graph), __pyx_ptype_5numpy_ndarray, 1, "graph", 0))) __PYX_ERR(5, 287, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_graph);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph) {
  PyObject *__pyx_v_reachable_vertices = NULL;
  PyObject *__pyx_v_vertices_in_cycles = NULL;
  PyObject *__pyx_v_visited = NULL;
  PyObject *__pyx_v_cycles = NULL;
  Py_ssize_t __pyx_v_vertex;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__78)
  __Pyx_RefNannySetupContext("_find_cycles", 1);
  __Pyx_TraceCall("_find_cycles", __pyx_f[5], 287, 0, __PYX_ERR(5, 287, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":296
 *         """
 *         # this set stores all vertices with a valid path to the root
 *         reachable_vertices = set()             # <<<<<<<<<<<<<<
 * 
 *         # vertices known to be unreachable from the root, i.e., in a cycle
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reachable_vertices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":299
 * 
 *         # vertices known to be unreachable from the root, i.e., in a cycle
 *         vertices_in_cycles = set()             # <<<<<<<<<<<<<<
 * 
 *         # vertices currently being evaluated, not known if they're reachable
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertices_in_cycles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":302
 * 
 *         # vertices currently being evaluated, not known if they're reachable
 *         visited = set()             # <<<<<<<<<<<<<<
 * 
 *         cycles = []
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_visited = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":304
 *         visited = set()
 * 
 *         cycles = []             # <<<<<<<<<<<<<<
 * 
 *         # the directions of the edges don't matter if we only want to find cycles
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cycles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":307
 * 
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):             # <<<<<<<<<<<<<<
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:
 *                 continue
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_graph)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 307, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_vertex = __pyx_t_4;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":308
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_reachable_vertices, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_vertices_in_cycles, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":309
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 */
      goto __pyx_L3_continue;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":308
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":311
 *                 continue
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,             # <<<<<<<<<<<<<<
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find_cycle_recursive); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":312
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)             # <<<<<<<<<<<<<<
 *             if cycle is not None:
 *                 cycles.append(cycle)
 */
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_9, ((PyObject *)__pyx_v_graph), __pyx_t_8, __pyx_v_visited, __pyx_v_reachable_vertices, __pyx_v_vertices_in_cycles};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 5+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cycle, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":313
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:             # <<<<<<<<<<<<<<
 *                 cycles.append(cycle)
 * 
 */
    __pyx_t_5 = (__pyx_v_cycle != Py_None);
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":314
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:
 *                 cycles.append(cycle)             # <<<<<<<<<<<<<<
 * 
 *         return cycles
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cycles, __pyx_v_cycle); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(5, 314, __pyx_L1_error)

      /* "nltkor/tag/libs/networkdependencyconv.pyx":313
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:             # <<<<<<<<<<<<<<
 *                 cycles.append(cycle)
 * 
 */
    }
    __pyx_L3_continue:;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":316
 *                 cycles.append(cycle)
 * 
 *         return cycles             # <<<<<<<<<<<<<<
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cycles);
  __pyx_r = __pyx_v_cycles;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reachable_vertices);
  __Pyx_XDECREF(__pyx_v_vertices_in_cycles);
  __Pyx_XDECREF(__pyx_v_visited);
  __Pyx_XDECREF(__pyx_v_cycles);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive, "ConvolutionalDependencyNetwork._find_cycle_recursive(self, ndarray graph, int vertex, set visited, set reachable, set unreachable)\n\n        Auxiliary recursive function for searching the graph for cycles.\n        It returns the first cycle it can find starting from the given\n        vertex, or None.\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive = {"_find_cycle_recursive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_graph = 0;
  int __pyx_v_vertex;
  PyObject *__pyx_v_visited = 0;
  PyObject *__pyx_v_reachable = 0;
  PyObject *__pyx_v_unreachable = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_cycle_recursive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph,&__pyx_n_s_vertex,&__pyx_n_s_visited,&__pyx_n_s_reachable,&__pyx_n_s_unreachable,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_graph)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vertex)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, 1); __PYX_ERR(5, 318, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_visited)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, 2); __PYX_ERR(5, 318, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reachable)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, 3); __PYX_ERR(5, 318, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unreachable)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, 4); __PYX_ERR(5, 318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_find_cycle_recursive") < 0)) __PYX_ERR(5, 318, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
    }
    __pyx_v_graph = ((PyArrayObject *)values[0]);
    __pyx_v_vertex = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_vertex == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
    __pyx_v_visited = ((PyObject*)values[2]);
    __pyx_v_reachable = ((PyObject*)values[3]);
    __pyx_v_unreachable = ((PyObject*)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, __pyx_nargs); __PYX_ERR(5, 318, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycle_recursive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_graph), __pyx_ptype_5numpy_ndarray, 1, "graph", 0))) __PYX_ERR(5, 318, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_visited), (&PySet_Type), 1, "visited", 1))) __PYX_ERR(5, 318, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reachable), (&PySet_Type), 1, "reachable", 1))) __PYX_ERR(5, 319, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unreachable), (&PySet_Type), 1, "unreachable", 1))) __PYX_ERR(5, 319, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_graph, __pyx_v_vertex, __pyx_v_visited, __pyx_v_reachable, __pyx_v_unreachable);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph, int __pyx_v_vertex, PyObject *__pyx_v_visited, PyObject *__pyx_v_reachable, PyObject *__pyx_v_unreachable) {
  PyObject *__pyx_v_next_vertex = NULL;
  Py_ssize_t __pyx_v_root;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__79)
  __Pyx_RefNannySetupContext("_find_cycle_recursive", 1);
  __Pyx_TraceCall("_find_cycle_recursive", __pyx_f[5], 318, 0, __PYX_ERR(5, 318, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":325
 *         vertex, or None.
 *         """
 *         next_vertex = graph[vertex]             # <<<<<<<<<<<<<<
 *         root = len(graph)
 *         visited.add(vertex)
 */
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_graph), __pyx_v_vertex, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_next_vertex = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":326
 *         """
 *         next_vertex = graph[vertex]
 *         root = len(graph)             # <<<<<<<<<<<<<<
 *         visited.add(vertex)
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_graph)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 326, __pyx_L1_error)
  __pyx_v_root = __pyx_t_2;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":327
 *         next_vertex = graph[vertex]
 *         root = len(graph)
 *         visited.add(vertex)             # <<<<<<<<<<<<<<
 * 
 *         if next_vertex == root or next_vertex in reachable:
 */
  if (unlikely(__pyx_v_visited == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
    __PYX_ERR(5, 327, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PySet_Add(__pyx_v_visited, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":329
 *         visited.add(vertex)
 * 
 *         if next_vertex == root or next_vertex in reachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to root
 *             reachable.update(visited)
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_next_vertex, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(__pyx_v_reachable == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 329, __pyx_L1_error)
  }
  __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_reachable, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 329, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":331
 *         if next_vertex == root or next_vertex in reachable:
 *             # vertex linked to root
 *             reachable.update(visited)             # <<<<<<<<<<<<<<
 *             visited.clear()
 *             cycle = None
 */
    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_reachable, __pyx_v_visited); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":332
 *             # vertex linked to root
 *             reachable.update(visited)
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = None
 * 
 */
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 332, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 332, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":333
 *             reachable.update(visited)
 *             visited.clear()
 *             cycle = None             # <<<<<<<<<<<<<<
 * 
 *         elif next_vertex in visited:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_cycle = Py_None;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":329
 *         visited.add(vertex)
 * 
 *         if next_vertex == root or next_vertex in reachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to root
 *             reachable.update(visited)
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":335
 *             cycle = None
 * 
 *         elif next_vertex in visited:             # <<<<<<<<<<<<<<
 *             # cycle detected! return all vertices in it
 *             visited.clear()
 */
  if (unlikely(__pyx_v_visited == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 335, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_visited, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 335, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":337
 *         elif next_vertex in visited:
 *             # cycle detected! return all vertices in it
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = set([vertex])
 *             while next_vertex != vertex:
 */
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 337, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 337, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":338
 *             # cycle detected! return all vertices in it
 *             visited.clear()
 *             cycle = set([vertex])             # <<<<<<<<<<<<<<
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PySet_Add(__pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_cycle = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":339
 *             visited.clear()
 *             cycle = set([vertex])
 *             while next_vertex != vertex:             # <<<<<<<<<<<<<<
 *                 cycle.add(next_vertex)
 *                 next_vertex = graph[next_vertex]
 */
    while (1) {
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_next_vertex, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_4) break;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":340
 *             cycle = set([vertex])
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)             # <<<<<<<<<<<<<<
 *                 next_vertex = graph[next_vertex]
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cycle, __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_next_vertex};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":341
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)
 *                 next_vertex = graph[next_vertex]             # <<<<<<<<<<<<<<
 * 
 *             unreachable.update(cycle)
 */
      __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_graph), __pyx_v_next_vertex); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_next_vertex, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":343
 *                 next_vertex = graph[next_vertex]
 * 
 *             unreachable.update(cycle)             # <<<<<<<<<<<<<<
 * 
 *         elif next_vertex in unreachable:
 */
    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_unreachable, __pyx_v_cycle); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":335
 *             cycle = None
 * 
 *         elif next_vertex in visited:             # <<<<<<<<<<<<<<
 *             # cycle detected! return all vertices in it
 *             visited.clear()
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":345
 *             unreachable.update(cycle)
 * 
 *         elif next_vertex in unreachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
 */
  if (unlikely(__pyx_v_unreachable == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 345, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_unreachable, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 345, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":348
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = None
 * 
 */
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 348, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 348, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":349
 *             # (if it were, it should have been filtered out in _find_cycles)
 *             visited.clear()
 *             cycle = None             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_cycle = Py_None;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":345
 *             unreachable.update(cycle)
 * 
 *         elif next_vertex in unreachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
 */
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":353
 *         else:
 *             # continue checking
 *             cycle = self._find_cycle_recursive(graph, next_vertex, visited,             # <<<<<<<<<<<<<<
 *                                                reachable, unreachable)
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find_cycle_recursive); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":354
 *             # continue checking
 *             cycle = self._find_cycle_recursive(graph, next_vertex, visited,
 *                                                reachable, unreachable)             # <<<<<<<<<<<<<<
 * 
 *         return cycle
 */
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_7, ((PyObject *)__pyx_v_graph), __pyx_v_next_vertex, __pyx_v_visited, __pyx_v_reachable, __pyx_v_unreachable};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_cycle = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":356
 *                                                reachable, unreachable)
 * 
 *         return cycle             # <<<<<<<<<<<<<<
 * 
 *     def _contract_cycle(self, heads, cycle):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cycle);
  __pyx_r = __pyx_v_cycle;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycle_recursive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_next_vertex);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle, "ConvolutionalDependencyNetwork._contract_cycle(self, heads, cycle)\n\n        Contract the given cycle in the dependency graph.\n        \n        :param heads: list of the heads of each token, such that\n            heads[i] contains the head for the i-th token\n        :param cycle: a set containing the numbers of the vertices\n            in the cycle\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle = {"_contract_cycle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_cycle = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_contract_cycle (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_heads,&__pyx_n_s_cycle,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_heads)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 358, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cycle)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 358, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_contract_cycle", 1, 2, 2, 1); __PYX_ERR(5, 358, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contract_cycle") < 0)) __PYX_ERR(5, 358, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_heads = values[0];
    __pyx_v_cycle = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_contract_cycle", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 358, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._contract_cycle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_heads, __pyx_v_cycle);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_heads, PyObject *__pyx_v_cycle) {
  npy_intp __pyx_v_num_vertices;
  PyObject *__pyx_v_outside = NULL;
  PyArrayObject *__pyx_v_outgoing_weights = 0;
  PyObject *__pyx_v_outside_inds = NULL;
  PyObject *__pyx_v_max_outgoing_inds = NULL;
  PyObject *__pyx_v_max_outgoing_weights = NULL;
  PyObject *__pyx_v_cycle_inds = NULL;
  PyArrayObject *__pyx_v_incoming_weights = 0;
  PyObject *__pyx_v_cycle_score = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_v_head_to_v = NULL;
  PyObject *__pyx_v_max_incoming_inds = NULL;
  PyObject *__pyx_v_max_incoming_weights = NULL;
  PyObject *__pyx_v_new_head_ind = NULL;
  PyObject *__pyx_v_vertex_leaving_cycle_ind = NULL;
  PyObject *__pyx_v_new_head = NULL;
  PyObject *__pyx_v_vertex_leaving_cycle = NULL;
  PyObject *__pyx_v_old_head = NULL;
  npy_intp __pyx_9genexpr10__pyx_v_x;
  PyObject *__pyx_9genexpr11__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_incoming_weights;
  __Pyx_Buffer __pyx_pybuffer_incoming_weights;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_outgoing_weights;
  __Pyx_Buffer __pyx_pybuffer_outgoing_weights;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5;
  npy_intp __pyx_t_6;
  npy_intp __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  unsigned int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__80)
  __Pyx_RefNannySetupContext("_contract_cycle", 0);
  __Pyx_TraceCall("_contract_cycle", __pyx_f[5], 358, 0, __PYX_ERR(5, 358, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_cycle);
  __pyx_pybuffer_outgoing_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_outgoing_weights.refcount = 0;
  __pyx_pybuffernd_outgoing_weights.data = NULL;
  __pyx_pybuffernd_outgoing_weights.rcbuffer = &__pyx_pybuffer_outgoing_weights;
  __pyx_pybuffer_incoming_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_incoming_weights.refcount = 0;
  __pyx_pybuffernd_incoming_weights.data = NULL;
  __pyx_pybuffernd_incoming_weights.rcbuffer = &__pyx_pybuffer_incoming_weights;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":369
 *         # each cell i, j has the score for token i having j as its head.
 * 
 *         num_vertices = self.dependency_weights.shape[1]             # <<<<<<<<<<<<<<
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])
 *         cycle = np.array(list(cycle))
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_vertices = (__pyx_t_2[1]);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":370
 * 
 *         num_vertices = self.dependency_weights.shape[1]
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])             # <<<<<<<<<<<<<<
 *         cycle = np.array(list(cycle))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_v_num_vertices;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_9genexpr10__pyx_v_x = __pyx_t_7;
      __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t(__pyx_9genexpr10__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_8, __pyx_v_cycle, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(5, 370, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_9) {
        __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t(__pyx_9genexpr10__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(5, 370, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
  } /* exit inner scope */
  __pyx_t_8 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_outside = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":371
 *         num_vertices = self.dependency_weights.shape[1]
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])
 *         cycle = np.array(list(cycle))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=2] outgoing_weights
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_List(__pyx_v_cycle); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_cycle, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":379
 * 
 *         # if len(outside) == 1, it means all vertices except for the root are in a cycle
 *         if len(outside) > 1:             # <<<<<<<<<<<<<<
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
 */
  __pyx_t_11 = PyObject_Length(__pyx_v_outside); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(5, 379, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_11 > 1);
  if (__pyx_t_9) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":382
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
 *             outside_inds = np.array([[i] for i in outside[:-1]])             # <<<<<<<<<<<<<<
 *             outgoing_weights = self.dependency_weights[outside_inds, cycle]
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 382, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_outside, 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 382, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_12 = __pyx_t_8; __Pyx_INCREF(__pyx_t_12);
        __pyx_t_11 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 382, __pyx_L9_error)
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
            #else
            __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 382, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
              #endif
              if (__pyx_t_11 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
            #else
            __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 382, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_13(__pyx_t_12);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(5, 382, __pyx_L9_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_i, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_9genexpr11__pyx_v_i);
        __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_i);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr11__pyx_v_i)) __PYX_ERR(5, 382, __pyx_L9_error);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i); __pyx_9genexpr11__pyx_v_i = 0;
      goto __pyx_L13_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i); __pyx_9genexpr11__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_t_12 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_outside_inds = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":383
 *             # -1 because we can't take the root now
 *             outside_inds = np.array([[i] for i in outside[:-1]])
 *             outgoing_weights = self.dependency_weights[outside_inds, cycle]             # <<<<<<<<<<<<<<
 * 
 *             # the cycle should have only one outgoing edge for each vertex outside it
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_outside_inds);
    __Pyx_GIVEREF(__pyx_v_outside_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_outside_inds)) __PYX_ERR(5, 383, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_cycle);
    __Pyx_GIVEREF(__pyx_v_cycle);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cycle)) __PYX_ERR(5, 383, __pyx_L1_error);
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 383, __pyx_L1_error)
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_outgoing_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        }
        __pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0;
      }
      __pyx_pybuffernd_outgoing_weights.diminfo[0].strides = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outgoing_weights.diminfo[0].shape = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outgoing_weights.diminfo[1].strides = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outgoing_weights.diminfo[1].shape = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(5, 383, __pyx_L1_error)
    }
    __pyx_t_14 = 0;
    __pyx_v_outgoing_weights = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":387
 *             # the cycle should have only one outgoing edge for each vertex outside it
 *             # so, search the maximum outgoing edge to each outside vertex
 *             max_outgoing_inds = outgoing_weights.argmax(1)             # <<<<<<<<<<<<<<
 *             max_outgoing_weights = outgoing_weights.max(1)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_outgoing_weights), __pyx_n_s_argmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_max_outgoing_inds = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":388
 *             # so, search the maximum outgoing edge to each outside vertex
 *             max_outgoing_inds = outgoing_weights.argmax(1)
 *             max_outgoing_weights = outgoing_weights.max(1)             # <<<<<<<<<<<<<<
 * 
 *             # set every outgoing weight to -inf and then restore the highest ones
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_outgoing_weights), __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_max_outgoing_weights = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":391
 * 
 *             # set every outgoing weight to -inf and then restore the highest ones
 *             outgoing_weights[:] = -np.Infinity             # <<<<<<<<<<<<<<
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_outgoing_weights), __pyx_slice__8, __pyx_t_4) < 0))) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":392
 *             # set every outgoing weight to -inf and then restore the highest ones
 *             outgoing_weights[:] = -np.Infinity
 *             outgoing_weights[np.arange(len(outside_inds)),             # <<<<<<<<<<<<<<
 *                              max_outgoing_inds] = max_outgoing_weights
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = PyObject_Length(__pyx_v_outside_inds); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(5, 392, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":393
 *             outgoing_weights[:] = -np.Infinity
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights             # <<<<<<<<<<<<<<
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(5, 392, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_max_outgoing_inds);
    __Pyx_GIVEREF(__pyx_v_max_outgoing_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_max_outgoing_inds)) __PYX_ERR(5, 392, __pyx_L1_error);
    __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_outgoing_weights), __pyx_t_3, __pyx_v_max_outgoing_weights) < 0))) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":394
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights             # <<<<<<<<<<<<<<
 * 
 *         # now, adjust incoming edges. the incoming edge from each vertex v
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_outside_inds);
    __Pyx_GIVEREF(__pyx_v_outside_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_outside_inds)) __PYX_ERR(5, 394, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_cycle);
    __Pyx_GIVEREF(__pyx_v_cycle);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cycle)) __PYX_ERR(5, 394, __pyx_L1_error);
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3, ((PyObject *)__pyx_v_outgoing_weights)) < 0))) __PYX_ERR(5, 394, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":379
 * 
 *         # if len(outside) == 1, it means all vertices except for the root are in a cycle
 *         if len(outside) > 1:             # <<<<<<<<<<<<<<
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
 */
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":401
 *         # and then we pick the highest edge for each outside vertex
 *         # s(c) = sum_v s(head(v), v)
 *         cycle_inds = np.array([[i] for i in cycle])             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[FLOAT_t, ndim=2] incoming_weights
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 401, __pyx_L16_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_cycle)) || PyTuple_CheckExact(__pyx_v_cycle)) {
      __pyx_t_12 = __pyx_v_cycle; __Pyx_INCREF(__pyx_t_12);
      __pyx_t_11 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_cycle); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 401, __pyx_L16_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_12))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 401, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
            #endif
            if (__pyx_t_11 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 401, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_13(__pyx_t_12);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(5, 401, __pyx_L16_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_i, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_9genexpr12__pyx_v_i);
      __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_i);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr12__pyx_v_i)) __PYX_ERR(5, 401, __pyx_L16_error);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L20_exit_scope;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __pyx_t_12 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_cycle_inds = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":403
 *         cycle_inds = np.array([[i] for i in cycle])
 *         cdef np.ndarray[FLOAT_t, ndim=2] incoming_weights
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]             # <<<<<<<<<<<<<<
 * 
 *         cycle_score = 0
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_cycle_inds);
  __Pyx_GIVEREF(__pyx_v_cycle_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cycle_inds)) __PYX_ERR(5, 403, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_outside);
  __Pyx_GIVEREF(__pyx_v_outside);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outside)) __PYX_ERR(5, 403, __pyx_L1_error);
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 403, __pyx_L1_error)
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_incoming_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
      __pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0;
    }
    __pyx_pybuffernd_incoming_weights.diminfo[0].strides = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_incoming_weights.diminfo[0].shape = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_incoming_weights.diminfo[1].strides = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_incoming_weights.diminfo[1].shape = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(5, 403, __pyx_L1_error)
  }
  __pyx_t_19 = 0;
  __pyx_v_incoming_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":405
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]
 * 
 *         cycle_score = 0             # <<<<<<<<<<<<<<
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_cycle_score = __pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":406
 * 
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):             # <<<<<<<<<<<<<<
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_cycle)) || PyTuple_CheckExact(__pyx_v_cycle)) {
    __pyx_t_3 = __pyx_v_cycle; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_11 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_cycle); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 406, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_13(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(5, 406, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":407
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]             # <<<<<<<<<<<<<<
 *             cycle_score += head_to_v
 *             incoming_weights[i] -= head_to_v
 */
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_heads, __pyx_v_vertex); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_vertex);
    __Pyx_GIVEREF(__pyx_v_vertex);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_vertex)) __PYX_ERR(5, 407, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_head_to_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":408
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v             # <<<<<<<<<<<<<<
 *             incoming_weights[i] -= head_to_v
 * 
 */
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_cycle_score, __pyx_v_head_to_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_cycle_score, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":409
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
 *             incoming_weights[i] -= head_to_v             # <<<<<<<<<<<<<<
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)
 */
    __Pyx_INCREF(__pyx_v_i);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_12, __pyx_v_head_to_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_4, __pyx_t_8) < 0))) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":406
 * 
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):             # <<<<<<<<<<<<<<
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":411
 *             incoming_weights[i] -= head_to_v
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)             # <<<<<<<<<<<<<<
 *         max_incoming_weights = incoming_weights.max(0)
 *         # we leave the + s(c) to the end
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_incoming_weights), __pyx_n_s_argmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_max_incoming_inds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":412
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)
 *         max_incoming_weights = incoming_weights.max(0)             # <<<<<<<<<<<<<<
 *         # we leave the + s(c) to the end
 *         max_incoming_weights += cycle_score
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_incoming_weights), __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_max_incoming_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":414
 *         max_incoming_weights = incoming_weights.max(0)
 *         # we leave the + s(c) to the end
 *         max_incoming_weights += cycle_score             # <<<<<<<<<<<<<<
 * 
 *         # the vertex with the maximum weighted incoming edge now changes
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_incoming_weights, __pyx_v_cycle_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_max_incoming_weights, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":418
 *         # the vertex with the maximum weighted incoming edge now changes
 *         # its head, thus breaking the cycle
 *         new_head_ind = max_incoming_weights.argmax()             # <<<<<<<<<<<<<<
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_max_incoming_weights, __pyx_n_s_argmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_new_head_ind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":419
 *         # its head, thus breaking the cycle
 *         new_head_ind = max_incoming_weights.argmax()
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]             # <<<<<<<<<<<<<<
 * 
 *         new_head = outside[new_head_ind]
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_max_incoming_inds, __pyx_v_new_head_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertex_leaving_cycle_ind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":421
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]
 * 
 *         new_head = outside[new_head_ind]             # <<<<<<<<<<<<<<
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_outside, __pyx_v_new_head_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":422
 * 
 *         new_head = outside[new_head_ind]
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]             # <<<<<<<<<<<<<<
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_cycle, __pyx_v_vertex_leaving_cycle_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertex_leaving_cycle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":423
 *         new_head = outside[new_head_ind]
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]             # <<<<<<<<<<<<<<
 *         heads[vertex_leaving_cycle] = new_head
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_heads, __pyx_v_vertex_leaving_cycle); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_old_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":424
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head             # <<<<<<<<<<<<<<
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity
 * 
 */
  if (unlikely((PyObject_SetItem(__pyx_v_heads, __pyx_v_vertex_leaving_cycle, __pyx_v_new_head) < 0))) __PYX_ERR(5, 424, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":425
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity             # <<<<<<<<<<<<<<
 * 
 *         # analagous to the outgoing weights
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_vertex_leaving_cycle);
  __Pyx_GIVEREF(__pyx_v_vertex_leaving_cycle);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vertex_leaving_cycle)) __PYX_ERR(5, 425, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_old_head);
  __Pyx_GIVEREF(__pyx_v_old_head);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_old_head)) __PYX_ERR(5, 425, __pyx_L1_error);
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":428
 * 
 *         # analagous to the outgoing weights
 *         incoming_weights[:] = -np.Infinity             # <<<<<<<<<<<<<<
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_slice__8, __pyx_t_1) < 0))) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":430
 *         incoming_weights[:] = -np.Infinity
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights             # <<<<<<<<<<<<<<
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = PyObject_Length(__pyx_v_outside); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(5, 430, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":429
 *         # analagous to the outgoing weights
 *         incoming_weights[:] = -np.Infinity
 *         incoming_weights[max_incoming_inds,             # <<<<<<<<<<<<<<
 *                          np.arange(len(outside))] = max_incoming_weights
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_max_incoming_inds);
  __Pyx_GIVEREF(__pyx_v_max_incoming_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max_incoming_inds)) __PYX_ERR(5, 429, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(5, 429, __pyx_L1_error);
  __pyx_t_1 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_4, __pyx_v_max_incoming_weights) < 0))) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":431
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights             # <<<<<<<<<<<<<<
 * 
 *     def _find_maximum_spanning_tree(self):
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_cycle_inds);
  __Pyx_GIVEREF(__pyx_v_cycle_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_cycle_inds)) __PYX_ERR(5, 431, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_outside);
  __Pyx_GIVEREF(__pyx_v_outside);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_outside)) __PYX_ERR(5, 431, __pyx_L1_error);
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_4, ((PyObject *)__pyx_v_incoming_weights)) < 0))) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._contract_cycle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_outside);
  __Pyx_XDECREF((PyObject *)__pyx_v_outgoing_weights);
  __Pyx_XDECREF(__pyx_v_outside_inds);
  __Pyx_XDECREF(__pyx_v_max_outgoing_inds);
  __Pyx_XDECREF(__pyx_v_max_outgoing_weights);
  __Pyx_XDECREF(__pyx_v_cycle_inds);
  __Pyx_XDECREF((PyObject *)__pyx_v_incoming_weights);
  __Pyx_XDECREF(__pyx_v_cycle_score);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XDECREF(__pyx_v_head_to_v);
  __Pyx_XDECREF(__pyx_v_max_incoming_inds);
  __Pyx_XDECREF(__pyx_v_max_incoming_weights);
  __Pyx_XDECREF(__pyx_v_new_head_ind);
  __Pyx_XDECREF(__pyx_v_vertex_leaving_cycle_ind);
  __Pyx_XDECREF(__pyx_v_new_head);
  __Pyx_XDECREF(__pyx_v_vertex_leaving_cycle);
  __Pyx_XDECREF(__pyx_v_old_head);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree, "ConvolutionalDependencyNetwork._find_maximum_spanning_tree(self)\n\n        Run the Chu-Liu / Edmond's algorithm in order to find the highest\n        scoring dependency tree from the dependency graph weights.\n        \n        :returns: a 1-dim array with the head of each token in the sentence\n        ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree = {"_find_maximum_spanning_tree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_maximum_spanning_tree (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_find_maximum_spanning_tree", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_find_maximum_spanning_tree", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_heads = NULL;
  PyObject *__pyx_v_cycles = NULL;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__81)
  __Pyx_RefNannySetupContext("_find_maximum_spanning_tree", 1);
  __Pyx_TraceCall("_find_maximum_spanning_tree", __pyx_f[5], 433, 0, __PYX_ERR(5, 433, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":441
 *         """
 *         # pick the highest scoring dependency for each word
 *         heads = self.dependency_weights.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *         # check if there are cycles. if there isn't any, we're done
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dependency_weights), __pyx_n_s_argmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_heads = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":444
 * 
 *         # check if there are cycles. if there isn't any, we're done
 *         cycles = self._find_cycles(heads)             # <<<<<<<<<<<<<<
 * 
 *         for cycle in cycles:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find_cycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_heads};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_cycles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":446
 *         cycles = self._find_cycles(heads)
 * 
 *         for cycle in cycles:             # <<<<<<<<<<<<<<
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)
 */
  if (likely(PyList_CheckExact(__pyx_v_cycles)) || PyTuple_CheckExact(__pyx_v_cycles)) {
    __pyx_t_1 = __pyx_v_cycles; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 446, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(5, 446, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_cycle, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":448
 *         for cycle in cycles:
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)             # <<<<<<<<<<<<<<
 * 
 *         return heads
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_contract_cycle); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_heads, __pyx_v_cycle};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":446
 *         cycles = self._find_cycles(heads)
 * 
 *         for cycle in cycles:             # <<<<<<<<<<<<<<
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":450
 *             self._contract_cycle(heads, cycle)
 * 
 *         return heads             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_heads);
  __pyx_r = __pyx_v_heads;
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_maximum_spanning_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_heads);
  __Pyx_XDECREF(__pyx_v_cycles);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":14
 * 
 *     # the weights of all possible dependency among tokens
 *     cdef readonly np.ndarray dependency_weights             # <<<<<<<<<<<<<<
 * 
 *     # validation data
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_TraceCall("__get__", __pyx_f[5], 14, 0, __PYX_ERR(5, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->dependency_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->dependency_weights);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.dependency_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__, "ConvolutionalDependencyNetwork.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__82)
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);
  __Pyx_TraceCall("__reduce_cython__", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.half_window); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.hidden2_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.hidden_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.input_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_sentences); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_targets); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.num_tokens); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.output_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.pred_dist_offset); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.skips); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.target_dist_offset); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.__pyx_base.word_window_size); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_23 = PyTuple_New(71); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, ((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->dependency_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 4, ((PyObject *)__pyx_v_self->dependency_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 5, __pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 6, __pyx_v_self->__pyx_base.__pyx_base.feature_tables)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 7, __pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 8, __pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 9, __pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 10, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 11, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 12, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 13, __pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 14, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 15, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 16, ((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 17, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 18, ((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 19, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 20, __pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 21, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 22, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 23, ((PyObject *)__pyx_v_self->__pyx_base.input_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 24, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 25, __pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 26, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 27, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 28, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 29, __pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 30, __pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 31, __pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.max_indices);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.max_indices);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 32, ((PyObject *)__pyx_v_self->__pyx_base.max_indices))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 33, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 34, __pyx_v_self->__pyx_base.__pyx_base.network_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 35, __pyx_v_self->__pyx_base.__pyx_base.network_text_filename)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 36, __pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 37, __pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 38, __pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.only_classify);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.only_classify);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 39, ((PyObject *)__pyx_v_self->__pyx_base.only_classify))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 40, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 41, __pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 42, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 43, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 44, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 45, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 46, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 47, ((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 48, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 49, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_18);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 50, __pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 51, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 52, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_19);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 53, __pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 54, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_20);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 55, __pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 56, ((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 57, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 58, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_21);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 59, __pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 60, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_table))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 61, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 62, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 63, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 64, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay))) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_arguments);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_arguments);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 65, __pyx_v_self->__pyx_base.validation_arguments)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_heads);
  __Pyx_GIVEREF(__pyx_v_self->validation_heads);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 66, __pyx_v_self->validation_heads)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_predicates);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 67, __pyx_v_self->__pyx_base.validation_predicates)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 68, __pyx_v_self->__pyx_base.__pyx_base.validation_sentences)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 69, __pyx_v_self->__pyx_base.__pyx_base.validation_tags)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_22);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 70, __pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_23);
  __pyx_t_23 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_23 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __pyx_v__dict = __pyx_t_23;
  __pyx_t_23 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_24 = (__pyx_v__dict != Py_None);
  if (__pyx_t_24) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v__dict)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_22 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_22));
    __pyx_t_22 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 */
  /*else*/ {
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->dependency_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.max_indices) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.only_classify) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_arguments != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_heads != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_predicates != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.validation_tags != ((PyObject*)Py_None));
    __pyx_t_24 = __pyx_t_25;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_24;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_pyx_unpickle_ConvolutionalDepe); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_212151326);
    __Pyx_GIVEREF(__pyx_int_212151326);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_int_212151326)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, Py_None)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_22);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_v_state)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_22 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_21;
    __pyx_t_21 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_pyx_unpickle_ConvolutionalDepe); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_212151326);
    __Pyx_GIVEREF(__pyx_int_212151326);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_int_212151326)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_v_state)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_GIVEREF(__pyx_t_21);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_21 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_22;
    __pyx_t_22 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__, "ConvolutionalDependencyNetwork.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(4, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__83)
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);
  __Pyx_TraceCall("__setstate_cython__", __pyx_f[4], 16, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network___pyx_unpickle_Network, "__pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network = {"__pyx_unpickle_Network", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network___pyx_unpickle_Network};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Network", 1, 3, 3, 1); __PYX_ERR(4, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Network", 1, 3, 3, 2); __PYX_ERR(4, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Network") < 0)) __PYX_ERR(4, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Network", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__84)
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network", 1);
  __Pyx_TraceCall("__pyx_unpickle_Network", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__85, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network__set_state", 1);
  __Pyx_TraceCall("__pyx_unpickle_Network__set_state", __pyx_f[4], 11, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[40])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->feature_tables);
  __pyx_v___pyx_result->feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_bias);
  __pyx_v___pyx_result->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_sent_values);
  __pyx_v___pyx_result->hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_values);
  __pyx_v___pyx_result->hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_weights);
  __pyx_v___pyx_result->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_sent_values);
  __pyx_v___pyx_result->input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_values);
  __pyx_v___pyx_result->input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->layer2_sent_values);
  __pyx_v___pyx_result->layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->layer2_values);
  __pyx_v___pyx_result->layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->net_gradients);
  __pyx_v___pyx_result->net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->network_filename);
  __pyx_v___pyx_result->network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->network_text_filename);
  __pyx_v___pyx_result->network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->output_bias);
  __pyx_v___pyx_result->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->output_weights);
  __pyx_v___pyx_result->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->padding_left);
  __pyx_v___pyx_result->padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->padding_right);
  __pyx_v___pyx_result->padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pos_padding);
  __pyx_v___pyx_result->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pre_padding);
  __pyx_v___pyx_result->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->sentence_lookup);
  __pyx_v___pyx_result->sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->trans_gradients);
  __pyx_v___pyx_result->trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->transitions);
  __pyx_v___pyx_result->transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->use_learning_rate_decay);
  __pyx_v___pyx_result->use_learning_rate_decay = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_sentences);
  __pyx_v___pyx_result->validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_tags);
  __pyx_v___pyx_result->validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[40])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 40);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[40])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[40])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork, "__pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork = {"__pyx_unpickle_ConvolutionalNetwork", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalNetwork", 1, 3, 3, 1); __PYX_ERR(4, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalNetwork", 1, 3, 3, 2); __PYX_ERR(4, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_ConvolutionalNetwork") < 0)) __PYX_ERR(4, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalNetwork", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__87)
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork", 1);
  __Pyx_TraceCall("__pyx_unpickle_ConvolutionalNetwork", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__88, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork__set_state", 1);
  __Pyx_TraceCall("__pyx_unpickle_ConvolutionalNetwork__set_state", __pyx_f[4], 11, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[69])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->convolution_lookup);
  __pyx_v___pyx_result->convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.feature_tables);
  __pyx_v___pyx_result->__pyx_base.feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->half_window = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_before_activation);
  __pyx_v___pyx_result->hidden2_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_bias);
  __pyx_v___pyx_result->hidden2_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_gradients);
  __pyx_v___pyx_result->hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->hidden2_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_values);
  __pyx_v___pyx_result->hidden2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_weights);
  __pyx_v___pyx_result->hidden2_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_before_activation);
  __pyx_v___pyx_result->hidden_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_bias);
  __pyx_v___pyx_result->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_gradients);
  __pyx_v___pyx_result->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_sent_values);
  __pyx_v___pyx_result->__pyx_base.hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_values);
  __pyx_v___pyx_result->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_weights);
  __pyx_v___pyx_result->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_deltas);
  __pyx_v___pyx_result->input_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_sent_values);
  __pyx_v___pyx_result->__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_values);
  __pyx_v___pyx_result->__pyx_base.input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_sent_values);
  __pyx_v___pyx_result->__pyx_base.layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_values);
  __pyx_v___pyx_result->__pyx_base.layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->max_indices);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->max_indices);
  __pyx_v___pyx_result->max_indices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.net_gradients);
  __pyx_v___pyx_result->__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.network_filename);
  __pyx_v___pyx_result->__pyx_base.network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.network_text_filename);
  __pyx_v___pyx_result->__pyx_base.network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_sentences = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_targets = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->only_classify);
  __pyx_v___pyx_result->only_classify = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_bias);
  __pyx_v___pyx_result->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 41, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_weights);
  __pyx_v___pyx_result->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 42, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_left);
  __pyx_v___pyx_result->__pyx_base.padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 43, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_right);
  __pyx_v___pyx_result->__pyx_base.padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 44, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pos_padding);
  __pyx_v___pyx_result->__pyx_base.pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 45, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pre_padding);
  __pyx_v___pyx_result->__pyx_base.pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 46, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_convolution_lookup);
  __pyx_v___pyx_result->pred_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 47, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_deltas);
  __pyx_v___pyx_result->pred_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 48, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_lookup);
  __pyx_v___pyx_result->pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 49, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->pred_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 50, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_table);
  __pyx_v___pyx_result->pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 51, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_weights);
  __pyx_v___pyx_result->pred_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 52, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 53, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.sentence_lookup);
  __pyx_v___pyx_result->__pyx_base.sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 54, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 55, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_convolution_lookup);
  __pyx_v___pyx_result->target_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 56, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_deltas);
  __pyx_v___pyx_result->target_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 57, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_lookup);
  __pyx_v___pyx_result->target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 58, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->target_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 59, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_table);
  __pyx_v___pyx_result->target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 60, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_weights);
  __pyx_v___pyx_result->target_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 61, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.trans_gradients);
  __pyx_v___pyx_result->__pyx_base.trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 62, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.transitions);
  __pyx_v___pyx_result->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 63, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.use_learning_rate_decay);
  __pyx_v___pyx_result->__pyx_base.use_learning_rate_decay = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 64, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_arguments);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_arguments);
  __pyx_v___pyx_result->validation_arguments = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 65, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_predicates);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_predicates);
  __pyx_v___pyx_result->validation_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 66, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_sentences);
  __pyx_v___pyx_result->__pyx_base.validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 67, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_tags);
  __pyx_v___pyx_result->__pyx_base.validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 68, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[69])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 69);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[69])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 69, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[69])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork, "__pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork = {"__pyx_unpickle_ConvolutionalDependencyNetwork", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalDependencyNetwork", 1, 3, 3, 1); __PYX_ERR(4, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalDependencyNetwork", 1, 3, 3, 2); __PYX_ERR(4, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_ConvolutionalDependencyNetwork") < 0)) __PYX_ERR(4, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalDependencyNetwork", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__89)
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork", 1);
  __Pyx_TraceCall("__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_f[4], 1, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__90, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", 1);
  __Pyx_TraceCall("__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", __pyx_f[4], 11, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[71])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->dependency_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->dependency_weights);
  __pyx_v___pyx_result->dependency_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.half_window = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_before_activation);
  __pyx_v___pyx_result->__pyx_base.hidden2_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_bias);
  __pyx_v___pyx_result->__pyx_base.hidden2_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_gradients);
  __pyx_v___pyx_result->__pyx_base.hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.hidden2_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_values);
  __pyx_v___pyx_result->__pyx_base.hidden2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_weights);
  __pyx_v___pyx_result->__pyx_base.hidden2_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_before_activation);
  __pyx_v___pyx_result->__pyx_base.hidden_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_gradients);
  __pyx_v___pyx_result->__pyx_base.hidden_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_deltas);
  __pyx_v___pyx_result->__pyx_base.input_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.max_indices);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.max_indices);
  __pyx_v___pyx_result->__pyx_base.max_indices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_sentences = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_targets = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.only_classify);
  __pyx_v___pyx_result->__pyx_base.only_classify = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 41, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 42, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 43, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 44, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 45, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 46, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 47, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.pred_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 48, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_deltas);
  __pyx_v___pyx_result->__pyx_base.pred_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 49, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_lookup);
  __pyx_v___pyx_result->__pyx_base.pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 50, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.pred_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 51, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_table);
  __pyx_v___pyx_result->__pyx_base.pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 52, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_weights);
  __pyx_v___pyx_result->__pyx_base.pred_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 53, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 54, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 55, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 56, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.target_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 57, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_deltas);
  __pyx_v___pyx_result->__pyx_base.target_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 58, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_lookup);
  __pyx_v___pyx_result->__pyx_base.target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 59, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.target_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 60, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_table);
  __pyx_v___pyx_result->__pyx_base.target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 61, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_weights);
  __pyx_v___pyx_result->__pyx_base.target_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 62, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 63, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.transitions);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 64, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 65, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_arguments);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_arguments);
  __pyx_v___pyx_result->__pyx_base.validation_arguments = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 66, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_heads);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_heads);
  __pyx_v___pyx_result->validation_heads = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 67, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_predicates);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_predicates);
  __pyx_v___pyx_result->__pyx_base.validation_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 68, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 69, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 70, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[71])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 71);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[71])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 71, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[71])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_Network(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o);
  p->use_learning_rate_decay = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  p->sentence_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->padding_left = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->padding_right = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pre_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pos_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->output_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->output_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->layer2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->feature_tables = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->transitions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->net_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->trans_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->layer2_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->network_filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->network_text_filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_sentences = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_tags = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->use_learning_rate_decay);
  Py_CLEAR(p->sentence_lookup);
  Py_CLEAR(p->padding_left);
  Py_CLEAR(p->padding_right);
  Py_CLEAR(p->pre_padding);
  Py_CLEAR(p->pos_padding);
  Py_CLEAR(p->hidden_weights);
  Py_CLEAR(p->output_weights);
  Py_CLEAR(p->hidden_bias);
  Py_CLEAR(p->output_bias);
  Py_CLEAR(p->input_values);
  Py_CLEAR(p->hidden_values);
  Py_CLEAR(p->layer2_values);
  Py_CLEAR(p->feature_tables);
  Py_CLEAR(p->transitions);
  Py_CLEAR(p->net_gradients);
  Py_CLEAR(p->trans_gradients);
  Py_CLEAR(p->input_sent_values);
  Py_CLEAR(p->hidden_sent_values);
  Py_CLEAR(p->layer2_sent_values);
  Py_CLEAR(p->network_filename);
  Py_CLEAR(p->network_text_filename);
  Py_CLEAR(p->validation_sentences);
  Py_CLEAR(p->validation_tags);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  if (p->use_learning_rate_decay) {
    e = (*v)(((PyObject *)p->use_learning_rate_decay), a); if (e) return e;
  }
  if (p->sentence_lookup) {
    e = (*v)(((PyObject *)p->sentence_lookup), a); if (e) return e;
  }
  if (p->padding_left) {
    e = (*v)(((PyObject *)p->padding_left), a); if (e) return e;
  }
  if (p->padding_right) {
    e = (*v)(((PyObject *)p->padding_right), a); if (e) return e;
  }
  if (p->pre_padding) {
    e = (*v)(((PyObject *)p->pre_padding), a); if (e) return e;
  }
  if (p->pos_padding) {
    e = (*v)(((PyObject *)p->pos_padding), a); if (e) return e;
  }
  if (p->hidden_weights) {
    e = (*v)(((PyObject *)p->hidden_weights), a); if (e) return e;
  }
  if (p->output_weights) {
    e = (*v)(((PyObject *)p->output_weights), a); if (e) return e;
  }
  if (p->hidden_bias) {
    e = (*v)(((PyObject *)p->hidden_bias), a); if (e) return e;
  }
  if (p->output_bias) {
    e = (*v)(((PyObject *)p->output_bias), a); if (e) return e;
  }
  if (p->input_values) {
    e = (*v)(((PyObject *)p->input_values), a); if (e) return e;
  }
  if (p->hidden_values) {
    e = (*v)(((PyObject *)p->hidden_values), a); if (e) return e;
  }
  if (p->layer2_values) {
    e = (*v)(((PyObject *)p->layer2_values), a); if (e) return e;
  }
  if (p->feature_tables) {
    e = (*v)(p->feature_tables, a); if (e) return e;
  }
  if (p->transitions) {
    e = (*v)(((PyObject *)p->transitions), a); if (e) return e;
  }
  if (p->net_gradients) {
    e = (*v)(((PyObject *)p->net_gradients), a); if (e) return e;
  }
  if (p->trans_gradients) {
    e = (*v)(((PyObject *)p->trans_gradients), a); if (e) return e;
  }
  if (p->input_sent_values) {
    e = (*v)(((PyObject *)p->input_sent_values), a); if (e) return e;
  }
  if (p->hidden_sent_values) {
    e = (*v)(((PyObject *)p->hidden_sent_values), a); if (e) return e;
  }
  if (p->layer2_sent_values) {
    e = (*v)(((PyObject *)p->layer2_sent_values), a); if (e) return e;
  }
  if (p->validation_sentences) {
    e = (*v)(p->validation_sentences, a); if (e) return e;
  }
  if (p->validation_tags) {
    e = (*v)(p->validation_tags, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  tmp = ((PyObject*)p->use_learning_rate_decay);
  p->use_learning_rate_decay = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->sentence_lookup);
  p->sentence_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->padding_left);
  p->padding_left = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->padding_right);
  p->padding_right = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pre_padding);
  p->pre_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pos_padding);
  p->pos_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_weights);
  p->hidden_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->output_weights);
  p->output_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_bias);
  p->hidden_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->output_bias);
  p->output_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_values);
  p->input_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_values);
  p->hidden_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->layer2_values);
  p->layer2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->feature_tables);
  p->feature_tables = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->transitions);
  p->transitions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->net_gradients);
  p->net_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->trans_gradients);
  p->trans_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_sent_values);
  p->input_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_sent_values);
  p->hidden_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->layer2_sent_values);
  p->layer2_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_sentences);
  p->validation_sentences = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_tags);
  p->validation_tags = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_left(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_right(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_word_window_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_decay_factor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_decay_factor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_features_per_token(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pre_padding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pre_padding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pos_padding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pos_padding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_feature_tables(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_feature_tables(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_transitions(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_transitions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_answer_score(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_net_gradients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_trans_gradients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_filename(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_filename(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_Network[] = {
  {"create_new", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new},
  {"description", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description},
  {"_create_sentence_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup},
  {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence},
  {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence},
  {"_calculate_delta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta},
  {"_calculate_gradients_sll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll},
  {"_calculate_gradients_wll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll},
  {"_viterbi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi},
  {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data},
  {"set_learning_rate_decay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay},
  {"decrease_learning_rates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates},
  {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train},
  {"_print_epoch_report", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report},
  {"_train_epoch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch},
  {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate},
  {"_backpropagate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate},
  {"_load_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters},
  {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save},
  {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_Network[] = {
  {(char *)"padding_left", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_left, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_left, (char *)PyDoc_STR("\n        The padding element filling the \"void\" before the beginning\n        of the sentence.\n        "), 0},
  {(char *)"padding_right", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_right, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_right, (char *)PyDoc_STR("\n        The padding element filling the \"void\" after the end\n        of the sentence.\n        "), 0},
  {(char *)"word_window_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_word_window_size, 0, (char *)0, 0},
  {(char *)"input_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_size, 0, (char *)0, 0},
  {(char *)"hidden_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_size, 0, (char *)0, 0},
  {(char *)"output_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_size, 0, (char *)0, 0},
  {(char *)"learning_rate", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate, (char *)PyDoc_STR("learning_rate: 'float'"), 0},
  {(char *)"learning_rate_features", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features, (char *)PyDoc_STR("learning_rate_features: 'float'"), 0},
  {(char *)"decay_factor", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_decay_factor, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_decay_factor, (char *)PyDoc_STR("decay_factor: 'float'"), 0},
  {(char *)"use_learning_rate_decay", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay, (char *)PyDoc_STR("use_learning_rate_decay: __builtin__.bool"), 0},
  {(char *)"features_per_token", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_features_per_token, 0, (char *)0, 0},
  {(char *)"pre_padding", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pre_padding, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pre_padding, (char *)PyDoc_STR("pre_padding: numpy.ndarray"), 0},
  {(char *)"pos_padding", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pos_padding, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pos_padding, (char *)PyDoc_STR("pos_padding: numpy.ndarray"), 0},
  {(char *)"hidden_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_weights, 0, (char *)0, 0},
  {(char *)"output_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_weights, 0, (char *)0, 0},
  {(char *)"hidden_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_bias, 0, (char *)0, 0},
  {(char *)"output_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_bias, 0, (char *)0, 0},
  {(char *)"input_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_values, 0, (char *)0, 0},
  {(char *)"hidden_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_values, 0, (char *)0, 0},
  {(char *)"layer2_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_values, 0, (char *)0, 0},
  {(char *)"feature_tables", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_feature_tables, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_feature_tables, (char *)PyDoc_STR("feature_tables: list"), 0},
  {(char *)"learning_rate_trans", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans, (char *)PyDoc_STR("learning_rate_trans: 'float'"), 0},
  {(char *)"transitions", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_transitions, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_transitions, (char *)PyDoc_STR("transitions: numpy.ndarray"), 0},
  {(char *)"answer_score", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_answer_score, 0, (char *)0, 0},
  {(char *)"net_gradients", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_net_gradients, 0, (char *)0, 0},
  {(char *)"trans_gradients", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_trans_gradients, 0, (char *)0, 0},
  {(char *)"input_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_sent_values, 0, (char *)0, 0},
  {(char *)"hidden_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_sent_values, 0, (char *)0, 0},
  {(char *)"layer2_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_sent_values, 0, (char *)0, 0},
  {(char *)"network_filename", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_filename, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_filename, (char *)PyDoc_STR("network_filename: unicode"), 0},
  {(char *)"network_text_filename", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename, (char *)PyDoc_STR("network_text_filename: unicode"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_Network_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_doc, (void *)PyDoc_STR("Network(word_window, input_size, hidden_size, output_size, hidden_weights, hidden_bias, output_weights, output_bias, transitions=None)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_init, (void *)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_Network},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_Network_spec = {
  "nltkor.tag.libs.network.Network",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_Network_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_Network = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""Network", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Network(word_window, input_size, hidden_size, output_size, hidden_weights, hidden_bias, output_weights, output_bias, transitions=None)"), /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_Network, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_Network, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_Network, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p;
  PyObject *o = __pyx_tp_new_6nltkor_3tag_4libs_7network_Network(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o);
  p->__pyx_vtab = __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  p->target_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->max_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->only_classify = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->validation_predicates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_arguments = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->target_dist_table);
  Py_CLEAR(p->pred_dist_table);
  Py_CLEAR(p->target_dist_weights);
  Py_CLEAR(p->pred_dist_weights);
  Py_CLEAR(p->target_dist_lookup);
  Py_CLEAR(p->pred_dist_lookup);
  Py_CLEAR(p->target_convolution_lookup);
  Py_CLEAR(p->pred_convolution_lookup);
  Py_CLEAR(p->target_dist_deltas);
  Py_CLEAR(p->pred_dist_deltas);
  Py_CLEAR(p->hidden2_weights);
  Py_CLEAR(p->hidden2_bias);
  Py_CLEAR(p->hidden2_values);
  Py_CLEAR(p->hidden2_before_activation);
  Py_CLEAR(p->hidden_before_activation);
  Py_CLEAR(p->convolution_lookup);
  Py_CLEAR(p->max_indices);
  Py_CLEAR(p->only_classify);
  Py_CLEAR(p->hidden_gradients);
  Py_CLEAR(p->hidden2_gradients);
  Py_CLEAR(p->input_deltas);
  Py_CLEAR(p->validation_predicates);
  Py_CLEAR(p->validation_arguments);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network(o);
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  e = __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network(o, v, a); if (e) return e;
  if (p->target_dist_table) {
    e = (*v)(((PyObject *)p->target_dist_table), a); if (e) return e;
  }
  if (p->pred_dist_table) {
    e = (*v)(((PyObject *)p->pred_dist_table), a); if (e) return e;
  }
  if (p->target_dist_weights) {
    e = (*v)(((PyObject *)p->target_dist_weights), a); if (e) return e;
  }
  if (p->pred_dist_weights) {
    e = (*v)(((PyObject *)p->pred_dist_weights), a); if (e) return e;
  }
  if (p->target_dist_lookup) {
    e = (*v)(((PyObject *)p->target_dist_lookup), a); if (e) return e;
  }
  if (p->pred_dist_lookup) {
    e = (*v)(((PyObject *)p->pred_dist_lookup), a); if (e) return e;
  }
  if (p->target_convolution_lookup) {
    e = (*v)(((PyObject *)p->target_convolution_lookup), a); if (e) return e;
  }
  if (p->pred_convolution_lookup) {
    e = (*v)(((PyObject *)p->pred_convolution_lookup), a); if (e) return e;
  }
  if (p->target_dist_deltas) {
    e = (*v)(((PyObject *)p->target_dist_deltas), a); if (e) return e;
  }
  if (p->pred_dist_deltas) {
    e = (*v)(((PyObject *)p->pred_dist_deltas), a); if (e) return e;
  }
  if (p->hidden2_weights) {
    e = (*v)(((PyObject *)p->hidden2_weights), a); if (e) return e;
  }
  if (p->hidden2_bias) {
    e = (*v)(((PyObject *)p->hidden2_bias), a); if (e) return e;
  }
  if (p->hidden2_values) {
    e = (*v)(((PyObject *)p->hidden2_values), a); if (e) return e;
  }
  if (p->hidden2_before_activation) {
    e = (*v)(((PyObject *)p->hidden2_before_activation), a); if (e) return e;
  }
  if (p->hidden_before_activation) {
    e = (*v)(((PyObject *)p->hidden_before_activation), a); if (e) return e;
  }
  if (p->convolution_lookup) {
    e = (*v)(((PyObject *)p->convolution_lookup), a); if (e) return e;
  }
  if (p->max_indices) {
    e = (*v)(((PyObject *)p->max_indices), a); if (e) return e;
  }
  if (p->only_classify) {
    e = (*v)(((PyObject *)p->only_classify), a); if (e) return e;
  }
  if (p->hidden_gradients) {
    e = (*v)(((PyObject *)p->hidden_gradients), a); if (e) return e;
  }
  if (p->hidden2_gradients) {
    e = (*v)(((PyObject *)p->hidden2_gradients), a); if (e) return e;
  }
  if (p->input_deltas) {
    e = (*v)(((PyObject *)p->input_deltas), a); if (e) return e;
  }
  if (p->validation_predicates) {
    e = (*v)(p->validation_predicates, a); if (e) return e;
  }
  if (p->validation_arguments) {
    e = (*v)(p->validation_arguments, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network(o);
  tmp = ((PyObject*)p->target_dist_table);
  p->target_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_table);
  p->pred_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_weights);
  p->target_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_weights);
  p->pred_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_lookup);
  p->target_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_lookup);
  p->pred_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_convolution_lookup);
  p->target_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_convolution_lookup);
  p->pred_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_deltas);
  p->target_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_deltas);
  p->pred_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_weights);
  p->hidden2_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_bias);
  p->hidden2_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_values);
  p->hidden2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_before_activation);
  p->hidden2_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_before_activation);
  p->hidden_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->convolution_lookup);
  p->convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->max_indices);
  p->max_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->only_classify);
  p->only_classify = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_gradients);
  p->hidden_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_gradients);
  p->hidden2_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_deltas);
  p->input_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_predicates);
  p->validation_predicates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_arguments);
  p->validation_arguments = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_convolution_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_convolution_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_deltas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_deltas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_before_activation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden_before_activation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_max_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(o);
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork[] = {
  {"create_new", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new},
  {"description", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description},
  {"_generate_save_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict},
  {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save},
  {"_load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file},
  {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file},
  {"_load_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters},
  {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data},
  {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train},
  {"_reset_counters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters},
  {"_shuffle_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data},
  {"_train_epoch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch},
  {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence},
  {"_sentence_convolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution},
  {"_pre_tagging_setup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup},
  {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence},
  {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate},
  {"_calculate_gradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients},
  {"_calculate_gradients_classify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify},
  {"_backpropagate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate},
  {"_adjust_weights", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights},
  {"_calculate_input_deltas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas},
  {"_adjust_features", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features},
  {"_viterbi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi},
  {"_create_target_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup},
  {"_create_pred_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup},
  {"_create_convolution_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork[] = {
  {(char *)"target_dist_table", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table, __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table, (char *)PyDoc_STR("target_dist_table: numpy.ndarray"), 0},
  {(char *)"pred_dist_table", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table, __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table, (char *)PyDoc_STR("pred_dist_table: numpy.ndarray"), 0},
  {(char *)"target_dist_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_weights, 0, (char *)0, 0},
  {(char *)"pred_dist_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_weights, 0, (char *)0, 0},
  {(char *)"target_dist_offset", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_offset, 0, (char *)0, 0},
  {(char *)"pred_dist_offset", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_offset, 0, (char *)0, 0},
  {(char *)"target_dist_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_lookup, 0, (char *)0, 0},
  {(char *)"pred_dist_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_lookup, 0, (char *)0, 0},
  {(char *)"target_convolution_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_convolution_lookup, 0, (char *)0, 0},
  {(char *)"pred_convolution_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_convolution_lookup, 0, (char *)0, 0},
  {(char *)"target_dist_deltas", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_deltas, 0, (char *)0, 0},
  {(char *)"pred_dist_deltas", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_deltas, 0, (char *)0, 0},
  {(char *)"hidden2_size", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_size, 0, (char *)0, 0},
  {(char *)"hidden2_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_weights, 0, (char *)0, 0},
  {(char *)"hidden2_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_bias, 0, (char *)0, 0},
  {(char *)"hidden2_values", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_values, 0, (char *)0, 0},
  {(char *)"hidden2_before_activation", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_before_activation, 0, (char *)0, 0},
  {(char *)"hidden_before_activation", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden_before_activation, 0, (char *)0, 0},
  {(char *)"max_indices", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_max_indices, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_doc, (void *)PyDoc_STR("ConvolutionalNetwork(word_window, input_size, hidden1_size, hidden2_size, output_size, hidden1_weights, hidden1_bias, target_dist_weights, pred_dist_weights, hidden2_weights, hidden2_bias, output_weights, output_bias)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_init, (void *)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec = {
  "nltkor.tag.libs.network.ConvolutionalNetwork",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""ConvolutionalNetwork", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("ConvolutionalNetwork(word_window, input_size, hidden1_size, hidden2_size, output_size, hidden1_weights, hidden1_bias, target_dist_weights, pred_dist_weights, hidden2_weights, hidden2_bias, output_weights, output_bias)"), /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p;
  PyObject *o = __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork*)__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  p->dependency_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->validation_heads = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->dependency_weights);
  Py_CLEAR(p->validation_heads);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o);
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  e = __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o, v, a); if (e) return e;
  if (p->dependency_weights) {
    e = (*v)(((PyObject *)p->dependency_weights), a); if (e) return e;
  }
  if (p->validation_heads) {
    e = (*v)(p->validation_heads, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o);
  tmp = ((PyObject*)p->dependency_weights);
  p->dependency_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_heads);
  p->validation_heads = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_dependency_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(o);
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork[] = {
  {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save},
  {"load_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file},
  {"train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train},
  {"set_validation_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data},
  {"_tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence},
  {"_tag_sentence_unlabeled_dependency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency},
  {"_tag_sentence_labeled_dependency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency},
  {"_calculate_gradients", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients},
  {"_validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate},
  {"_average_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error},
  {"_print_epoch_report", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report},
  {"tag_sentence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence},
  {"_find_cycles", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles},
  {"_find_cycle_recursive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive},
  {"_contract_cycle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle},
  {"_find_maximum_spanning_tree", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork[] = {
  {(char *)"dependency_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_dependency_weights, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec = {
  "nltkor.tag.libs.network.ConvolutionalDependencyNetwork",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""ConvolutionalDependencyNetwork", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[8];
static int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[--__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_table);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)))) {
    __pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_table) {
    e = (*v)(p->__pyx_v_table, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[--__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[--__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[--__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_table);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_table) {
    e = (*v)(p->__pyx_v_table, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[--__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_4_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_u_Accuracy, __pyx_k_Accuracy, sizeof(__pyx_k_Accuracy), 0, 1, 0, 0},
    {&__pyx_kp_u_Confidence_measure_not_implement, __pyx_k_Confidence_measure_not_implement, sizeof(__pyx_k_Confidence_measure_not_implement), 0, 1, 0, 0},
    {&__pyx_kp_u_Convolution_layer_size, __pyx_k_Convolution_layer_size, sizeof(__pyx_k_Convolution_layer_size), 0, 1, 0, 0},
    {&__pyx_n_s_ConvolutionalDependencyNetwork, __pyx_k_ConvolutionalDependencyNetwork, sizeof(__pyx_k_ConvolutionalDependencyNetwork), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_10, __pyx_k_ConvolutionalDependencyNetwork_10, sizeof(__pyx_k_ConvolutionalDependencyNetwork_10), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_11, __pyx_k_ConvolutionalDependencyNetwork_11, sizeof(__pyx_k_ConvolutionalDependencyNetwork_11), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_12, __pyx_k_ConvolutionalDependencyNetwork_12, sizeof(__pyx_k_ConvolutionalDependencyNetwork_12), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_13, __pyx_k_ConvolutionalDependencyNetwork_13, sizeof(__pyx_k_ConvolutionalDependencyNetwork_13), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_14, __pyx_k_ConvolutionalDependencyNetwork_14, sizeof(__pyx_k_ConvolutionalDependencyNetwork_14), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_2, __pyx_k_ConvolutionalDependencyNetwork_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_2), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_3, __pyx_k_ConvolutionalDependencyNetwork_3, sizeof(__pyx_k_ConvolutionalDependencyNetwork_3), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_4, __pyx_k_ConvolutionalDependencyNetwork_4, sizeof(__pyx_k_ConvolutionalDependencyNetwork_4), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_5, __pyx_k_ConvolutionalDependencyNetwork_5, sizeof(__pyx_k_ConvolutionalDependencyNetwork_5), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_6, __pyx_k_ConvolutionalDependencyNetwork_6, sizeof(__pyx_k_ConvolutionalDependencyNetwork_6), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_7, __pyx_k_ConvolutionalDependencyNetwork_7, sizeof(__pyx_k_ConvolutionalDependencyNetwork_7), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_8, __pyx_k_ConvolutionalDependencyNetwork_8, sizeof(__pyx_k_ConvolutionalDependencyNetwork_8), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_9, __pyx_k_ConvolutionalDependencyNetwork_9, sizeof(__pyx_k_ConvolutionalDependencyNetwork_9), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_l, __pyx_k_ConvolutionalDependencyNetwork_l, sizeof(__pyx_k_ConvolutionalDependencyNetwork_l), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_s, __pyx_k_ConvolutionalDependencyNetwork_s, sizeof(__pyx_k_ConvolutionalDependencyNetwork_s), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_s_2, __pyx_k_ConvolutionalDependencyNetwork_s_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_s_2), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_t, __pyx_k_ConvolutionalDependencyNetwork_t, sizeof(__pyx_k_ConvolutionalDependencyNetwork_t), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalDependencyNetwork_t_2, __pyx_k_ConvolutionalDependencyNetwork_t_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_t_2), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork, __pyx_k_ConvolutionalNetwork, sizeof(__pyx_k_ConvolutionalNetwork), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork___reduce_cy, __pyx_k_ConvolutionalNetwork___reduce_cy, sizeof(__pyx_k_ConvolutionalNetwork___reduce_cy), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork___setstate, __pyx_k_ConvolutionalNetwork___setstate, sizeof(__pyx_k_ConvolutionalNetwork___setstate), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__adjust_fea, __pyx_k_ConvolutionalNetwork__adjust_fea, sizeof(__pyx_k_ConvolutionalNetwork__adjust_fea), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__adjust_wei, __pyx_k_ConvolutionalNetwork__adjust_wei, sizeof(__pyx_k_ConvolutionalNetwork__adjust_wei), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__backpropag, __pyx_k_ConvolutionalNetwork__backpropag, sizeof(__pyx_k_ConvolutionalNetwork__backpropag), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__calculate, __pyx_k_ConvolutionalNetwork__calculate, sizeof(__pyx_k_ConvolutionalNetwork__calculate), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__calculate_2, __pyx_k_ConvolutionalNetwork__calculate_2, sizeof(__pyx_k_ConvolutionalNetwork__calculate_2), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__calculate_3, __pyx_k_ConvolutionalNetwork__calculate_3, sizeof(__pyx_k_ConvolutionalNetwork__calculate_3), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__create_con, __pyx_k_ConvolutionalNetwork__create_con, sizeof(__pyx_k_ConvolutionalNetwork__create_con), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__create_pre, __pyx_k_ConvolutionalNetwork__create_pre, sizeof(__pyx_k_ConvolutionalNetwork__create_pre), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__create_tar, __pyx_k_ConvolutionalNetwork__create_tar, sizeof(__pyx_k_ConvolutionalNetwork__create_tar), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__generate_s, __pyx_k_ConvolutionalNetwork__generate_s, sizeof(__pyx_k_ConvolutionalNetwork__generate_s), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__load_from, __pyx_k_ConvolutionalNetwork__load_from, sizeof(__pyx_k_ConvolutionalNetwork__load_from), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__load_param, __pyx_k_ConvolutionalNetwork__load_param, sizeof(__pyx_k_ConvolutionalNetwork__load_param), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__pre_taggin, __pyx_k_ConvolutionalNetwork__pre_taggin, sizeof(__pyx_k_ConvolutionalNetwork__pre_taggin), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__reset_coun, __pyx_k_ConvolutionalNetwork__reset_coun, sizeof(__pyx_k_ConvolutionalNetwork__reset_coun), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__sentence_c, __pyx_k_ConvolutionalNetwork__sentence_c, sizeof(__pyx_k_ConvolutionalNetwork__sentence_c), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__shuffle_da, __pyx_k_ConvolutionalNetwork__shuffle_da, sizeof(__pyx_k_ConvolutionalNetwork__shuffle_da), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__tag_senten, __pyx_k_ConvolutionalNetwork__tag_senten, sizeof(__pyx_k_ConvolutionalNetwork__tag_senten), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__train_epoc, __pyx_k_ConvolutionalNetwork__train_epoc, sizeof(__pyx_k_ConvolutionalNetwork__train_epoc), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__validate, __pyx_k_ConvolutionalNetwork__validate, sizeof(__pyx_k_ConvolutionalNetwork__validate), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork__viterbi, __pyx_k_ConvolutionalNetwork__viterbi, sizeof(__pyx_k_ConvolutionalNetwork__viterbi), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_create_new, __pyx_k_ConvolutionalNetwork_create_new, sizeof(__pyx_k_ConvolutionalNetwork_create_new), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_description, __pyx_k_ConvolutionalNetwork_description, sizeof(__pyx_k_ConvolutionalNetwork_description), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_load_from_f, __pyx_k_ConvolutionalNetwork_load_from_f, sizeof(__pyx_k_ConvolutionalNetwork_load_from_f), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_save, __pyx_k_ConvolutionalNetwork_save, sizeof(__pyx_k_ConvolutionalNetwork_save), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_set_validat, __pyx_k_ConvolutionalNetwork_set_validat, sizeof(__pyx_k_ConvolutionalNetwork_set_validat), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_tag_sentenc, __pyx_k_ConvolutionalNetwork_tag_sentenc, sizeof(__pyx_k_ConvolutionalNetwork_tag_sentenc), 0, 0, 1, 1},
    {&__pyx_n_s_ConvolutionalNetwork_train, __pyx_k_ConvolutionalNetwork_train, sizeof(__pyx_k_ConvolutionalNetwork_train), 0, 0, 1, 1},
    {&__pyx_kp_u_Distance_table_sizes_target_and, __pyx_k_Distance_table_sizes_target_and, sizeof(__pyx_k_Distance_table_sizes_target_and), 0, 1, 0, 0},
    {&__pyx_kp_u_Feature_table_sizes, __pyx_k_Feature_table_sizes, sizeof(__pyx_k_Feature_table_sizes), 0, 1, 0, 0},
    {&__pyx_n_s_FloatingPointError, __pyx_k_FloatingPointError, sizeof(__pyx_k_FloatingPointError), 0, 0, 1, 1},
    {&__pyx_kp_u_Hidden_layer_size, __pyx_k_Hidden_layer_size, sizeof(__pyx_k_Hidden_layer_size), 0, 1, 0, 0},
    {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_k_Incompatible_checksums_0x_x_vs_0_3, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_3), 0, 0, 1, 0},
    {&__pyx_n_s_Infinity, __pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 0, 1, 1},
    {&__pyx_kp_u_Input_layer_size, __pyx_k_Input_layer_size, sizeof(__pyx_k_Input_layer_size), 0, 1, 0, 0},
    {&__pyx_n_u_Logger, __pyx_k_Logger, sizeof(__pyx_k_Logger), 0, 1, 0, 1},
    {&__pyx_n_s_Network, __pyx_k_Network, sizeof(__pyx_k_Network), 0, 0, 1, 1},
    {&__pyx_n_s_Network___reduce_cython, __pyx_k_Network___reduce_cython, sizeof(__pyx_k_Network___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Network___setstate_cython, __pyx_k_Network___setstate_cython, sizeof(__pyx_k_Network___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Network__backpropagate, __pyx_k_Network__backpropagate, sizeof(__pyx_k_Network__backpropagate), 0, 0, 1, 1},
    {&__pyx_n_s_Network__calculate_delta, __pyx_k_Network__calculate_delta, sizeof(__pyx_k_Network__calculate_delta), 0, 0, 1, 1},
    {&__pyx_n_s_Network__calculate_gradients_sll, __pyx_k_Network__calculate_gradients_sll, sizeof(__pyx_k_Network__calculate_gradients_sll), 0, 0, 1, 1},
    {&__pyx_n_s_Network__calculate_gradients_wll, __pyx_k_Network__calculate_gradients_wll, sizeof(__pyx_k_Network__calculate_gradients_wll), 0, 0, 1, 1},
    {&__pyx_n_s_Network__create_sentence_lookup, __pyx_k_Network__create_sentence_lookup, sizeof(__pyx_k_Network__create_sentence_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_Network__load_parameters, __pyx_k_Network__load_parameters, sizeof(__pyx_k_Network__load_parameters), 0, 0, 1, 1},
    {&__pyx_n_s_Network__print_epoch_report, __pyx_k_Network__print_epoch_report, sizeof(__pyx_k_Network__print_epoch_report), 0, 0, 1, 1},
    {&__pyx_n_s_Network__tag_sentence, __pyx_k_Network__tag_sentence, sizeof(__pyx_k_Network__tag_sentence), 0, 0, 1, 1},
    {&__pyx_n_s_Network__train_epoch, __pyx_k_Network__train_epoch, sizeof(__pyx_k_Network__train_epoch), 0, 0, 1, 1},
    {&__pyx_n_s_Network__validate, __pyx_k_Network__validate, sizeof(__pyx_k_Network__validate), 0, 0, 1, 1},
    {&__pyx_n_s_Network__viterbi, __pyx_k_Network__viterbi, sizeof(__pyx_k_Network__viterbi), 0, 0, 1, 1},
    {&__pyx_n_s_Network_create_new, __pyx_k_Network_create_new, sizeof(__pyx_k_Network_create_new), 0, 0, 1, 1},
    {&__pyx_n_s_Network_decrease_learning_rates, __pyx_k_Network_decrease_learning_rates, sizeof(__pyx_k_Network_decrease_learning_rates), 0, 0, 1, 1},
    {&__pyx_n_s_Network_description, __pyx_k_Network_description, sizeof(__pyx_k_Network_description), 0, 0, 1, 1},
    {&__pyx_n_s_Network_load_from_file, __pyx_k_Network_load_from_file, sizeof(__pyx_k_Network_load_from_file), 0, 0, 1, 1},
    {&__pyx_n_s_Network_save, __pyx_k_Network_save, sizeof(__pyx_k_Network_save), 0, 0, 1, 1},
    {&__pyx_n_s_Network_set_learning_rate_decay, __pyx_k_Network_set_learning_rate_decay, sizeof(__pyx_k_Network_set_learning_rate_decay), 0, 0, 1, 1},
    {&__pyx_n_s_Network_set_validation_data, __pyx_k_Network_set_validation_data, sizeof(__pyx_k_Network_set_validation_data), 0, 0, 1, 1},
    {&__pyx_n_s_Network_tag_sentence, __pyx_k_Network_tag_sentence, sizeof(__pyx_k_Network_tag_sentence), 0, 0, 1, 1},
    {&__pyx_n_s_Network_train, __pyx_k_Network_train, sizeof(__pyx_k_Network_train), 0, 0, 1, 1},
    {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
    {&__pyx_kp_u_Output_size, __pyx_k_Output_size, sizeof(__pyx_k_Output_size), 0, 1, 0, 0},
    {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
    {&__pyx_kp_u_Saved_model, __pyx_k_Saved_model, sizeof(__pyx_k_Saved_model), 0, 1, 0, 0},
    {&__pyx_kp_u_Second_hidden_layer_size, __pyx_k_Second_hidden_layer_size, sizeof(__pyx_k_Second_hidden_layer_size), 0, 1, 0, 0},
    {&__pyx_kp_u_Sentence_accuracy, __pyx_k_Sentence_accuracy, sizeof(__pyx_k_Sentence_accuracy), 0, 1, 0, 0},
    {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
    {&__pyx_kp_u_Token_accuracy, __pyx_k_Token_accuracy, sizeof(__pyx_k_Token_accuracy), 0, 1, 0, 0},
    {&__pyx_kp_u_Training_for_up_to_d_epochs, __pyx_k_Training_for_up_to_d_epochs, sizeof(__pyx_k_Training_for_up_to_d_epochs), 0, 1, 0, 0},
    {&__pyx_kp_u_Word_window_size, __pyx_k_Word_window_size, sizeof(__pyx_k_Word_window_size), 0, 1, 0, 0},
    {&__pyx_n_s__161, __pyx_k__161, sizeof(__pyx_k__161), 0, 0, 1, 1},
    {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
    {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
    {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
    {&__pyx_kp_u__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 1, 0, 0},
    {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0},
    {&__pyx_n_s__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 0, 1, 1},
    {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
    {&__pyx_n_s_adjust_features, __pyx_k_adjust_features, sizeof(__pyx_k_adjust_features), 0, 0, 1, 1},
    {&__pyx_n_s_adjust_weights, __pyx_k_adjust_weights, sizeof(__pyx_k_adjust_weights), 0, 0, 1, 1},
    {&__pyx_n_s_all_scores, __pyx_k_all_scores, sizeof(__pyx_k_all_scores), 0, 0, 1, 1},
    {&__pyx_n_s_allow_pickle, __pyx_k_allow_pickle, sizeof(__pyx_k_allow_pickle), 0, 0, 1, 1},
    {&__pyx_n_s_allow_repeats, __pyx_k_allow_repeats, sizeof(__pyx_k_allow_repeats), 0, 0, 1, 1},
    {&__pyx_n_s_answer, __pyx_k_answer, sizeof(__pyx_k_answer), 0, 0, 1, 1},
    {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
    {&__pyx_n_s_argmax, __pyx_k_argmax, sizeof(__pyx_k_argmax), 0, 0, 1, 1},
    {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
    {&__pyx_n_s_argument, __pyx_k_argument, sizeof(__pyx_k_argument), 0, 0, 1, 1},
    {&__pyx_n_s_argument_blocks, __pyx_k_argument_blocks, sizeof(__pyx_k_argument_blocks), 0, 0, 1, 1},
    {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1},
    {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
    {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_average_error, __pyx_k_average_error, sizeof(__pyx_k_average_error), 0, 0, 1, 1},
    {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
    {&__pyx_n_s_backpropagate, __pyx_k_backpropagate, sizeof(__pyx_k_backpropagate), 0, 0, 1, 1},
    {&__pyx_n_s_best_scores, __pyx_k_best_scores, sizeof(__pyx_k_best_scores), 0, 0, 1, 1},
    {&__pyx_n_s_bincount, __pyx_k_bincount, sizeof(__pyx_k_bincount), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_all_scores, __pyx_k_calculate_all_scores, sizeof(__pyx_k_calculate_all_scores), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_delta, __pyx_k_calculate_delta, sizeof(__pyx_k_calculate_delta), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_gradients, __pyx_k_calculate_gradients, sizeof(__pyx_k_calculate_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_gradients_classify, __pyx_k_calculate_gradients_classify, sizeof(__pyx_k_calculate_gradients_classify), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_gradients_sll, __pyx_k_calculate_gradients_sll, sizeof(__pyx_k_calculate_gradients_sll), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_gradients_wll, __pyx_k_calculate_gradients_wll, sizeof(__pyx_k_calculate_gradients_wll), 0, 0, 1, 1},
    {&__pyx_n_s_calculate_input_deltas, __pyx_k_calculate_input_deltas, sizeof(__pyx_k_calculate_input_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
    {&__pyx_n_u_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 1, 0, 1},
    {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
    {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
    {&__pyx_n_s_column_numbers, __pyx_k_column_numbers, sizeof(__pyx_k_column_numbers), 0, 0, 1, 1},
    {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1},
    {&__pyx_n_s_confidence, __pyx_k_confidence, sizeof(__pyx_k_confidence), 0, 0, 1, 1},
    {&__pyx_n_s_conflicting_probs, __pyx_k_conflicting_probs, sizeof(__pyx_k_conflicting_probs), 0, 0, 1, 1},
    {&__pyx_n_s_conflicting_tag, __pyx_k_conflicting_tag, sizeof(__pyx_k_conflicting_tag), 0, 0, 1, 1},
    {&__pyx_n_s_contract_cycle, __pyx_k_contract_cycle, sizeof(__pyx_k_contract_cycle), 0, 0, 1, 1},
    {&__pyx_n_s_convolution_max, __pyx_k_convolution_max, sizeof(__pyx_k_convolution_max), 0, 0, 1, 1},
    {&__pyx_n_s_convolution_values, __pyx_k_convolution_values, sizeof(__pyx_k_convolution_values), 0, 0, 1, 1},
    {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
    {&__pyx_n_s_correct_path_score, __pyx_k_correct_path_score, sizeof(__pyx_k_correct_path_score), 0, 0, 1, 1},
    {&__pyx_n_s_correction, __pyx_k_correction, sizeof(__pyx_k_correction), 0, 0, 1, 1},
    {&__pyx_kp_u_corrections_skipped_Learning_ra, __pyx_k_corrections_skipped_Learning_ra, sizeof(__pyx_k_corrections_skipped_Learning_ra), 0, 1, 0, 0},
    {&__pyx_kp_u_corrections_skipped_learning_ra, __pyx_k_corrections_skipped_learning_ra, sizeof(__pyx_k_corrections_skipped_learning_ra), 0, 1, 0, 0},
    {&__pyx_n_s_count_nonzero, __pyx_k_count_nonzero, sizeof(__pyx_k_count_nonzero), 0, 0, 1, 1},
    {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1},
    {&__pyx_n_s_create_convolution_lookup, __pyx_k_create_convolution_lookup, sizeof(__pyx_k_create_convolution_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_create_new, __pyx_k_create_new, sizeof(__pyx_k_create_new), 0, 0, 1, 1},
    {&__pyx_n_s_create_new_locals_genexpr, __pyx_k_create_new_locals_genexpr, sizeof(__pyx_k_create_new_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_create_pred_lookup, __pyx_k_create_pred_lookup, sizeof(__pyx_k_create_pred_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_create_sentence_lookup, __pyx_k_create_sentence_lookup, sizeof(__pyx_k_create_sentence_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_create_target_lookup, __pyx_k_create_target_lookup, sizeof(__pyx_k_create_target_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_cycle, __pyx_k_cycle, sizeof(__pyx_k_cycle), 0, 0, 1, 1},
    {&__pyx_n_s_cycle_inds, __pyx_k_cycle_inds, sizeof(__pyx_k_cycle_inds), 0, 0, 1, 1},
    {&__pyx_n_s_cycle_score, __pyx_k_cycle_score, sizeof(__pyx_k_cycle_score), 0, 0, 1, 1},
    {&__pyx_n_s_cycles, __pyx_k_cycles, sizeof(__pyx_k_cycles), 0, 0, 1, 1},
    {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
    {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
    {&__pyx_n_s_dCd_hidden2, __pyx_k_dCd_hidden2, sizeof(__pyx_k_dCd_hidden2), 0, 0, 1, 1},
    {&__pyx_n_s_dCd_tanh, __pyx_k_dCd_tanh, sizeof(__pyx_k_dCd_tanh), 0, 0, 1, 1},
    {&__pyx_n_s_dCdf_2, __pyx_k_dCdf_2, sizeof(__pyx_k_dCdf_2), 0, 0, 1, 1},
    {&__pyx_n_s_dCdf_3, __pyx_k_dCdf_3, sizeof(__pyx_k_dCdf_3), 0, 0, 1, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
    {&__pyx_n_s_decay_factor, __pyx_k_decay_factor, sizeof(__pyx_k_decay_factor), 0, 0, 1, 1},
    {&__pyx_n_s_decrease_learning_rates, __pyx_k_decrease_learning_rates, sizeof(__pyx_k_decrease_learning_rates), 0, 0, 1, 1},
    {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
    {&__pyx_n_s_delta_softmax, __pyx_k_delta_softmax, sizeof(__pyx_k_delta_softmax), 0, 0, 1, 1},
    {&__pyx_n_s_deltas, __pyx_k_deltas, sizeof(__pyx_k_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1},
    {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
    {&__pyx_n_s_desired_accuracy, __pyx_k_desired_accuracy, sizeof(__pyx_k_desired_accuracy), 0, 0, 1, 1},
    {&__pyx_n_s_diagonal, __pyx_k_diagonal, sizeof(__pyx_k_diagonal), 0, 0, 1, 1},
    {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_n_s_dist_deltas, __pyx_k_dist_deltas, sizeof(__pyx_k_dist_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_dist_features, __pyx_k_dist_features, sizeof(__pyx_k_dist_features), 0, 0, 1, 1},
    {&__pyx_n_s_dist_features_per_token, __pyx_k_dist_features_per_token, sizeof(__pyx_k_dist_features_per_token), 0, 0, 1, 1},
    {&__pyx_n_s_dist_pred_from, __pyx_k_dist_pred_from, sizeof(__pyx_k_dist_pred_from), 0, 0, 1, 1},
    {&__pyx_n_s_dist_table_dims, __pyx_k_dist_table_dims, sizeof(__pyx_k_dist_table_dims), 0, 0, 1, 1},
    {&__pyx_n_s_dist_target_from, __pyx_k_dist_target_from, sizeof(__pyx_k_dist_target_from), 0, 0, 1, 1},
    {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
    {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
    {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
    {&__pyx_n_s_embeddings, __pyx_k_embeddings, sizeof(__pyx_k_embeddings), 0, 0, 1, 1},
    {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
    {&__pyx_n_s_empty_like, __pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 0, 1, 1},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
    {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
    {&__pyx_n_s_epoch, __pyx_k_epoch, sizeof(__pyx_k_epoch), 0, 0, 1, 1},
    {&__pyx_n_s_epochs, __pyx_k_epochs, sizeof(__pyx_k_epochs), 0, 0, 1, 1},
    {&__pyx_kp_u_epochs_Error, __pyx_k_epochs_Error, sizeof(__pyx_k_epochs_Error), 0, 1, 0, 0},
    {&__pyx_n_s_epochs_between_reports, __pyx_k_epochs_between_reports, sizeof(__pyx_k_epochs_between_reports), 0, 0, 1, 1},
    {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
    {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
    {&__pyx_n_s_exp_scores, __pyx_k_exp_scores, sizeof(__pyx_k_exp_scores), 0, 0, 1, 1},
    {&__pyx_n_s_exp_sum, __pyx_k_exp_sum, sizeof(__pyx_k_exp_sum), 0, 0, 1, 1},
    {&__pyx_n_s_exponentials, __pyx_k_exponentials, sizeof(__pyx_k_exponentials), 0, 0, 1, 1},
    {&__pyx_n_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 1},
    {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1},
    {&__pyx_n_s_feature_tables, __pyx_k_feature_tables, sizeof(__pyx_k_feature_tables), 0, 0, 1, 1},
    {&__pyx_n_u_feature_tables, __pyx_k_feature_tables, sizeof(__pyx_k_feature_tables), 0, 1, 0, 1},
    {&__pyx_n_s_features, __pyx_k_features, sizeof(__pyx_k_features), 0, 0, 1, 1},
    {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
    {&__pyx_n_s_fill_diagonal, __pyx_k_fill_diagonal, sizeof(__pyx_k_fill_diagonal), 0, 0, 1, 1},
    {&__pyx_n_s_find_cycle_recursive, __pyx_k_find_cycle_recursive, sizeof(__pyx_k_find_cycle_recursive), 0, 0, 1, 1},
    {&__pyx_n_s_find_cycles, __pyx_k_find_cycles, sizeof(__pyx_k_find_cycles), 0, 0, 1, 1},
    {&__pyx_n_s_find_maximum_spanning_tree, __pyx_k_find_maximum_spanning_tree, sizeof(__pyx_k_find_maximum_spanning_tree), 0, 0, 1, 1},
    {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
    {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_generate_save_dict, __pyx_k_generate_save_dict, sizeof(__pyx_k_generate_save_dict), 0, 0, 1, 1},
    {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
    {&__pyx_n_s_get_state, __pyx_k_get_state, sizeof(__pyx_k_get_state), 0, 0, 1, 1},
    {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
    {&__pyx_n_s_gold_head, __pyx_k_gold_head, sizeof(__pyx_k_gold_head), 0, 0, 1, 1},
    {&__pyx_n_s_gold_tag, __pyx_k_gold_tag, sizeof(__pyx_k_gold_tag), 0, 0, 1, 1},
    {&__pyx_n_s_gold_tags, __pyx_k_gold_tags, sizeof(__pyx_k_gold_tags), 0, 0, 1, 1},
    {&__pyx_n_s_grad_matrix, __pyx_k_grad_matrix, sizeof(__pyx_k_grad_matrix), 0, 0, 1, 1},
    {&__pyx_n_s_grad_times_softmax, __pyx_k_grad_times_softmax, sizeof(__pyx_k_grad_times_softmax), 0, 0, 1, 1},
    {&__pyx_n_s_gradients, __pyx_k_gradients, sizeof(__pyx_k_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_gradients_t, __pyx_k_gradients_t, sizeof(__pyx_k_gradients_t), 0, 0, 1, 1},
    {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
    {&__pyx_n_s_greater, __pyx_k_greater, sizeof(__pyx_k_greater), 0, 0, 1, 1},
    {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
    {&__pyx_n_s_head_to_v, __pyx_k_head_to_v, sizeof(__pyx_k_head_to_v), 0, 0, 1, 1},
    {&__pyx_n_s_heads, __pyx_k_heads, sizeof(__pyx_k_heads), 0, 0, 1, 1},
    {&__pyx_n_s_hidden1_bias, __pyx_k_hidden1_bias, sizeof(__pyx_k_hidden1_bias), 0, 0, 1, 1},
    {&__pyx_n_s_hidden1_size, __pyx_k_hidden1_size, sizeof(__pyx_k_hidden1_size), 0, 0, 1, 1},
    {&__pyx_n_s_hidden1_weights, __pyx_k_hidden1_weights, sizeof(__pyx_k_hidden1_weights), 0, 0, 1, 1},
    {&__pyx_n_s_hidden2_bias, __pyx_k_hidden2_bias, sizeof(__pyx_k_hidden2_bias), 0, 0, 1, 1},
    {&__pyx_n_u_hidden2_bias, __pyx_k_hidden2_bias, sizeof(__pyx_k_hidden2_bias), 0, 1, 0, 1},
    {&__pyx_n_s_hidden2_size, __pyx_k_hidden2_size, sizeof(__pyx_k_hidden2_size), 0, 0, 1, 1},
    {&__pyx_n_u_hidden2_size, __pyx_k_hidden2_size, sizeof(__pyx_k_hidden2_size), 0, 1, 0, 1},
    {&__pyx_n_s_hidden2_weights, __pyx_k_hidden2_weights, sizeof(__pyx_k_hidden2_weights), 0, 0, 1, 1},
    {&__pyx_n_u_hidden2_weights, __pyx_k_hidden2_weights, sizeof(__pyx_k_hidden2_weights), 0, 1, 0, 1},
    {&__pyx_n_s_hidden_bias, __pyx_k_hidden_bias, sizeof(__pyx_k_hidden_bias), 0, 0, 1, 1},
    {&__pyx_n_u_hidden_bias, __pyx_k_hidden_bias, sizeof(__pyx_k_hidden_bias), 0, 1, 0, 1},
    {&__pyx_n_s_hidden_bias_deltas, __pyx_k_hidden_bias_deltas, sizeof(__pyx_k_hidden_bias_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_hidden_deltas, __pyx_k_hidden_deltas, sizeof(__pyx_k_hidden_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_hidden_gradients, __pyx_k_hidden_gradients, sizeof(__pyx_k_hidden_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_hidden_size, __pyx_k_hidden_size, sizeof(__pyx_k_hidden_size), 0, 0, 1, 1},
    {&__pyx_n_u_hidden_size, __pyx_k_hidden_size, sizeof(__pyx_k_hidden_size), 0, 1, 0, 1},
    {&__pyx_n_s_hidden_weights, __pyx_k_hidden_weights, sizeof(__pyx_k_hidden_weights), 0, 0, 1, 1},
    {&__pyx_n_u_hidden_weights, __pyx_k_hidden_weights, sizeof(__pyx_k_hidden_weights), 0, 1, 0, 1},
    {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1},
    {&__pyx_n_s_highest_prob_arg, __pyx_k_highest_prob_arg, sizeof(__pyx_k_highest_prob_arg), 0, 0, 1, 1},
    {&__pyx_n_s_hits, __pyx_k_hits, sizeof(__pyx_k_hits), 0, 0, 1, 1},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_n_s_i_args, __pyx_k_i_args, sizeof(__pyx_k_i_args), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_incoming_weights, __pyx_k_incoming_weights, sizeof(__pyx_k_incoming_weights), 0, 0, 1, 1},
    {&__pyx_n_s_ind_from, __pyx_k_ind_from, sizeof(__pyx_k_ind_from), 0, 0, 1, 1},
    {&__pyx_n_s_ind_to, __pyx_k_ind_to, sizeof(__pyx_k_ind_to), 0, 0, 1, 1},
    {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
    {&__pyx_n_s_inds, __pyx_k_inds, sizeof(__pyx_k_inds), 0, 0, 1, 1},
    {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
    {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_n_s_input_and_pred_dist_values, __pyx_k_input_and_pred_dist_values, sizeof(__pyx_k_input_and_pred_dist_values), 0, 0, 1, 1},
    {&__pyx_n_s_input_data, __pyx_k_input_data, sizeof(__pyx_k_input_data), 0, 0, 1, 1},
    {&__pyx_n_s_input_deltas, __pyx_k_input_deltas, sizeof(__pyx_k_input_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_input_gradients, __pyx_k_input_gradients, sizeof(__pyx_k_input_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_input_size, __pyx_k_input_size, sizeof(__pyx_k_input_size), 0, 0, 1, 1},
    {&__pyx_n_u_input_size, __pyx_k_input_size, sizeof(__pyx_k_input_size), 0, 1, 0, 1},
    {&__pyx_n_s_input_size_with_distance, __pyx_k_input_size_with_distance, sizeof(__pyx_k_input_size_with_distance), 0, 0, 1, 1},
    {&__pyx_n_s_input_values, __pyx_k_input_values, sizeof(__pyx_k_input_values), 0, 0, 1, 1},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
    {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
    {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1},
    {&__pyx_n_s_last_accuracy, __pyx_k_last_accuracy, sizeof(__pyx_k_last_accuracy), 0, 0, 1, 1},
    {&__pyx_n_s_last_error, __pyx_k_last_error, sizeof(__pyx_k_last_error), 0, 0, 1, 1},
    {&__pyx_n_s_last_tag, __pyx_k_last_tag, sizeof(__pyx_k_last_tag), 0, 0, 1, 1},
    {&__pyx_n_s_last_token, __pyx_k_last_token, sizeof(__pyx_k_last_token), 0, 0, 1, 1},
    {&__pyx_n_s_last_values, __pyx_k_last_values, sizeof(__pyx_k_last_values), 0, 0, 1, 1},
    {&__pyx_n_s_less, __pyx_k_less, sizeof(__pyx_k_less), 0, 0, 1, 1},
    {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
    {&__pyx_n_s_load_from_file, __pyx_k_load_from_file, sizeof(__pyx_k_load_from_file), 0, 0, 1, 1},
    {&__pyx_n_s_load_from_file_2, __pyx_k_load_from_file_2, sizeof(__pyx_k_load_from_file_2), 0, 0, 1, 1},
    {&__pyx_n_s_load_parameters, __pyx_k_load_parameters, sizeof(__pyx_k_load_parameters), 0, 0, 1, 1},
    {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
    {&__pyx_n_s_log_sum_scores, __pyx_k_log_sum_scores, sizeof(__pyx_k_log_sum_scores), 0, 0, 1, 1},
    {&__pyx_n_s_logadd, __pyx_k_logadd, sizeof(__pyx_k_logadd), 0, 0, 1, 1},
    {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
    {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
    {&__pyx_n_s_logical_and, __pyx_k_logical_and, sizeof(__pyx_k_logical_and), 0, 0, 1, 1},
    {&__pyx_n_s_logical_not, __pyx_k_logical_not, sizeof(__pyx_k_logical_not), 0, 0, 1, 1},
    {&__pyx_n_s_logprob, __pyx_k_logprob, sizeof(__pyx_k_logprob), 0, 0, 1, 1},
    {&__pyx_n_s_logprobs, __pyx_k_logprobs, sizeof(__pyx_k_logprobs), 0, 0, 1, 1},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
    {&__pyx_n_s_max_incoming_inds, __pyx_k_max_incoming_inds, sizeof(__pyx_k_max_incoming_inds), 0, 0, 1, 1},
    {&__pyx_n_s_max_incoming_weights, __pyx_k_max_incoming_weights, sizeof(__pyx_k_max_incoming_weights), 0, 0, 1, 1},
    {&__pyx_n_s_max_outgoing_inds, __pyx_k_max_outgoing_inds, sizeof(__pyx_k_max_outgoing_inds), 0, 0, 1, 1},
    {&__pyx_n_s_max_outgoing_weights, __pyx_k_max_outgoing_weights, sizeof(__pyx_k_max_outgoing_weights), 0, 0, 1, 1},
    {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
    {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
    {&__pyx_n_s_net, __pyx_k_net, sizeof(__pyx_k_net), 0, 0, 1, 1},
    {&__pyx_n_s_net_scores, __pyx_k_net_scores, sizeof(__pyx_k_net_scores), 0, 0, 1, 1},
    {&__pyx_n_s_net_tag, __pyx_k_net_tag, sizeof(__pyx_k_net_tag), 0, 0, 1, 1},
    {&__pyx_n_s_network_filename, __pyx_k_network_filename, sizeof(__pyx_k_network_filename), 0, 0, 1, 1},
    {&__pyx_n_s_neuron_maxes, __pyx_k_neuron_maxes, sizeof(__pyx_k_neuron_maxes), 0, 0, 1, 1},
    {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
    {&__pyx_n_s_new_data, __pyx_k_new_data, sizeof(__pyx_k_new_data), 0, 0, 1, 1},
    {&__pyx_n_s_new_head, __pyx_k_new_head, sizeof(__pyx_k_new_head), 0, 0, 1, 1},
    {&__pyx_n_s_new_head_ind, __pyx_k_new_head_ind, sizeof(__pyx_k_new_head_ind), 0, 0, 1, 1},
    {&__pyx_n_s_new_shape, __pyx_k_new_shape, sizeof(__pyx_k_new_shape), 0, 0, 1, 1},
    {&__pyx_n_s_next_vertex, __pyx_k_next_vertex, sizeof(__pyx_k_next_vertex), 0, 0, 1, 1},
    {&__pyx_n_s_nltkor_tag_libs_network, __pyx_k_nltkor_tag_libs_network, sizeof(__pyx_k_nltkor_tag_libs_network), 0, 0, 1, 1},
    {&__pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_k_nltkor_tag_libs_network_pyx, sizeof(__pyx_k_nltkor_tag_libs_network_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_k_nltkor_tag_libs_networkconv_pyx, sizeof(__pyx_k_nltkor_tag_libs_networkconv_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_k_nltkor_tag_libs_networkdependenc, sizeof(__pyx_k_nltkor_tag_libs_networkdependenc), 0, 0, 1, 0},
    {&__pyx_n_s_nn, __pyx_k_nn, sizeof(__pyx_k_nn), 0, 0, 1, 1},
    {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
    {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
    {&__pyx_n_s_num_dims, __pyx_k_num_dims, sizeof(__pyx_k_num_dims), 0, 0, 1, 1},
    {&__pyx_n_s_num_dist_features, __pyx_k_num_dist_features, sizeof(__pyx_k_num_dist_features), 0, 0, 1, 1},
    {&__pyx_n_s_num_distances, __pyx_k_num_distances, sizeof(__pyx_k_num_distances), 0, 0, 1, 1},
    {&__pyx_n_s_num_items, __pyx_k_num_items, sizeof(__pyx_k_num_items), 0, 0, 1, 1},
    {&__pyx_n_s_num_tokens, __pyx_k_num_tokens, sizeof(__pyx_k_num_tokens), 0, 0, 1, 1},
    {&__pyx_n_s_num_vertices, __pyx_k_num_vertices, sizeof(__pyx_k_num_vertices), 0, 0, 1, 1},
    {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
    {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
    {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
    {&__pyx_n_s_old_head, __pyx_k_old_head, sizeof(__pyx_k_old_head), 0, 0, 1, 1},
    {&__pyx_n_s_other_args, __pyx_k_other_args, sizeof(__pyx_k_other_args), 0, 0, 1, 1},
    {&__pyx_n_s_outgoing_weights, __pyx_k_outgoing_weights, sizeof(__pyx_k_outgoing_weights), 0, 0, 1, 1},
    {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
    {&__pyx_n_s_output_bias, __pyx_k_output_bias, sizeof(__pyx_k_output_bias), 0, 0, 1, 1},
    {&__pyx_n_u_output_bias, __pyx_k_output_bias, sizeof(__pyx_k_output_bias), 0, 1, 0, 1},
    {&__pyx_n_s_output_bias_deltas, __pyx_k_output_bias_deltas, sizeof(__pyx_k_output_bias_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_output_deltas, __pyx_k_output_deltas, sizeof(__pyx_k_output_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_output_dim, __pyx_k_output_dim, sizeof(__pyx_k_output_dim), 0, 0, 1, 1},
    {&__pyx_n_s_output_range, __pyx_k_output_range, sizeof(__pyx_k_output_range), 0, 0, 1, 1},
    {&__pyx_n_s_output_size, __pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 0, 1, 1},
    {&__pyx_n_u_output_size, __pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 1, 0, 1},
    {&__pyx_n_s_output_weights, __pyx_k_output_weights, sizeof(__pyx_k_output_weights), 0, 0, 1, 1},
    {&__pyx_n_u_output_weights, __pyx_k_output_weights, sizeof(__pyx_k_output_weights), 0, 1, 0, 1},
    {&__pyx_n_s_outside, __pyx_k_outside, sizeof(__pyx_k_outside), 0, 0, 1, 1},
    {&__pyx_n_s_outside_inds, __pyx_k_outside_inds, sizeof(__pyx_k_outside_inds), 0, 0, 1, 1},
    {&__pyx_n_s_padded_sentence, __pyx_k_padded_sentence, sizeof(__pyx_k_padded_sentence), 0, 0, 1, 1},
    {&__pyx_n_s_padding_left, __pyx_k_padding_left, sizeof(__pyx_k_padding_left), 0, 0, 1, 1},
    {&__pyx_n_u_padding_left, __pyx_k_padding_left, sizeof(__pyx_k_padding_left), 0, 1, 0, 1},
    {&__pyx_n_s_padding_right, __pyx_k_padding_right, sizeof(__pyx_k_padding_right), 0, 0, 1, 1},
    {&__pyx_n_u_padding_right, __pyx_k_padding_right, sizeof(__pyx_k_padding_right), 0, 1, 0, 1},
    {&__pyx_n_s_path_backtrack, __pyx_k_path_backtrack, sizeof(__pyx_k_path_backtrack), 0, 0, 1, 1},
    {&__pyx_n_s_path_scores, __pyx_k_path_scores, sizeof(__pyx_k_path_scores), 0, 0, 1, 1},
    {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
    {&__pyx_n_s_pos_deltas, __pyx_k_pos_deltas, sizeof(__pyx_k_pos_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_pos_dist, __pyx_k_pos_dist, sizeof(__pyx_k_pos_dist), 0, 0, 1, 1},
    {&__pyx_n_s_pos_padding, __pyx_k_pos_padding, sizeof(__pyx_k_pos_padding), 0, 0, 1, 1},
    {&__pyx_n_s_pre_deltas, __pyx_k_pre_deltas, sizeof(__pyx_k_pre_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_pre_dist, __pyx_k_pre_dist, sizeof(__pyx_k_pre_dist), 0, 0, 1, 1},
    {&__pyx_n_s_pre_padding, __pyx_k_pre_padding, sizeof(__pyx_k_pre_padding), 0, 0, 1, 1},
    {&__pyx_n_s_pre_tagging_setup, __pyx_k_pre_tagging_setup, sizeof(__pyx_k_pre_tagging_setup), 0, 0, 1, 1},
    {&__pyx_n_s_pred_answer, __pyx_k_pred_answer, sizeof(__pyx_k_pred_answer), 0, 0, 1, 1},
    {&__pyx_n_s_pred_arguments, __pyx_k_pred_arguments, sizeof(__pyx_k_pred_arguments), 0, 0, 1, 1},
    {&__pyx_n_s_pred_dist_gradients, __pyx_k_pred_dist_gradients, sizeof(__pyx_k_pred_dist_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_pred_dist_indices, __pyx_k_pred_dist_indices, sizeof(__pyx_k_pred_dist_indices), 0, 0, 1, 1},
    {&__pyx_n_s_pred_dist_table, __pyx_k_pred_dist_table, sizeof(__pyx_k_pred_dist_table), 0, 0, 1, 1},
    {&__pyx_n_u_pred_dist_table, __pyx_k_pred_dist_table, sizeof(__pyx_k_pred_dist_table), 0, 1, 0, 1},
    {&__pyx_n_s_pred_dist_values, __pyx_k_pred_dist_values, sizeof(__pyx_k_pred_dist_values), 0, 0, 1, 1},
    {&__pyx_n_s_pred_dist_weights, __pyx_k_pred_dist_weights, sizeof(__pyx_k_pred_dist_weights), 0, 0, 1, 1},
    {&__pyx_n_u_pred_dist_weights, __pyx_k_pred_dist_weights, sizeof(__pyx_k_pred_dist_weights), 0, 1, 0, 1},
    {&__pyx_n_s_pred_dists, __pyx_k_pred_dists, sizeof(__pyx_k_pred_dists), 0, 0, 1, 1},
    {&__pyx_n_s_pred_tags, __pyx_k_pred_tags, sizeof(__pyx_k_pred_tags), 0, 0, 1, 1},
    {&__pyx_n_s_predicate, __pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 0, 1, 1},
    {&__pyx_n_s_predicate_answer, __pyx_k_predicate_answer, sizeof(__pyx_k_predicate_answer), 0, 0, 1, 1},
    {&__pyx_n_s_predicate_tags, __pyx_k_predicate_tags, sizeof(__pyx_k_predicate_tags), 0, 0, 1, 1},
    {&__pyx_n_s_predicates, __pyx_k_predicates, sizeof(__pyx_k_predicates), 0, 0, 1, 1},
    {&__pyx_n_s_prev_score_and_trans, __pyx_k_prev_score_and_trans, sizeof(__pyx_k_prev_score_and_trans), 0, 0, 1, 1},
    {&__pyx_n_s_previous_tag, __pyx_k_previous_tag, sizeof(__pyx_k_previous_tag), 0, 0, 1, 1},
    {&__pyx_n_s_print_epoch_report, __pyx_k_print_epoch_report, sizeof(__pyx_k_print_epoch_report), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_ConvolutionalDepe, __pyx_k_pyx_unpickle_ConvolutionalDepe, sizeof(__pyx_k_pyx_unpickle_ConvolutionalDepe), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_ConvolutionalNetw, __pyx_k_pyx_unpickle_ConvolutionalNetw, sizeof(__pyx_k_pyx_unpickle_ConvolutionalNetw), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_Network, __pyx_k_pyx_unpickle_Network, sizeof(__pyx_k_pyx_unpickle_Network), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
    {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
    {&__pyx_n_s_random_state, __pyx_k_random_state, sizeof(__pyx_k_random_state), 0, 0, 1, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
    {&__pyx_n_s_reachable, __pyx_k_reachable, sizeof(__pyx_k_reachable), 0, 0, 1, 1},
    {&__pyx_n_s_reachable_vertices, __pyx_k_reachable_vertices, sizeof(__pyx_k_reachable_vertices), 0, 0, 1, 1},
    {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
    {&__pyx_n_s_reset_counters, __pyx_k_reset_counters, sizeof(__pyx_k_reset_counters), 0, 0, 1, 1},
    {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
    {&__pyx_n_s_rollaxis, __pyx_k_rollaxis, sizeof(__pyx_k_rollaxis), 0, 0, 1, 1},
    {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
    {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1},
    {&__pyx_n_s_savez, __pyx_k_savez, sizeof(__pyx_k_savez), 0, 0, 1, 1},
    {&__pyx_n_s_scores, __pyx_k_scores, sizeof(__pyx_k_scores), 0, 0, 1, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
    {&__pyx_n_s_sent, __pyx_k_sent, sizeof(__pyx_k_sent), 0, 0, 1, 1},
    {&__pyx_n_s_sent_args, __pyx_k_sent_args, sizeof(__pyx_k_sent_args), 0, 0, 1, 1},
    {&__pyx_n_s_sent_preds, __pyx_k_sent_preds, sizeof(__pyx_k_sent_preds), 0, 0, 1, 1},
    {&__pyx_n_s_sent_tags, __pyx_k_sent_tags, sizeof(__pyx_k_sent_tags), 0, 0, 1, 1},
    {&__pyx_n_s_sentence, __pyx_k_sentence, sizeof(__pyx_k_sentence), 0, 0, 1, 1},
    {&__pyx_n_s_sentence_convolution, __pyx_k_sentence_convolution, sizeof(__pyx_k_sentence_convolution), 0, 0, 1, 1},
    {&__pyx_n_s_sentence_hit, __pyx_k_sentence_hit, sizeof(__pyx_k_sentence_hit), 0, 0, 1, 1},
    {&__pyx_n_s_sentence_hits, __pyx_k_sentence_hits, sizeof(__pyx_k_sentence_hits), 0, 0, 1, 1},
    {&__pyx_n_s_sentences, __pyx_k_sentences, sizeof(__pyx_k_sentences), 0, 0, 1, 1},
    {&__pyx_n_s_set_learning_rate_decay, __pyx_k_set_learning_rate_decay, sizeof(__pyx_k_set_learning_rate_decay), 0, 0, 1, 1},
    {&__pyx_n_s_set_state, __pyx_k_set_state, sizeof(__pyx_k_set_state), 0, 0, 1, 1},
    {&__pyx_n_s_set_validation_data, __pyx_k_set_validation_data, sizeof(__pyx_k_set_validation_data), 0, 0, 1, 1},
    {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
    {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1},
    {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1},
    {&__pyx_n_s_shuffle_data, __pyx_k_shuffle_data, sizeof(__pyx_k_shuffle_data), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
    {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
    {&__pyx_n_s_start_from, __pyx_k_start_from, sizeof(__pyx_k_start_from), 0, 0, 1, 1},
    {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
    {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
    {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
    {&__pyx_n_s_sumlogadd, __pyx_k_sumlogadd, sizeof(__pyx_k_sumlogadd), 0, 0, 1, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
    {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1},
    {&__pyx_n_s_table_deltas, __pyx_k_table_deltas, sizeof(__pyx_k_table_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_table_dims, __pyx_k_table_dims, sizeof(__pyx_k_table_dims), 0, 0, 1, 1},
    {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
    {&__pyx_n_s_tag_scores, __pyx_k_tag_scores, sizeof(__pyx_k_tag_scores), 0, 0, 1, 1},
    {&__pyx_n_s_tag_sentence, __pyx_k_tag_sentence, sizeof(__pyx_k_tag_sentence), 0, 0, 1, 1},
    {&__pyx_n_s_tag_sentence_2, __pyx_k_tag_sentence_2, sizeof(__pyx_k_tag_sentence_2), 0, 0, 1, 1},
    {&__pyx_n_s_tag_sentence_labeled_dependency, __pyx_k_tag_sentence_labeled_dependency, sizeof(__pyx_k_tag_sentence_labeled_dependency), 0, 0, 1, 1},
    {&__pyx_n_s_tag_sentence_unlabeled_dependen, __pyx_k_tag_sentence_unlabeled_dependen, sizeof(__pyx_k_tag_sentence_unlabeled_dependen), 0, 0, 1, 1},
    {&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
    {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
    {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
    {&__pyx_n_s_target_dist_gradients, __pyx_k_target_dist_gradients, sizeof(__pyx_k_target_dist_gradients), 0, 0, 1, 1},
    {&__pyx_n_s_target_dist_indices, __pyx_k_target_dist_indices, sizeof(__pyx_k_target_dist_indices), 0, 0, 1, 1},
    {&__pyx_n_s_target_dist_table, __pyx_k_target_dist_table, sizeof(__pyx_k_target_dist_table), 0, 0, 1, 1},
    {&__pyx_n_u_target_dist_table, __pyx_k_target_dist_table, sizeof(__pyx_k_target_dist_table), 0, 1, 0, 1},
    {&__pyx_n_s_target_dist_values, __pyx_k_target_dist_values, sizeof(__pyx_k_target_dist_values), 0, 0, 1, 1},
    {&__pyx_n_s_target_dist_weights, __pyx_k_target_dist_weights, sizeof(__pyx_k_target_dist_weights), 0, 0, 1, 1},
    {&__pyx_n_u_target_dist_weights, __pyx_k_target_dist_weights, sizeof(__pyx_k_target_dist_weights), 0, 1, 0, 1},
    {&__pyx_n_s_target_dists, __pyx_k_target_dists, sizeof(__pyx_k_target_dists), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
    {&__pyx_n_s_tile, __pyx_k_tile, sizeof(__pyx_k_tile), 0, 0, 1, 1},
    {&__pyx_n_s_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 0, 1, 1},
    {&__pyx_n_s_token_indices, __pyx_k_token_indices, sizeof(__pyx_k_token_indices), 0, 0, 1, 1},
    {&__pyx_n_s_token_scores, __pyx_k_token_scores, sizeof(__pyx_k_token_scores), 0, 0, 1, 1},
    {&__pyx_n_s_top_accuracy, __pyx_k_top_accuracy, sizeof(__pyx_k_top_accuracy), 0, 0, 1, 1},
    {&__pyx_n_s_train, __pyx_k_train, sizeof(__pyx_k_train), 0, 0, 1, 1},
    {&__pyx_n_s_train_epoch, __pyx_k_train_epoch, sizeof(__pyx_k_train_epoch), 0, 0, 1, 1},
    {&__pyx_n_s_train_locals_genexpr, __pyx_k_train_locals_genexpr, sizeof(__pyx_k_train_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_training, __pyx_k_training, sizeof(__pyx_k_training), 0, 0, 1, 1},
    {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1},
    {&__pyx_n_s_transitions, __pyx_k_transitions, sizeof(__pyx_k_transitions), 0, 0, 1, 1},
    {&__pyx_n_u_transitions, __pyx_k_transitions, sizeof(__pyx_k_transitions), 0, 1, 0, 1},
    {&__pyx_n_s_transitions_t, __pyx_k_transitions_t, sizeof(__pyx_k_transitions_t), 0, 0, 1, 1},
    {&__pyx_n_s_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 1, 1},
    {&__pyx_n_s_unreachable, __pyx_k_unreachable, sizeof(__pyx_k_unreachable), 0, 0, 1, 1},
    {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
    {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1},
    {&__pyx_n_s_validate_locals_genexpr, __pyx_k_validate_locals_genexpr, sizeof(__pyx_k_validate_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_validation_arguments, __pyx_k_validation_arguments, sizeof(__pyx_k_validation_arguments), 0, 0, 1, 1},
    {&__pyx_n_s_validation_predicates, __pyx_k_validation_predicates, sizeof(__pyx_k_validation_predicates), 0, 0, 1, 1},
    {&__pyx_n_s_validation_sentences, __pyx_k_validation_sentences, sizeof(__pyx_k_validation_sentences), 0, 0, 1, 1},
    {&__pyx_n_s_validation_tags, __pyx_k_validation_tags, sizeof(__pyx_k_validation_tags), 0, 0, 1, 1},
    {&__pyx_n_s_vertex, __pyx_k_vertex, sizeof(__pyx_k_vertex), 0, 0, 1, 1},
    {&__pyx_n_s_vertex_leaving_cycle, __pyx_k_vertex_leaving_cycle, sizeof(__pyx_k_vertex_leaving_cycle), 0, 0, 1, 1},
    {&__pyx_n_s_vertex_leaving_cycle_ind, __pyx_k_vertex_leaving_cycle_ind, sizeof(__pyx_k_vertex_leaving_cycle_ind), 0, 0, 1, 1},
    {&__pyx_n_s_vertices_in_cycles, __pyx_k_vertices_in_cycles, sizeof(__pyx_k_vertices_in_cycles), 0, 0, 1, 1},
    {&__pyx_n_s_visited, __pyx_k_visited, sizeof(__pyx_k_visited), 0, 0, 1, 1},
    {&__pyx_n_s_viterbi, __pyx_k_viterbi, sizeof(__pyx_k_viterbi), 0, 0, 1, 1},
    {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
    {&__pyx_n_s_w_deltas, __pyx_k_w_deltas, sizeof(__pyx_k_w_deltas), 0, 0, 1, 1},
    {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
    {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
    {&__pyx_n_s_window_from, __pyx_k_window_from, sizeof(__pyx_k_window_from), 0, 0, 1, 1},
    {&__pyx_n_s_window_to, __pyx_k_window_to, sizeof(__pyx_k_window_to), 0, 0, 1, 1},
    {&__pyx_n_s_word_window, __pyx_k_word_window, sizeof(__pyx_k_word_window), 0, 0, 1, 1},
    {&__pyx_n_s_word_window_size, __pyx_k_word_window_size, sizeof(__pyx_k_word_window_size), 0, 0, 1, 1},
    {&__pyx_n_u_word_window_size, __pyx_k_word_window_size, sizeof(__pyx_k_word_window_size), 0, 1, 0, 1},
    {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
    {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
    {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
    {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1},
    {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 133, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 233, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 303, __pyx_L1_error)
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 345, __pyx_L1_error)
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 345, __pyx_L1_error)
  #endif
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 370, __pyx_L1_error)
  __pyx_builtin_FloatingPointError = __Pyx_GetBuiltinName(__pyx_n_s_FloatingPointError); if (!__pyx_builtin_FloatingPointError) __PYX_ERR(0, 689, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 564, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "../../wheel_env/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "nltkor/tag/libs/network.pyx":237
 *             ind_to = ind_from + num_dims
 * 
 *             token_indices = padded_sentence[:, i]             # <<<<<<<<<<<<<<
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 */
  __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__8);
  __Pyx_GIVEREF(__pyx_slice__8);

  /* "nltkor/tag/libs/network.pyx":343
 *         # delta_t(k) = ftheta_k,t + logadd_i(delta_t-1(i) + A_i,k)
 *         #            = ftheta_k,t + log(Sum_i(exp(delta_t-1(i) + A_i,k)))
 *         transitions = self.transitions[:-1].T # A_k,i             # <<<<<<<<<<<<<<
 * 
 *         for token in xrange(1, len(delta)):
 */
  __pyx_slice__12 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__12);
  __Pyx_GIVEREF(__pyx_slice__12);

  /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
 */
  __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);

  /* "nltkor/tag/libs/network.pyx":450
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax             # <<<<<<<<<<<<<<
 * 
 *             # sum all transition gradients by row to find the network gradients
 */
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__12, __pyx_slice__8); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "nltkor/tag/libs/networkconv.pyx":564
 *             if logprob:
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')             # <<<<<<<<<<<<<<
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_u_Confidence_measure_not_implement); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "nltkor/tag/libs/networkconv.pyx":830
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
 */
  __pyx_slice__56 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(1, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__56);
  __Pyx_GIVEREF(__pyx_slice__56);
  __pyx_tuple__57 = PyTuple_Pack(2, __pyx_slice__56, __pyx_slice__8); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 */
  __pyx_slice__59 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) __PYX_ERR(1, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__59);
  __Pyx_GIVEREF(__pyx_slice__59);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 */
  __pyx_tuple__85 = PyTuple_Pack(3, __pyx_int_119830996, __pyx_int_220499725, __pyx_int_202246394); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_tuple__88 = PyTuple_Pack(3, __pyx_int_49696698, __pyx_int_148123145, __pyx_int_149446146); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_212151326, __pyx_int_145891266, __pyx_int_27816595); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
 */
  __pyx_tuple__92 = PyTuple_Pack(15, __pyx_n_s_cls, __pyx_n_s_feature_tables, __pyx_n_s_word_window, __pyx_n_s_hidden_size, __pyx_n_s_output_size, __pyx_n_s_input_size, __pyx_n_s_high, __pyx_n_s_hidden_weights, __pyx_n_s_hidden_bias, __pyx_n_s_output_weights, __pyx_n_s_output_bias, __pyx_n_s_transitions, __pyx_n_s_net, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_create_new, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 126, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
 */
  __pyx_tuple__93 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_table_dims, __pyx_n_s_desc, __pyx_n_s_t); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_description, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 200, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
 */
  __pyx_tuple__94 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_padded_sentence, __pyx_n_s_ind_from, __pyx_n_s_i, __pyx_n_s_table, __pyx_n_s_num_dims, __pyx_n_s_ind_to, __pyx_n_s_token_indices, __pyx_n_s_embeddings); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_create_sentence_lookup, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 217, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */
  __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_scores); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_tag_sentence_2, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 267, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */
  __pyx_tuple__96 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_tags, __pyx_n_s_answer, __pyx_n_s_input_data, __pyx_n_s_scores, __pyx_n_s_training, __pyx_n_s_i, __pyx_n_s_output); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_tag_sentence, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_tuple__97 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
 */
  __pyx_tuple__98 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_scores, __pyx_n_s_delta, __pyx_n_s_transitions, __pyx_n_s_token, __pyx_n_s_logadd); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_calculate_delta, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 323, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
 */
  __pyx_tuple__99 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_tags, __pyx_n_s_scores, __pyx_n_s_delta, __pyx_n_s_delta_softmax, __pyx_n_s_correct_path_score, __pyx_n_s_last_tag, __pyx_n_s_tag, __pyx_n_s_net_scores, __pyx_n_s_trans, __pyx_n_s_error, __pyx_n_s_sumlogadd, __pyx_n_s_transitions_t, __pyx_n_s_t, __pyx_n_s_path_scores, __pyx_n_s_log_sum_scores, __pyx_n_s_grad_times_softmax, __pyx_n_s_token); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_calculate_gradients_sll, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 352, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
 */
  __pyx_tuple__100 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_tags, __pyx_n_s_scores, __pyx_n_s_exponentials, __pyx_n_s_correct_path_score, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_net_scores, __pyx_n_s_error); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_calculate_gradients_wll, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
 */
  __pyx_tuple__101 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_scores, __pyx_n_s_path_scores, __pyx_n_s_path_backtrack, __pyx_n_s_output_range, __pyx_n_s_transitions, __pyx_n_s_i, __pyx_n_s_prev_score_and_trans, __pyx_n_s_answer, __pyx_n_s_previous_tag); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_viterbi, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 507, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
 */
  __pyx_tuple__102 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_validation_sentences, __pyx_n_s_validation_tags); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_set_validation_data, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 555, __pyx_L1_error)
  __pyx_tuple__103 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
 */
  __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_decay_factor); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_set_learning_rate_decay, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 567, __pyx_L1_error)
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_float_1_0); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
 */
  __pyx_tuple__106 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_epoch, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_decrease_learning_rates, 579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 579, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
 */
  __pyx_tuple__107 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_tags, __pyx_n_s_epochs, __pyx_n_s_epochs_between_reports, __pyx_n_s_desired_accuracy, __pyx_n_s_logger, __pyx_n_s_top_accuracy, __pyx_n_s_last_accuracy, __pyx_n_s_last_error, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_train, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 595, __pyx_L1_error)
  __pyx_tuple__108 = PyTuple_Pack(2, __pyx_int_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */
  __pyx_tuple__109 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_num, __pyx_n_s_logger); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_print_epoch_report, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 656, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
 */
  __pyx_tuple__110 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_tags, __pyx_n_s_random_state, __pyx_n_s_sent, __pyx_n_s_sent_tags); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_train_epoch, 670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 670, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
 */
  __pyx_tuple__111 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_hits, __pyx_n_s_sent, __pyx_n_s_gold_tags, __pyx_n_s_answer, __pyx_n_s_num_tokens, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_validate, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 693, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
 */
  __pyx_tuple__112 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_output_deltas, __pyx_n_s_output_bias_deltas, __pyx_n_s_dCdf_3, __pyx_n_s_dCdf_2, __pyx_n_s_hidden_deltas, __pyx_n_s_hidden_bias_deltas, __pyx_n_s_input_gradients, __pyx_n_s_input_deltas, __pyx_n_s_padded_sentence, __pyx_n_s_features, __pyx_n_s_table, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_t, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_w_deltas); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_backpropagate, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 705, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
 */
  __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_load_parameters, 804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 804, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_save, 821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 821, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_tuple__115 = PyTuple_Pack(13, __pyx_n_s_cls, __pyx_n_s_filename, __pyx_n_s_data, __pyx_n_s_hidden_weights, __pyx_n_s_hidden_bias, __pyx_n_s_output_weights, __pyx_n_s_output_bias, __pyx_n_s_word_window_size, __pyx_n_s_input_size, __pyx_n_s_hidden_size, __pyx_n_s_output_size, __pyx_n_s_transitions, __pyx_n_s_nn); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_network_pyx, __pyx_n_s_load_from_file_2, 837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 837, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__116 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(4, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
 */
  __pyx_tuple__117 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(4, 16, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
 */
  __pyx_tuple__118 = PyTuple_Pack(25, __pyx_n_s_cls, __pyx_n_s_feature_tables, __pyx_n_s_target_dist_table, __pyx_n_s_pred_dist_table, __pyx_n_s_word_window, __pyx_n_s_hidden1_size, __pyx_n_s_hidden2_size, __pyx_n_s_output_size, __pyx_n_s_input_size, __pyx_n_s_dist_features_per_token, __pyx_n_s_input_size_with_distance, __pyx_n_s_high, __pyx_n_s_hidden_weights, __pyx_n_s_num_dist_features, __pyx_n_s_target_dist_weights, __pyx_n_s_pred_dist_weights, __pyx_n_s_hidden_bias, __pyx_n_s_hidden2_weights, __pyx_n_s_hidden2_bias, __pyx_n_s_output_dim, __pyx_n_s_output_weights, __pyx_n_s_output_bias, __pyx_n_s_net, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_create_new, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 51, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 */
  __pyx_tuple__119 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_hidden2_size, __pyx_n_s_table_dims, __pyx_n_s_dist_table_dims, __pyx_n_s_desc, __pyx_n_s_t); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_description, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 100, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
 */
  __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_d); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_generate_save_dict, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 148, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_save, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 169, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
 */
  __pyx_tuple__121 = PyTuple_Pack(15, __pyx_n_s_cls, __pyx_n_s_data, __pyx_n_s_filename, __pyx_n_s_hidden_weights, __pyx_n_s_hidden_bias, __pyx_n_s_hidden2_weights, __pyx_n_s_hidden2_bias, __pyx_n_s_output_weights, __pyx_n_s_output_bias, __pyx_n_s_word_window_size, __pyx_n_s_input_size, __pyx_n_s_hidden_size, __pyx_n_s_hidden2_size, __pyx_n_s_output_size, __pyx_n_s_nn); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_load_from_file, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 178, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_filename, __pyx_n_s_data); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_load_from_file_2, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 224, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
 */
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_load_parameters, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 234, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
 */
  __pyx_tuple__123 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_validation_sentences, __pyx_n_s_validation_predicates, __pyx_n_s_validation_tags, __pyx_n_s_validation_arguments); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_set_validation_data, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 261, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */
  __pyx_tuple__124 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_predicates, __pyx_n_s_tags, __pyx_n_s_epochs, __pyx_n_s_epochs_between_reports, __pyx_n_s_desired_accuracy, __pyx_n_s_arguments, __pyx_n_s_logger, __pyx_n_s_last_accuracy, __pyx_n_s_top_accuracy, __pyx_n_s_last_error, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_train, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 275, __pyx_L1_error)
  __pyx_tuple__125 = PyTuple_Pack(3, __pyx_int_0, __pyx_float_0_0, Py_None); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
 */
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_reset_counters, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 334, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
 */
  __pyx_tuple__126 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_predicates, __pyx_n_s_tags, __pyx_n_s_arguments, __pyx_n_s_random_state); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_shuffle_data, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 343, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
 */
  __pyx_tuple__127 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_predicates, __pyx_n_s_tags, __pyx_n_s_arguments, __pyx_n_s_i_args, __pyx_n_s_sent_args, __pyx_n_s_sent, __pyx_n_s_sent_preds, __pyx_n_s_sent_tags); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_train_epoch, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 360, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
 */
  __pyx_tuple__128 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicates, __pyx_n_s_arguments, __pyx_n_s_logprob, __pyx_n_s_allow_repeats); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_tag_sentence_2, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 381, __pyx_L1_error)
  __pyx_tuple__129 = PyTuple_Pack(3, Py_None, Py_False, Py_True); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 */
  __pyx_tuple__130 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicate, __pyx_n_s_argument_blocks, __pyx_n_s_training, __pyx_n_s_convolution_values, __pyx_n_s_scores, __pyx_n_s_input_and_pred_dist_values, __pyx_n_s_pred_dist_indices, __pyx_n_s_pred_dist_values, __pyx_n_s_target, __pyx_n_s_target_dist_indices, __pyx_n_s_argument, __pyx_n_s_target_dist_values); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_sentence_convolution, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 421, __pyx_L1_error)
  __pyx_tuple__131 = PyTuple_Pack(2, Py_None, Py_False); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
 */
  __pyx_tuple__132 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_training); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_pre_tagging_setup, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(1, 509, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */
  __pyx_tuple__133 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicates, __pyx_n_s_tags, __pyx_n_s_argument_blocks, __pyx_n_s_allow_repeats, __pyx_n_s_logprob, __pyx_n_s_answer, __pyx_n_s_training, __pyx_n_s_token_scores, __pyx_n_s_i, __pyx_n_s_predicate, __pyx_n_s_pred_arguments, __pyx_n_s_pred_answer, __pyx_n_s_pred_tags, __pyx_n_s_all_scores, __pyx_n_s_last_token, __pyx_n_s_logadd, __pyx_n_s_confidence); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_tag_sentence, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 525, __pyx_L1_error)
  __pyx_tuple__134 = PyTuple_Pack(4, Py_None, Py_None, Py_True, Py_False); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
 */
  __pyx_tuple__135 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_num_items, __pyx_n_s_hits, __pyx_n_s_i_args, __pyx_n_s_sent_args, __pyx_n_s_sent, __pyx_n_s_sent_preds, __pyx_n_s_sent_tags, __pyx_n_s_answer, __pyx_n_s_predicate_answer, __pyx_n_s_predicate_tags, __pyx_n_s_net_tag, __pyx_n_s_gold_tag); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(1, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_validate, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 576, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 */
  __pyx_tuple__136 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tags, __pyx_n_s_scores); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_calculate_gradients, 609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 609, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
 */
  __pyx_tuple__137 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_tags, __pyx_n_s_scores, __pyx_n_s_correction, __pyx_n_s_i, __pyx_n_s_tag_scores, __pyx_n_s_tag, __pyx_n_s_exponentials, __pyx_n_s_exp_sum, __pyx_n_s_logadd, __pyx_n_s_error); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_calculate_gradients_classify, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 616, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
 */
  __pyx_tuple__138 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dCd_tanh, __pyx_n_s_dCd_hidden2); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_backpropagate, 653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 653, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
 */
  __pyx_tuple__139 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_predicate, __pyx_n_s_arguments, __pyx_n_s_i, __pyx_n_s_gradients_t, __pyx_n_s_last_values, __pyx_n_s_deltas, __pyx_n_s_grad_matrix, __pyx_n_s_input_values, __pyx_n_s_neuron_maxes, __pyx_n_s_target_dists, __pyx_n_s_argument, __pyx_n_s_dist_features, __pyx_n_s_pred_dists); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(1, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_adjust_weights, 675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 675, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 */
  __pyx_tuple__140 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicate, __pyx_n_s_arguments, __pyx_n_s_hidden_gradients, __pyx_n_s_input_gradients, __pyx_n_s_target_dist_gradients, __pyx_n_s_pred_dist_gradients, __pyx_n_s_gradients, __pyx_n_s_convolution_max, __pyx_n_s_target_dists, __pyx_n_s_column_numbers, __pyx_n_s_target, __pyx_n_s_argument, __pyx_n_s_pred_dists); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_calculate_input_deltas, 742, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 742, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
 */
  __pyx_tuple__141 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicate, __pyx_n_s_start_from, __pyx_n_s_dist_target_from, __pyx_n_s_dist_pred_from, __pyx_n_s_pre_dist, __pyx_n_s_pos_dist, __pyx_n_s_padded_sentence, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_table, __pyx_n_s_table_deltas, __pyx_n_s_token, __pyx_n_s_deltas, __pyx_n_s_dist_deltas, __pyx_n_s_pre_deltas, __pyx_n_s_pos_deltas); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_adjust_features, 797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 797, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
 */
  __pyx_tuple__142 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_scores, __pyx_n_s_allow_repeats, __pyx_n_s_best_scores, __pyx_n_s_logadd, __pyx_n_s_logprobs, __pyx_n_s_counts, __pyx_n_s_conflicting_tag, __pyx_n_s_args, __pyx_n_s_conflicting_probs, __pyx_n_s_highest_prob_arg, __pyx_n_s_other_args, __pyx_n_s_path_scores, __pyx_n_s_path_backtrack, __pyx_n_s_i, __pyx_n_s_token, __pyx_n_s_prev_score_and_trans, __pyx_n_s_answer, __pyx_n_s_previous_tag); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_viterbi, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 849, __pyx_L1_error)
  __pyx_tuple__143 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */
  __pyx_tuple__144 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_num_distances, __pyx_n_s_window_from, __pyx_n_s_window_to, __pyx_n_s_i, __pyx_n_s_shift, __pyx_n_s_inds); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_create_target_lookup, 923, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 923, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_create_pred_lookup, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 952, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
 */
  __pyx_tuple__145 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_training, __pyx_n_s_padded_sentence, __pyx_n_s_window, __pyx_n_s_input_data, __pyx_n_s_new_data, __pyx_n_s_i, __pyx_n_s_element, __pyx_n_s_token_indices, __pyx_n_s_index, __pyx_n_s_table, __pyx_n_s_index, __pyx_n_s_table); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkconv_pyx, __pyx_n_s_create_convolution_lookup, 980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 980, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(4, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
 */
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(4, 16, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_save, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(5, 19, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_filename, __pyx_n_s_data, __pyx_n_s_nn); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_load_from_file_2, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(5, 29, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
 */
  __pyx_tuple__147 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_heads, __pyx_n_s_epochs, __pyx_n_s_epochs_between_reports, __pyx_n_s_desired_accuracy, __pyx_n_s_labels, __pyx_n_s_predicates, __pyx_n_s_sentence); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_train, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(5, 41, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
 */
  __pyx_tuple__148 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_sentences, __pyx_n_s_heads, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(5, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_set_validation_data, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(5, 65, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
 */
  __pyx_tuple__149 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_predicates, __pyx_n_s_heads, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_tag_sentence, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(5, 77, __pyx_L1_error)
  __pyx_tuple__150 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
 */
  __pyx_tuple__151 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_heads, __pyx_n_s_training, __pyx_n_s_num_tokens, __pyx_n_s_token_scores, __pyx_n_s_token, __pyx_n_s_head, __pyx_n_s_answer); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_tag_sentence_unlabeled_dependen, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(5, 87, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
 */
  __pyx_tuple__152 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_heads, __pyx_n_s_labels, __pyx_n_s_answer, __pyx_n_s_scores, __pyx_n_s_training, __pyx_n_s_token, __pyx_n_s_head, __pyx_n_s_label); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(5, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_tag_sentence_labeled_dependency, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(5, 134, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
 */
  __pyx_tuple__153 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_gold_head, __pyx_n_s_scores, __pyx_n_s_exp_scores, __pyx_n_s_exp_sum, __pyx_n_s_error, __pyx_n_s_new_shape); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_calculate_gradients, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(5, 172, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
 */
  __pyx_tuple__154 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_hits, __pyx_n_s_num_tokens, __pyx_n_s_sentence_hits, __pyx_n_s_i, __pyx_n_s_sent, __pyx_n_s_heads, __pyx_n_s_sentence_hit, __pyx_n_s_answer, __pyx_n_s_gold_tags, __pyx_n_s_j, __pyx_n_s_net_tag, __pyx_n_s_gold_tag); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_validate, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(5, 212, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
 */
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_average_error, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(5, 251, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_print_epoch_report, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(5, 257, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
 */
  __pyx_tuple__155 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sentence, __pyx_n_s_heads); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(5, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_tag_sentence_2, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(5, 273, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
 */
  __pyx_tuple__156 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_graph, __pyx_n_s_reachable_vertices, __pyx_n_s_vertices_in_cycles, __pyx_n_s_visited, __pyx_n_s_cycles, __pyx_n_s_vertex, __pyx_n_s_cycle); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_find_cycles, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(5, 287, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
 */
  __pyx_tuple__157 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_graph, __pyx_n_s_vertex, __pyx_n_s_visited, __pyx_n_s_reachable, __pyx_n_s_unreachable, __pyx_n_s_next_vertex, __pyx_n_s_root, __pyx_n_s_cycle); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_find_cycle_recursive, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(5, 318, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
 */
  __pyx_tuple__158 = PyTuple_Pack(25, __pyx_n_s_self, __pyx_n_s_heads, __pyx_n_s_cycle, __pyx_n_s_num_vertices, __pyx_n_s_outside, __pyx_n_s_outgoing_weights, __pyx_n_s_outside_inds, __pyx_n_s_max_outgoing_inds, __pyx_n_s_max_outgoing_weights, __pyx_n_s_cycle_inds, __pyx_n_s_incoming_weights, __pyx_n_s_cycle_score, __pyx_n_s_i, __pyx_n_s_vertex, __pyx_n_s_head_to_v, __pyx_n_s_max_incoming_inds, __pyx_n_s_max_incoming_weights, __pyx_n_s_new_head_ind, __pyx_n_s_vertex_leaving_cycle_ind, __pyx_n_s_new_head, __pyx_n_s_vertex_leaving_cycle, __pyx_n_s_old_head, __pyx_n_s_x, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(5, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_contract_cycle, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(5, 358, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
 */
  __pyx_tuple__159 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_heads, __pyx_n_s_cycles, __pyx_n_s_cycle); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(5, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nltkor_tag_libs_networkdependenc, __pyx_n_s_find_maximum_spanning_tree, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(5, 433, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(4, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
 */
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(4, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__160 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Network, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(4, 1, __pyx_L1_error)
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ConvolutionalNetw, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(4, 1, __pyx_L1_error)
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ConvolutionalDepe, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  __pyx_umethod_PySet_Type_update.type = (PyObject*)&PySet_Type;
  __pyx_umethod_PySet_Type_update.method_name = &__pyx_n_s_update;
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_38 = PyFloat_FromDouble(2.38); if (unlikely(!__pyx_float_2_38)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_neg_1_0 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_float_neg_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_27816595 = PyInt_FromLong(27816595L); if (unlikely(!__pyx_int_27816595)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_49696698 = PyInt_FromLong(49696698L); if (unlikely(!__pyx_int_49696698)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_119830996 = PyInt_FromLong(119830996L); if (unlikely(!__pyx_int_119830996)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_145891266 = PyInt_FromLong(145891266L); if (unlikely(!__pyx_int_145891266)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_148123145 = PyInt_FromLong(148123145L); if (unlikely(!__pyx_int_148123145)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_149446146 = PyInt_FromLong(149446146L); if (unlikely(!__pyx_int_149446146)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_202246394 = PyInt_FromLong(202246394L); if (unlikely(!__pyx_int_202246394)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_212151326 = PyInt_FromLong(212151326L); if (unlikely(!__pyx_int_212151326)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_220499725 = PyInt_FromLong(220499725L); if (unlikely(!__pyx_int_220499725)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1000 = PyInt_FromLong(-1000); if (unlikely(!__pyx_int_neg_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  /* NumpyImportArray.init */
  /*
 * Cython has automatically inserted a call to _import_array since
 * you didn't include one when you cimported numpy. To disable this
 * add the line
 *   <void>numpy._import_array
 */
#ifdef NPY_FEATURE_VERSION
#ifndef NO_IMPORT_ARRAY
if (unlikely(_import_array() == -1)) {
    PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
    "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
    "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
}
#endif
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network_Network = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_Network_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network_Network)) __PYX_ERR(0, 79, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_Network_spec, __pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network_Network = &__pyx_type_6nltkor_3tag_4libs_7network_Network;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 79, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__.doc = __pyx_doc_6nltkor_3tag_4libs_7network_7Network_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Network, (PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #endif
  __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = &__pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork.argument_distances = (PyArrayObject *(*)(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *, PyObject *))__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork)) __PYX_ERR(1, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec, __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_base = __pyx_ptype_6nltkor_3tag_4libs_7network_Network;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ConvolutionalNetwork, (PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #endif
  __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = &__pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork.__pyx_base = *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork)) __PYX_ERR(5, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec, __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_base = __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ConvolutionalDependencyNetwork, (PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)) __PYX_ERR(0, 133, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec, __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 617, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 702, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)) __PYX_ERR(1, 56, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)) __PYX_ERR(1, 288, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(1, 288, __pyx_L1_error)
  #else
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(1, 288, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_network(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_network},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "network",
      __pyx_k_A_neural_network_for_NLP_taggin, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* m_size */
    #else
      -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initnetwork(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initnetwork(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_network(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_network(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_network(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'network' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("network", __pyx_methods, __pyx_k_A_neural_network_for_NLP_taggin, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "network" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_network(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_nltkor__tag__libs__network) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "nltkor.tag.libs.network")) {
      if (unlikely((PyDict_SetItemString(modules, "nltkor.tag.libs.network", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_network(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":11
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * cimport cython
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":17
 * 
 * #from itertools import izip
 * import logging             # <<<<<<<<<<<<<<
 * 
 * #ctypedef float FLOAT_t
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_logging, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_create_new, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_create_new, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_create_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_create_new, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_description, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_description, __pyx_t_3) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__create_sentence_lookup, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_create_sentence_lookup, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_tag_sentence, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_tag_sentence_2, __pyx_t_3) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__tag_sentence, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_tag_sentence, __pyx_t_3) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__calculate_delta, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_calculate_delta, __pyx_t_3) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__calculate_gradients_sll, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_calculate_gradients_sll, __pyx_t_3) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__calculate_gradients_wll, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_calculate_gradients_wll, __pyx_t_3) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__viterbi, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_viterbi, __pyx_t_3) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_set_validation_data, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__103);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_set_validation_data, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_set_learning_rate_decay, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__105);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_set_learning_rate_decay, __pyx_t_3) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_decrease_learning_rates, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_decrease_learning_rates, __pyx_t_3) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_train, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__108);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_train, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__print_epoch_report, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_print_epoch_report, __pyx_t_3) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__train_epoch, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_train_epoch, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__validate, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_validate, __pyx_t_3) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__backpropagate, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_backpropagate, __pyx_t_3) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network__load_parameters, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_load_parameters, __pyx_t_3) < 0) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_save, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_save, __pyx_t_3) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network_load_from_file, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_load_from_file_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network___reduce_cython, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Network___setstate_cython, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_Network);

  /* "nltkor/tag/libs/networkconv.pyx":8
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_create_new, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_new, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_new, __pyx_t_3) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_description, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_description, __pyx_t_3) < 0) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__generate_s, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_generate_save_dict, __pyx_t_3) < 0) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_save, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_save, __pyx_t_3) < 0) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__load_from, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file, __pyx_t_3) < 0) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file, __pyx_t_2) < 0) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_load_from_f, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__load_param, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_load_parameters, __pyx_t_3) < 0) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_set_validat, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_set_validation_data, __pyx_t_3) < 0) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_train, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__125);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_train, __pyx_t_3) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__reset_coun, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_reset_counters, __pyx_t_3) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__shuffle_da, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_shuffle_data, __pyx_t_3) < 0) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__train_epoc, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_train_epoch, __pyx_t_3) < 0) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork_tag_sentenc, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__129);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_tag_sentence_2, __pyx_t_3) < 0) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__sentence_c, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_sentence_convolution, __pyx_t_3) < 0) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__pre_taggin, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_pre_tagging_setup, __pyx_t_3) < 0) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__tag_senten, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__134);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_tag_sentence, __pyx_t_3) < 0) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__validate, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_validate, __pyx_t_3) < 0) __PYX_ERR(1, 576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__calculate, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_calculate_gradients, __pyx_t_3) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__calculate_2, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_calculate_gradients_classify, __pyx_t_3) < 0) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__backpropag, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_backpropagate, __pyx_t_3) < 0) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__adjust_wei, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_adjust_weights, __pyx_t_3) < 0) __PYX_ERR(1, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__calculate_3, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_calculate_input_deltas, __pyx_t_3) < 0) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__adjust_fea, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_adjust_features, __pyx_t_3) < 0) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__viterbi, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__143);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_viterbi, __pyx_t_3) < 0) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__create_tar, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_target_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__create_pre, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_pred_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork__create_con, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_create_convolution_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork___reduce_cy, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalNetwork___setstate, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":8
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_s, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_save, __pyx_t_3) < 0) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_l, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_load_from_file_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_t, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__125);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_train, __pyx_t_2) < 0) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_s_2, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_set_validation_data, __pyx_t_2) < 0) __PYX_ERR(5, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_2, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__150);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_tag_sentence, __pyx_t_2) < 0) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_3, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_tag_sentence_unlabeled_dependen, __pyx_t_2) < 0) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_4, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_tag_sentence_labeled_dependency, __pyx_t_2) < 0) __PYX_ERR(5, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_5, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_calculate_gradients, __pyx_t_2) < 0) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_6, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_validate, __pyx_t_2) < 0) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_7, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_average_error, __pyx_t_2) < 0) __PYX_ERR(5, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_8, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_print_epoch_report, __pyx_t_2) < 0) __PYX_ERR(5, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_t_2, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__97);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_tag_sentence_2, __pyx_t_2) < 0) __PYX_ERR(5, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_9, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_find_cycles, __pyx_t_2) < 0) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_10, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_find_cycle_recursive, __pyx_t_2) < 0) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_11, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_contract_cycle, __pyx_t_2) < 0) __PYX_ERR(5, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_12, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_find_maximum_spanning_tree, __pyx_t_2) < 0) __PYX_ERR(5, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_13, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConvolutionalDependencyNetwork_14, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network, 0, __pyx_n_s_pyx_unpickle_Network, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Network, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork, 0, __pyx_n_s_pyx_unpickle_ConvolutionalNetw, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ConvolutionalNetw, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork, 0, __pyx_n_s_pyx_unpickle_ConvolutionalDepe, NULL, __pyx_n_s_nltkor_tag_libs_network, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ConvolutionalDepe, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True
 * #cython: profile=True
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_TraceReturn(Py_None, 0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init nltkor.tag.libs.network", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init nltkor.tag.libs.network");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
      #if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* Profile */
#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   PyThreadState* tstate,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    PyObject *type, *value, *traceback;
    int retval;
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_d,                  /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
#if PY_VERSION_HEX < 0x030400B1
    } else {
        (*frame)->f_tstate = tstate;
#endif
    }
    __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
    retval = 1;
    __Pyx_EnterTracing(tstate);
    __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
    #if CYTHON_TRACE
    if (tstate->c_tracefunc)
        retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
    if (retval && tstate->c_profilefunc)
    #endif
        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
    __Pyx_LeaveTracing(tstate);
    if (retval) {
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
        return __Pyx_IsTracing(tstate, 0, 0) && retval;
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyCodeObject *py_code = 0;
#if PY_MAJOR_VERSION >= 3
    py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
    if (likely(py_code)) {
        py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
    }
#else
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    py_funcname = PyString_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    py_srcfile = PyString_FromString(srcfile);
    if (unlikely(!py_srcfile)) goto bad;
    py_code = PyCode_New(
        0,
        0,
        0,
        CO_OPTIMIZED | CO_NEWLOCALS,
        __pyx_empty_bytes,     /*PyObject *code,*/
        __pyx_empty_tuple,     /*PyObject *consts,*/
        __pyx_empty_tuple,     /*PyObject *names,*/
        __pyx_empty_tuple,     /*PyObject *varnames,*/
        __pyx_empty_tuple,     /*PyObject *freevars,*/
        __pyx_empty_tuple,     /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,
        __pyx_empty_bytes      /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
#endif
    return py_code;
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparsable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (unlikely(info->buf == NULL)) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static int __Pyx__GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
    __Pyx_ZeroBuffer(buf);
    return -1;
  }
  if (unlikely(buf->ndim != nd)) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if (unlikely((size_t)buf->itemsize != dtype->size)) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_SafeReleaseBuffer(buf);
  return -1;
}

/* TupleAndListFromArray */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
  #if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseArgTupleInvalid */
  static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
  static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
  static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

/* RaiseUnboundLocalError */
  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* GetItemInt */
  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* pep479 */
  static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc;
    __Pyx_PyThreadState_declare
    #ifdef __Pyx_StopAsyncIteration_USED
    int is_async_stopiteration = 0;
    #endif
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    cur_exc = PyErr_Occurred();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        #ifdef __Pyx_StopAsyncIteration_USED
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else
        #endif
            return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(val);
    Py_XDECREF(tb);
    PyErr_SetString(PyExc_RuntimeError,
        #ifdef __Pyx_StopAsyncIteration_USED
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        #endif
        "generator raised StopIteration");
}

/* PyObjectCallOneArg */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op2))) {
#if CYTHON_COMPILING_IN_LIMITED_API
        b = __pyx_PyFloat_AsDouble(op2);
#else
        b = PyFloat_AS_DOUBLE(op2);
#endif
        if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        b = (double) PyInt_AS_LONG(op2);
        if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
    } else
    #endif
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op2)) {
            b = 0.0;
            if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
        } else if (__Pyx_PyLong_IsCompact(op2)) {
            b = (double) __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    b = PyLong_AsDouble(op2);
                    if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
                    #if !CYTHON_USE_PYLONG_INTERNALS
                    if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
                    #endif
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* RaiseUnexpectedTypeError */
  static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* KeywordStringCheck */
  static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        Py_ssize_t kwsize;
#if CYTHON_ASSUME_SAFE_MACROS
        kwsize = PyTuple_GET_SIZE(kw);
#else
        kwsize = PyTuple_Size(kw);
        if (kwsize < 0) return 0;
#endif
        if (unlikely(kwsize == 0))
            return 1;
        if (!kw_allowed) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, 0);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < kwsize; pos++) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* CIntToDigits */
  static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
  static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectFormatAndDecref */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
  static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* ArgTypeTest */
  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    type_name = __Pyx_PyType_GetName(type);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a + (unsigned long)b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* ObjectGetItem */
  #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* DivInt[long] */
  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* SliceObject */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* SetItemInt */
  static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o))
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a - (unsigned long)b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return PyLong_FromLong(-intval);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* PyIntCompare */
  static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a == b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op2))) {
#if CYTHON_COMPILING_IN_LIMITED_API
        b = __pyx_PyFloat_AsDouble(op2);
#else
        b = PyFloat_AS_DOUBLE(op2);
#endif
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        b = (double) PyInt_AS_LONG(op2);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op2)) {
            b = 0.0;
            
        } else if (__Pyx_PyLong_IsCompact(op2)) {
            b = (double) __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    b = PyLong_AsDouble(op2);
                    if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
        
            x = (long)((unsigned long)a + (unsigned long)b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op2))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op2))) {
            b = __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double b = __pyx_PyFloat_AsDouble(op2);
#else
        double b = PyFloat_AS_DOUBLE(op2);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectFormat */
  #if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* pybytes_as_double */
  static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value;
#if PY_MAJOR_VERSION >= 3
    float_value = PyFloat_FromString(obj);
#else
    float_value = PyFloat_FromString(obj, 0);
#endif
    if (likely(float_value)) {
#if CYTHON_ASSUME_SAFE_MACROS
        double value = PyFloat_AS_DOUBLE(float_value);
#else
        double value = PyFloat_AsDouble(float_value);
#endif
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
  static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* BufferIndexError */
  static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* DictGetItem */
  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* GetAttr3 */
  #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyObjectSetAttrStr */
  #if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CIntToPyUnicode */
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (long) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (long) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* IterNext */
  static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator));
    PyErr_Format(PyExc_TypeError,
        __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name);
    __Pyx_DECREF_TypeName(iterator_type_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
    if (likely(iternext)) {
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
        next = iternext(iterator);
        if (likely(next))
            return next;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
#endif
#else
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
#endif
    } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    }
#if !CYTHON_USE_TYPE_SLOTS
    else {
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
    }
#endif
    return __Pyx_PyIter_Next2Default(defval);
}

/* PyIntCompare */
  static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a != b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) != 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 1;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 1;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal != 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* pyobject_as_double */
  static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#else
        PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
        if (likely(nb) && likely(nb->nb_float)) {
            float_value = nb->nb_float(obj);
            if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* pyfrozenset_new */
  static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
  static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* UnpackUnboundCMethod */
  static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
     METH_VARARGS | METH_KEYWORDS,
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #else
    if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            target->method = unbound_method;
        }
    }
    return 0;
}

/* CallUnboundCMethod1 */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            #else
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            #endif
        } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* Import */
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportFrom */
  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__86);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* GetAttr */
  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* FixUpExtensionType */
  #if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* PyObjectCallNoArg */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
  static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
  static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* PyObject_GenericGetAttrNoDict */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetupReduce */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_0_12
#define __PYX_HAVE_RT_ImportType_3_0_12
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ImportDottedModule */
  #if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__91;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* FetchSharedCythonModule */
  static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
  static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
  #if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
  #if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* ClassMethod */
  static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (unlikely(methoddescr_type == NULL)) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (unlikely(!meth)) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* GetNameInClass */
  static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CLineInTraceback */
  #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    __Pyx_TypeName obj_type_name;
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
                 "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
                 obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
    if ((0)) {}
    view->obj = NULL;
    Py_DECREF(obj);
}
#endif


  /* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(npy_long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(Py_intptr_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(Py_intptr_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Py_intptr_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        Py_intptr_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Py_intptr_t) -1;
        val = __Pyx_PyInt_As_Py_intptr_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (Py_intptr_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Py_intptr_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Py_intptr_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Py_intptr_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (Py_intptr_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Py_intptr_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (Py_intptr_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Py_intptr_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(Py_intptr_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((Py_intptr_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(Py_intptr_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Py_intptr_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Py_intptr_t) 1) << (sizeof(Py_intptr_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (Py_intptr_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Py_intptr_t");
    return (Py_intptr_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Py_intptr_t");
    return (Py_intptr_t) -1;
}

/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__161);
    }
    return name;
}
#endif

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCall2Args */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallMethod1 */
  #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* CoroutineBase */
  #include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(PyObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body(self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval))
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    gen->is_running = 0;
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        Py_TYPE(gen)->tp_del(self);
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (likely(--self->ob_refcnt == 0)) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context)
{
    PyObject *frame = self->gi_frame;
    CYTHON_UNUSED_VAR(context);
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
  #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (unlikely(!module)) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_GeneratorType_slots
};
#else
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Generator_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
#endif
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
  static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* InitStrings */
  #if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
