From c25e2a8068458edc59f822e9deff20cf7067d508 Mon Sep 17 00:00:00 2001 From: Quoc-Tuan Truong Date: Wed, 18 Sep 2019 18:41:29 +0800 Subject: [PATCH] Update model descriptions (#239) --- cornac/models/cdl/recom_cdl.py | 1 + cornac/models/cdr/recom_cdr.py | 5 +- cornac/models/ctr/recom_ctr.py | 3 +- cornac/models/efm/recom_efm.cpp | 8799 ++++++++++++++-------------- cornac/models/efm/recom_efm.pyx | 7 +- cornac/models/mcf/recom_mcf.py | 12 +- cornac/models/sorec/recom_sorec.py | 17 +- cornac/models/vmf/recom_vmf.py | 10 +- cornac/models/wmf/recom_wmf.py | 7 +- docs/source/models.rst | 32 +- 10 files changed, 4421 insertions(+), 4472 deletions(-) diff --git a/cornac/models/cdl/recom_cdl.py b/cornac/models/cdl/recom_cdl.py index 582447b40..63d9cc32c 100644 --- a/cornac/models/cdl/recom_cdl.py +++ b/cornac/models/cdl/recom_cdl.py @@ -80,6 +80,7 @@ class CDL(Recommender): init_params: dictionary, optional, default: None List of initial parameters, e.g., init_params = {'U':U, 'V':V} + U: ndarray, shape (n_users,k) The user latent factors, optional initialization via init_params. V: ndarray, shape (n_items,k) diff --git a/cornac/models/cdr/recom_cdr.py b/cornac/models/cdr/recom_cdr.py index 0c95d15ee..b39f9feb3 100644 --- a/cornac/models/cdr/recom_cdr.py +++ b/cornac/models/cdr/recom_cdr.py @@ -71,6 +71,7 @@ class CDR(Recommender): init_params: dictionary, optional, default: None List of initial parameters, e.g., init_params = {'U':U, 'V':V} + U: ndarray, shape (n_users,k) The user latent factors, optional initialization via init_params. V: ndarray, shape (n_items,k) @@ -79,7 +80,9 @@ class CDR(Recommender): seed: int, optional, default: None Random seed for weight initialization. - Reference: Collaborative Deep Ranking: A Hybrid Pair-Wise Recommendation Algorithm with Implicit Feedback + References + ---------- + Collaborative Deep Ranking: A Hybrid Pair-Wise Recommendation Algorithm with Implicit Feedback Ying H., Chen L., Xiong Y., Wu J. (2016) """ diff --git a/cornac/models/ctr/recom_ctr.py b/cornac/models/ctr/recom_ctr.py index 8e83de30d..8a4f13dc0 100644 --- a/cornac/models/ctr/recom_ctr.py +++ b/cornac/models/ctr/recom_ctr.py @@ -20,7 +20,7 @@ class CTR(Recommender): - """Collaborative Topic Regression + """Collaborative Topic Regression. Parameters ---------- @@ -54,6 +54,7 @@ class CTR(Recommender): init_params: dictionary, optional, default: None List of initial parameters, e.g., init_params = {'U':U, 'V':V} + U: ndarray, shape (n_users,k) The user latent factors, optional initialization via init_params. V: ndarray, shape (n_items,k) diff --git a/cornac/models/efm/recom_efm.cpp b/cornac/models/efm/recom_efm.cpp index efafa2d4a..28c99a314 100644 --- a/cornac/models/efm/recom_efm.cpp +++ b/cornac/models/efm/recom_efm.cpp @@ -1,14 +1,14 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.6 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/hoangle/anaconda3/envs/pre/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/hoangle/anaconda3/envs/pre/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/home/tuantruong/anaconda3/envs/cn/lib/python3.6/site-packages/numpy-1.16.2-py3.6-linux-x86_64.egg/numpy/core/include/numpy/arrayobject.h", + "/home/tuantruong/anaconda3/envs/cn/lib/python3.6/site-packages/numpy-1.16.2-py3.6-linux-x86_64.egg/numpy/core/include/numpy/ufuncobject.h" ], "include_dirs": [ - "/home/hoangle/anaconda3/envs/pre/lib/python3.6/site-packages/numpy/core/include" + "/home/tuantruong/anaconda3/envs/cn/lib/python3.6/site-packages/numpy-1.16.2-py3.6-linux-x86_64.egg/numpy/core/include" ], "language": "c++", "name": "cornac.models.efm.recom_efm", @@ -27,8 +27,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_6" +#define CYTHON_HEX_VERSION 0x001D06F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -344,13 +344,8 @@ class __Pyx_FakeReference { #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else #define __Pyx_PyCode_New(a, 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 #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -997,7 +992,7 @@ typedef float __pyx_t_5scipy_6linalg_11cython_blas_s; */ typedef double __pyx_t_5scipy_6linalg_11cython_blas_d; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1006,7 +1001,7 @@ typedef double __pyx_t_5scipy_6linalg_11cython_blas_d; */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1015,7 +1010,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1024,7 +1019,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1033,7 +1028,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1042,7 +1037,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1051,7 +1046,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1060,7 +1055,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1069,7 +1064,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1078,7 +1073,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1087,7 +1082,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1096,7 +1091,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1105,7 +1100,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1114,7 +1109,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1123,7 +1118,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1132,7 +1127,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1141,7 +1136,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1150,7 +1145,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1159,7 +1154,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1168,7 +1163,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1177,7 +1172,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1216,7 +1211,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1225,7 +1220,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1234,7 +1229,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1243,7 +1238,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1313,7 +1308,7 @@ struct __pyx_memoryview_obj { }; -/* "View.MemoryView":965 +/* "View.MemoryView":961 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1364,7 +1359,7 @@ struct __pyx_vtabstruct_memoryview { static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; -/* "View.MemoryView":965 +/* "View.MemoryView":961 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1534,7 +1529,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -2795,7 +2790,7 @@ static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d"; -static const char __pyx_k_Explict_Factor_Models_Parameters[] = "Explict Factor Models\n\n Parameters\n ----------\n num_explicit_factors: int, optional, default: 40\n The dimension of the explicit factors.\n\n num_latent_factors: int, optional, default: 60\n The dimension of the latent factors.\n\n num_most_cared_aspects: int, optional, default: 15\n The number of most cared aspects for each user.\n\n rating_scale: float, optional, default: 5.0\n The maximum rating score of the dataset.\n\n alpha: float, optional, default: 0.85\n Trace off factor for constructing ranking score.\n\n lambda_x: float, optional, default: 1\n The regularization parameter for user aspect attentions.\n\n lambda_y: float, optional, default: 1\n The regularization parameter for item aspect qualities.\n\n lambda_u: float, optional, default: 0.01\n The regularization parameter for user and item explicit factors.\n\n lambda_h: float, optional, default: 0.01\n The regularization parameter for user and item latent factors.\n\n lambda_v: float, optional, default: 0.01\n The regularization parameter for V.\n\n use_item_aspect_popularity: boolean, optional, default: True\n When False, item aspect frequency is omitted from item aspect quality computation formular. Specifically, :math:`Y_{ij} = 1 + \014rac{N - 1}{1 + e^{-s_{ij}}}` if `p_i` is reviewed on feature `F_j`\n\n max_iter: int, optional, default: 100\n Maximum number of iterations or the number of epochs.\n\n name: string, optional, default: 'EFM'\n The name of the recommender model.\n\n num_threads: int, optional, default: 0\n Number of parallel threads for training.\n If 0, all CPU cores will be utilized.\n\n trainable: boolean, optional, default: True\n When False, the model is not trained and Cornac assumes that the model already \n pre-trained (U1, U2, V, H1, and H2 are not None).\n\n verbose: boolean, optional, default: Fa""lse\n When True, running logs are displayed.\n\n init_params: dictionary, optional, default: {}\n List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V', H1':H1, 'H2':H2}\n U1: ndarray, shape (n_users, n_explicit_factors)\n The user explicit factors, optional initialization via init_params.\n U2: ndarray, shape (n_ratings, n_explicit_factors)\n The item explicit factors, optional initialization via init_params.\n V: ndarray, shape (n_aspects, n_explict_factors)\n The aspect factors, optional initialization via init_params.\n H1: ndarray, shape (n_users, n_latent_factors)\n The user latent factors, optional initialization via init_params.\n H2: ndarray, shape (n_ratings, n_latent_factors)\n The item latent factors, optional initialization via init_params.\n\n seed: int, optional, default: None\n Random seed for weight initialization.\n\n References\n ----------\n Yongfeng Zhang, Guokun Lai, Min Zhang, Yi Zhang, Yiqun Liu, and Shaoping Ma. 2014.\n Explicit factor models for explainable recommendation based on phrase-level sentiment analysis.\n In Proceedings of the 37th international ACM SIGIR conference on Research & development in information retrieval (SIGIR '14).\n ACM, New York, NY, USA, 83-92. DOI: https://doi.org/10.1145/2600428.2609579\n "; +static const char __pyx_k_Explict_Factor_Models_Parameters[] = "Explict Factor Models\n\n Parameters\n ----------\n num_explicit_factors: int, optional, default: 40\n The dimension of the explicit factors.\n\n num_latent_factors: int, optional, default: 60\n The dimension of the latent factors.\n\n num_most_cared_aspects: int, optional, default: 15\n The number of most cared aspects for each user.\n\n rating_scale: float, optional, default: 5.0\n The maximum rating score of the dataset.\n\n alpha: float, optional, default: 0.85\n Trace off factor for constructing ranking score.\n\n lambda_x: float, optional, default: 1\n The regularization parameter for user aspect attentions.\n\n lambda_y: float, optional, default: 1\n The regularization parameter for item aspect qualities.\n\n lambda_u: float, optional, default: 0.01\n The regularization parameter for user and item explicit factors.\n\n lambda_h: float, optional, default: 0.01\n The regularization parameter for user and item latent factors.\n\n lambda_v: float, optional, default: 0.01\n The regularization parameter for V.\n\n use_item_aspect_popularity: boolean, optional, default: True\n When False, item aspect frequency is omitted from item aspect quality computation formular. Specifically, :math:`Y_{ij} = 1 + \\frac{N - 1}{1 + e^{-s_{ij}}}`\n if :math:`p_i` is reviewed on feature :math:`F_j`\n\n max_iter: int, optional, default: 100\n Maximum number of iterations or the number of epochs.\n\n name: string, optional, default: 'EFM'\n The name of the recommender model.\n\n num_threads: int, optional, default: 0\n Number of parallel threads for training.\n If 0, all CPU cores will be utilized.\n\n trainable: boolean, optional, default: True\n When False, the model is not trained and Cornac assumes that the model already \n pre-trained (U1, U2, V, H1, and H2 are not None).\n\n verbose: boolean, o""ptional, default: False\n When True, running logs are displayed.\n\n init_params: dictionary, optional, default: {}\n List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V, 'H1':H1, 'H2':H2}\n\n U1: ndarray, shape (n_users, n_explicit_factors)\n The user explicit factors, optional initialization via init_params.\n U2: ndarray, shape (n_ratings, n_explicit_factors)\n The item explicit factors, optional initialization via init_params.\n V: ndarray, shape (n_aspects, n_explict_factors)\n The aspect factors, optional initialization via init_params.\n H1: ndarray, shape (n_users, n_latent_factors)\n The user latent factors, optional initialization via init_params.\n H2: ndarray, shape (n_ratings, n_latent_factors)\n The item latent factors, optional initialization via init_params.\n\n seed: int, optional, default: None\n Random seed for weight initialization.\n\n References\n ----------\n Yongfeng Zhang, Guokun Lai, Min Zhang, Yi Zhang, Yiqun Liu, and Shaoping Ma. 2014.\n Explicit factor models for explainable recommendation based on phrase-level sentiment analysis.\n In Proceedings of the 37th international ACM SIGIR conference on Research & development in information retrieval (SIGIR '14).\n ACM, New York, NY, USA, 83-92. DOI: https://doi.org/10.1145/2600428.2609579\n\n "; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; @@ -3328,7 +3323,7 @@ static double __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(int __pyx return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":121 +/* "cornac/models/efm/recom_efm.pyx":124 * """ * * def __init__(self, name="EFM", # <<<<<<<<<<<<<< @@ -3377,7 +3372,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_1__init__(PyObjec values[10] = ((PyObject *)((PyObject*)__pyx_float_0_01)); values[11] = ((PyObject *)((PyObject*)__pyx_float_0_01)); - /* "cornac/models/efm/recom_efm.pyx":125 + /* "cornac/models/efm/recom_efm.pyx":128 * rating_scale=5.0, alpha=0.85, * lambda_x=1, lambda_y=1, lambda_u=0.01, lambda_h=0.01, lambda_v=0.01, * use_item_aspect_popularity=True, max_iter=100, # <<<<<<<<<<<<<< @@ -3388,7 +3383,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_1__init__(PyObjec values[13] = ((PyObject *)((PyObject *)__pyx_int_100)); values[14] = ((PyObject *)((PyObject *)__pyx_int_0)); - /* "cornac/models/efm/recom_efm.pyx":126 + /* "cornac/models/efm/recom_efm.pyx":129 * lambda_x=1, lambda_y=1, lambda_u=0.01, lambda_h=0.01, lambda_v=0.01, * use_item_aspect_popularity=True, max_iter=100, * num_threads=0, trainable=True, verbose=False, init_params=None, seed=None): # <<<<<<<<<<<<<< @@ -3559,7 +3554,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_1__init__(PyObjec } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 121, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3626,7 +3621,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_1__init__(PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3634,7 +3629,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_1__init__(PyObjec __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_num_explicit_factors, __pyx_v_num_latent_factors, __pyx_v_num_most_cared_aspects, __pyx_v_rating_scale, __pyx_v_alpha, __pyx_v_lambda_x, __pyx_v_lambda_y, __pyx_v_lambda_u, __pyx_v_lambda_h, __pyx_v_lambda_v, __pyx_v_use_item_aspect_popularity, __pyx_v_max_iter, __pyx_v_num_threads, __pyx_v_trainable, __pyx_v_verbose, __pyx_v_init_params, __pyx_v_seed); - /* "cornac/models/efm/recom_efm.pyx":121 + /* "cornac/models/efm/recom_efm.pyx":124 * """ * * def __init__(self, name="EFM", # <<<<<<<<<<<<<< @@ -3659,144 +3654,144 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U int __pyx_t_6; __Pyx_RefNannySetupContext("__init__", 0); - /* "cornac/models/efm/recom_efm.pyx":128 + /* "cornac/models/efm/recom_efm.pyx":131 * num_threads=0, trainable=True, verbose=False, init_params=None, seed=None): * * Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose) # <<<<<<<<<<<<<< * self.num_explicit_factors = num_explicit_factors * self.num_latent_factors = num_latent_factors */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Recommender); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Recommender); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __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, 128, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_trainable, __pyx_v_trainable) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_v_verbose) < 0) __PYX_ERR(0, 128, __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(0, 128, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_trainable, __pyx_v_trainable) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_v_verbose) < 0) __PYX_ERR(0, 131, __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(0, 131, __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; - /* "cornac/models/efm/recom_efm.pyx":129 + /* "cornac/models/efm/recom_efm.pyx":132 * * Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose) * self.num_explicit_factors = num_explicit_factors # <<<<<<<<<<<<<< * self.num_latent_factors = num_latent_factors * self.num_most_cared_aspects = num_most_cared_aspects */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors, __pyx_v_num_explicit_factors) < 0) __PYX_ERR(0, 129, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors, __pyx_v_num_explicit_factors) < 0) __PYX_ERR(0, 132, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":130 + /* "cornac/models/efm/recom_efm.pyx":133 * Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose) * self.num_explicit_factors = num_explicit_factors * self.num_latent_factors = num_latent_factors # <<<<<<<<<<<<<< * self.num_most_cared_aspects = num_most_cared_aspects * self.rating_scale = rating_scale */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors, __pyx_v_num_latent_factors) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors, __pyx_v_num_latent_factors) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":131 + /* "cornac/models/efm/recom_efm.pyx":134 * self.num_explicit_factors = num_explicit_factors * self.num_latent_factors = num_latent_factors * self.num_most_cared_aspects = num_most_cared_aspects # <<<<<<<<<<<<<< * self.rating_scale = rating_scale * self.alpha = alpha */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_most_cared_aspects, __pyx_v_num_most_cared_aspects) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_most_cared_aspects, __pyx_v_num_most_cared_aspects) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":132 + /* "cornac/models/efm/recom_efm.pyx":135 * self.num_latent_factors = num_latent_factors * self.num_most_cared_aspects = num_most_cared_aspects * self.rating_scale = rating_scale # <<<<<<<<<<<<<< * self.alpha = alpha * self.lambda_x = lambda_x */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale, __pyx_v_rating_scale) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale, __pyx_v_rating_scale) < 0) __PYX_ERR(0, 135, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":133 + /* "cornac/models/efm/recom_efm.pyx":136 * self.num_most_cared_aspects = num_most_cared_aspects * self.rating_scale = rating_scale * self.alpha = alpha # <<<<<<<<<<<<<< * self.lambda_x = lambda_x * self.lambda_y = lambda_y */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alpha, __pyx_v_alpha) < 0) __PYX_ERR(0, 136, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":134 + /* "cornac/models/efm/recom_efm.pyx":137 * self.rating_scale = rating_scale * self.alpha = alpha * self.lambda_x = lambda_x # <<<<<<<<<<<<<< * self.lambda_y = lambda_y * self.lambda_u = lambda_u */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x, __pyx_v_lambda_x) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x, __pyx_v_lambda_x) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":135 + /* "cornac/models/efm/recom_efm.pyx":138 * self.alpha = alpha * self.lambda_x = lambda_x * self.lambda_y = lambda_y # <<<<<<<<<<<<<< * self.lambda_u = lambda_u * self.lambda_h = lambda_h */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y, __pyx_v_lambda_y) < 0) __PYX_ERR(0, 135, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y, __pyx_v_lambda_y) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":136 + /* "cornac/models/efm/recom_efm.pyx":139 * self.lambda_x = lambda_x * self.lambda_y = lambda_y * self.lambda_u = lambda_u # <<<<<<<<<<<<<< * self.lambda_h = lambda_h * self.lambda_v = lambda_v */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u, __pyx_v_lambda_u) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u, __pyx_v_lambda_u) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":137 + /* "cornac/models/efm/recom_efm.pyx":140 * self.lambda_y = lambda_y * self.lambda_u = lambda_u * self.lambda_h = lambda_h # <<<<<<<<<<<<<< * self.lambda_v = lambda_v * self.use_item_aspect_popularity = use_item_aspect_popularity */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h, __pyx_v_lambda_h) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h, __pyx_v_lambda_h) < 0) __PYX_ERR(0, 140, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":138 + /* "cornac/models/efm/recom_efm.pyx":141 * self.lambda_u = lambda_u * self.lambda_h = lambda_h * self.lambda_v = lambda_v # <<<<<<<<<<<<<< * self.use_item_aspect_popularity = use_item_aspect_popularity * self.max_iter = max_iter */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v, __pyx_v_lambda_v) < 0) __PYX_ERR(0, 138, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v, __pyx_v_lambda_v) < 0) __PYX_ERR(0, 141, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":139 + /* "cornac/models/efm/recom_efm.pyx":142 * self.lambda_h = lambda_h * self.lambda_v = lambda_v * self.use_item_aspect_popularity = use_item_aspect_popularity # <<<<<<<<<<<<<< * self.max_iter = max_iter * self.init_params = {} if init_params is None else init_params */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_use_item_aspect_popularity, __pyx_v_use_item_aspect_popularity) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_use_item_aspect_popularity, __pyx_v_use_item_aspect_popularity) < 0) __PYX_ERR(0, 142, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":140 + /* "cornac/models/efm/recom_efm.pyx":143 * self.lambda_v = lambda_v * self.use_item_aspect_popularity = use_item_aspect_popularity * self.max_iter = max_iter # <<<<<<<<<<<<<< * self.init_params = {} if init_params is None else init_params * self.seed = seed */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_max_iter, __pyx_v_max_iter) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_max_iter, __pyx_v_max_iter) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":141 + /* "cornac/models/efm/recom_efm.pyx":144 * self.use_item_aspect_popularity = use_item_aspect_popularity * self.max_iter = max_iter * self.init_params = {} if init_params is None else init_params # <<<<<<<<<<<<<< @@ -3805,7 +3800,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U */ __pyx_t_5 = (__pyx_v_init_params == Py_None); if ((__pyx_t_5 != 0)) { - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __pyx_t_3 = 0; @@ -3813,31 +3808,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U __Pyx_INCREF(__pyx_v_init_params); __pyx_t_4 = __pyx_v_init_params; } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_init_params, __pyx_t_4) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_init_params, __pyx_t_4) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":142 + /* "cornac/models/efm/recom_efm.pyx":145 * self.max_iter = max_iter * self.init_params = {} if init_params is None else init_params * self.seed = seed # <<<<<<<<<<<<<< * import multiprocessing * if seed is not None: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_seed, __pyx_v_seed) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_seed, __pyx_v_seed) < 0) __PYX_ERR(0, 145, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":143 + /* "cornac/models/efm/recom_efm.pyx":146 * self.init_params = {} if init_params is None else init_params * self.seed = seed * import multiprocessing # <<<<<<<<<<<<<< * if seed is not None: * self.num_threads = 1 */ - __pyx_t_4 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_multiprocessing = __pyx_t_4; __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":144 + /* "cornac/models/efm/recom_efm.pyx":147 * self.seed = seed * import multiprocessing * if seed is not None: # <<<<<<<<<<<<<< @@ -3848,16 +3843,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "cornac/models/efm/recom_efm.pyx":145 + /* "cornac/models/efm/recom_efm.pyx":148 * import multiprocessing * if seed is not None: * self.num_threads = 1 # <<<<<<<<<<<<<< * elif num_threads > 0 and num_threads < multiprocessing.cpu_count(): * self.num_threads = num_threads */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_int_1) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_int_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":144 + /* "cornac/models/efm/recom_efm.pyx":147 * self.seed = seed * import multiprocessing * if seed is not None: # <<<<<<<<<<<<<< @@ -3867,22 +3862,22 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U goto __pyx_L3; } - /* "cornac/models/efm/recom_efm.pyx":146 + /* "cornac/models/efm/recom_efm.pyx":149 * if seed is not None: * self.num_threads = 1 * elif num_threads > 0 and num_threads < multiprocessing.cpu_count(): # <<<<<<<<<<<<<< * self.num_threads = num_threads * else: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_multiprocessing, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_multiprocessing, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -3896,27 +3891,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_6) { - /* "cornac/models/efm/recom_efm.pyx":147 + /* "cornac/models/efm/recom_efm.pyx":150 * self.num_threads = 1 * elif num_threads > 0 and num_threads < multiprocessing.cpu_count(): * self.num_threads = num_threads # <<<<<<<<<<<<<< * else: * self.num_threads = multiprocessing.cpu_count() */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_v_num_threads) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_v_num_threads) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":146 + /* "cornac/models/efm/recom_efm.pyx":149 * if seed is not None: * self.num_threads = 1 * elif num_threads > 0 and num_threads < multiprocessing.cpu_count(): # <<<<<<<<<<<<<< @@ -3926,7 +3921,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U goto __pyx_L3; } - /* "cornac/models/efm/recom_efm.pyx":149 + /* "cornac/models/efm/recom_efm.pyx":152 * self.num_threads = num_threads * else: * self.num_threads = multiprocessing.cpu_count() # <<<<<<<<<<<<<< @@ -3934,7 +3929,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U * def _init_params(self): */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_multiprocessing, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_multiprocessing, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -3948,15 +3943,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U } __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_t_3) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_threads, __pyx_t_3) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "cornac/models/efm/recom_efm.pyx":121 + /* "cornac/models/efm/recom_efm.pyx":124 * """ * * def __init__(self, name="EFM", # <<<<<<<<<<<<<< @@ -3981,7 +3976,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM___init__(CYTHON_U return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":151 +/* "cornac/models/efm/recom_efm.pyx":154 * self.num_threads = multiprocessing.cpu_count() * * def _init_params(self): # <<<<<<<<<<<<<< @@ -4019,58 +4014,58 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT int __pyx_t_6; __Pyx_RefNannySetupContext("_init_params", 0); - /* "cornac/models/efm/recom_efm.pyx":152 + /* "cornac/models/efm/recom_efm.pyx":155 * * def _init_params(self): * from ...utils import get_rng # <<<<<<<<<<<<<< * from ...utils.init_utils import uniform * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_get_rng); __Pyx_GIVEREF(__pyx_n_s_get_rng); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_rng); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_rng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_rng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_get_rng = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":153 + /* "cornac/models/efm/recom_efm.pyx":156 * def _init_params(self): * from ...utils import get_rng * from ...utils.init_utils import uniform # <<<<<<<<<<<<<< * * rng = get_rng(self.seed) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_uniform); __Pyx_GIVEREF(__pyx_n_s_uniform); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_uniform); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_utils_init_utils, __pyx_t_2, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_utils_init_utils, __pyx_t_2, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v_uniform = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":155 + /* "cornac/models/efm/recom_efm.pyx":158 * from ...utils.init_utils import uniform * * rng = get_rng(self.seed) # <<<<<<<<<<<<<< * num_factors = self.num_explicit_factors + self.num_latent_factors * high = np.sqrt(self.rating_scale / num_factors) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_get_rng); __pyx_t_3 = __pyx_v_get_rng; __pyx_t_4 = NULL; @@ -4086,45 +4081,45 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __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, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rng = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":156 + /* "cornac/models/efm/recom_efm.pyx":159 * * rng = get_rng(self.seed) * num_factors = self.num_explicit_factors + self.num_latent_factors # <<<<<<<<<<<<<< * high = np.sqrt(self.rating_scale / num_factors) * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __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_v_num_factors = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":157 + /* "cornac/models/efm/recom_efm.pyx":160 * rng = get_rng(self.seed) * num_factors = self.num_explicit_factors + self.num_latent_factors * high = np.sqrt(self.rating_scale / num_factors) # <<<<<<<<<<<<<< * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), * high=high, random_state=rng)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_num_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_num_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4140,32 +4135,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_high = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":158 + /* "cornac/models/efm/recom_efm.pyx":161 * num_factors = self.num_explicit_factors + self.num_latent_factors * high = np.sqrt(self.rating_scale / num_factors) * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -4173,32 +4168,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":159 + /* "cornac/models/efm/recom_efm.pyx":162 * high = np.sqrt(self.rating_scale / num_factors) * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), * high=high, random_state=rng)) # <<<<<<<<<<<<<< * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), * high=high, random_state=rng)) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 159, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 159, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 162, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":158 + /* "cornac/models/efm/recom_efm.pyx":161 * num_factors = self.num_explicit_factors + self.num_latent_factors * high = np.sqrt(self.rating_scale / num_factors) * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4217,7 +4212,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_U1, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4226,14 +4221,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_U1, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4244,34 +4239,34 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __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; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_U1, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_U1, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":160 + /* "cornac/models/efm/recom_efm.pyx":163 * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), * high=high, random_state=rng)) * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_num_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_num_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -4279,32 +4274,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":161 + /* "cornac/models/efm/recom_efm.pyx":164 * high=high, random_state=rng)) * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), * high=high, random_state=rng)) # <<<<<<<<<<<<<< * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), * high=high, random_state=rng)) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 161, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 164, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":160 + /* "cornac/models/efm/recom_efm.pyx":163 * self.U1 = self.init_params.get('U1', uniform((self.train_set.num_users, self.num_explicit_factors), * high=high, random_state=rng)) * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4323,7 +4318,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_U2, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4332,14 +4327,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_U2, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4350,37 +4345,37 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_U2, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_U2, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":162 + /* "cornac/models/efm/recom_efm.pyx":165 * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), * high=high, random_state=rng)) * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -4388,32 +4383,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":163 + /* "cornac/models/efm/recom_efm.pyx":166 * high=high, random_state=rng)) * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), * high=high, random_state=rng)) # <<<<<<<<<<<<<< * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), * high=high, random_state=rng)) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 163, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 166, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":162 + /* "cornac/models/efm/recom_efm.pyx":165 * self.U2 = self.init_params.get('U2', uniform((self.train_set.num_items, self.num_explicit_factors), * high=high, random_state=rng)) * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4432,7 +4427,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_V, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4441,14 +4436,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_V, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4459,34 +4454,34 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_V, __pyx_t_2) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_V, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":164 + /* "cornac/models/efm/recom_efm.pyx":167 * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), * high=high, random_state=rng)) * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -4494,32 +4489,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":165 + /* "cornac/models/efm/recom_efm.pyx":168 * high=high, random_state=rng)) * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), * high=high, random_state=rng)) # <<<<<<<<<<<<<< * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), * high=high, random_state=rng)) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 165, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 168, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":164 + /* "cornac/models/efm/recom_efm.pyx":167 * self.V = self.init_params.get('V', uniform((self.train_set.sentiment.num_aspects, self.num_explicit_factors), * high=high, random_state=rng)) * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4538,7 +4533,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_H1, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4547,14 +4542,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_H1, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4565,34 +4560,34 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_H1, __pyx_t_2) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_H1, __pyx_t_2) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":166 + /* "cornac/models/efm/recom_efm.pyx":169 * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), * high=high, random_state=rng)) * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -4600,32 +4595,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":167 + /* "cornac/models/efm/recom_efm.pyx":170 * high=high, random_state=rng)) * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), * high=high, random_state=rng)) # <<<<<<<<<<<<<< * * def fit(self, train_set, val_set=None): */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 167, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_random_state, __pyx_v_rng) < 0) __PYX_ERR(0, 170, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":166 + /* "cornac/models/efm/recom_efm.pyx":169 * self.H1 = self.init_params.get('H1', uniform((self.train_set.num_users, self.num_latent_factors), * high=high, random_state=rng)) * self.H2 = self.init_params.get('H2', uniform((self.train_set.num_items, self.num_latent_factors), # <<<<<<<<<<<<<< * high=high, random_state=rng)) * */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_uniform, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4644,7 +4639,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_H2, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4653,14 +4648,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_H2, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -4671,15 +4666,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_H2, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_H2, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":151 + /* "cornac/models/efm/recom_efm.pyx":154 * self.num_threads = multiprocessing.cpu_count() * * def _init_params(self): # <<<<<<<<<<<<<< @@ -4709,7 +4704,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_2_init_params(CYT return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":169 +/* "cornac/models/efm/recom_efm.pyx":172 * high=high, random_state=rng)) * * def fit(self, train_set, val_set=None): # <<<<<<<<<<<<<< @@ -4754,7 +4749,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_5fit(PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_train_set)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit", 0, 2, 3, 1); __PYX_ERR(0, 169, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit", 0, 2, 3, 1); __PYX_ERR(0, 172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -4764,7 +4759,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_5fit(PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit") < 0)) __PYX_ERR(0, 169, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit") < 0)) __PYX_ERR(0, 172, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4782,7 +4777,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_5fit(PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fit", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 169, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4832,16 +4827,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE PyObject *__pyx_t_20 = NULL; __Pyx_RefNannySetupContext("fit", 0); - /* "cornac/models/efm/recom_efm.pyx":184 + /* "cornac/models/efm/recom_efm.pyx":187 * self : object * """ * Recommender.fit(self, train_set, val_set) # <<<<<<<<<<<<<< * * self._init_params() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Recommender); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Recommender); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -4859,7 +4854,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_v_train_set, __pyx_v_val_set}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4867,13 +4862,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_v_train_set, __pyx_v_val_set}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -4887,21 +4882,21 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_INCREF(__pyx_v_val_set); __Pyx_GIVEREF(__pyx_v_val_set); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_val_set); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":186 + /* "cornac/models/efm/recom_efm.pyx":189 * Recommender.fit(self, train_set, val_set) * * self._init_params() # <<<<<<<<<<<<<< * * if not self.trainable: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_params_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -4915,26 +4910,26 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __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; - /* "cornac/models/efm/recom_efm.pyx":188 + /* "cornac/models/efm/recom_efm.pyx":191 * self._init_params() * * if not self.trainable: # <<<<<<<<<<<<<< * return * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_trainable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_trainable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); if (__pyx_t_7) { - /* "cornac/models/efm/recom_efm.pyx":189 + /* "cornac/models/efm/recom_efm.pyx":192 * * if not self.trainable: * return # <<<<<<<<<<<<<< @@ -4945,7 +4940,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":188 + /* "cornac/models/efm/recom_efm.pyx":191 * self._init_params() * * if not self.trainable: # <<<<<<<<<<<<<< @@ -4954,16 +4949,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE */ } - /* "cornac/models/efm/recom_efm.pyx":191 + /* "cornac/models/efm/recom_efm.pyx":194 * return * * A, X, Y = self._build_matrices(self.train_set) # <<<<<<<<<<<<<< * A_user_counts = np.ediff1d(A.indptr) * A_item_counts = np.ediff1d(A.tocsc().indptr) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_build_matrices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_build_matrices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -4978,7 +4973,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); __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, 191, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -4987,7 +4982,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 191, __pyx_L1_error) + __PYX_ERR(0, 194, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5003,17 +4998,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -5023,7 +5018,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 191, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L5_unpacking_done; @@ -5031,7 +5026,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 191, __pyx_L1_error) + __PYX_ERR(0, 194, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_A = __pyx_t_3; @@ -5041,19 +5036,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_v_Y = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":192 + /* "cornac/models/efm/recom_efm.pyx":195 * * A, X, Y = self._build_matrices(self.train_set) * A_user_counts = np.ediff1d(A.indptr) # <<<<<<<<<<<<<< * A_item_counts = np.ediff1d(A.tocsc().indptr) * A_uids = np.repeat(np.arange(self.train_set.num_users), A_user_counts).astype(A.indices.dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __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_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -5068,25 +5063,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_A_user_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":193 + /* "cornac/models/efm/recom_efm.pyx":196 * A, X, Y = self._build_matrices(self.train_set) * A_user_counts = np.ediff1d(A.indptr) * A_item_counts = np.ediff1d(A.tocsc().indptr) # <<<<<<<<<<<<<< * A_uids = np.repeat(np.arange(self.train_set.num_users), A_user_counts).astype(A.indices.dtype) * X_user_counts = np.ediff1d(X.indptr) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -5100,10 +5095,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5119,32 +5114,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __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, 193, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_A_item_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":194 + /* "cornac/models/efm/recom_efm.pyx":197 * A_user_counts = np.ediff1d(A.indptr) * A_item_counts = np.ediff1d(A.tocsc().indptr) * A_uids = np.repeat(np.arange(self.train_set.num_users), A_user_counts).astype(A.indices.dtype) # <<<<<<<<<<<<<< * X_user_counts = np.ediff1d(X.indptr) * X_aspect_counts = np.ediff1d(X.tocsc().indptr) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_repeat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_num_users); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_num_users); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -5160,7 +5155,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -5178,7 +5173,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_3, __pyx_v_A_user_counts}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5187,14 +5182,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_3, __pyx_v_A_user_counts}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -5205,17 +5200,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_GIVEREF(__pyx_v_A_user_counts); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_v_A_user_counts); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __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_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5231,25 +5226,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_A_uids = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":195 + /* "cornac/models/efm/recom_efm.pyx":198 * A_item_counts = np.ediff1d(A.tocsc().indptr) * A_uids = np.repeat(np.arange(self.train_set.num_users), A_user_counts).astype(A.indices.dtype) * X_user_counts = np.ediff1d(X.indptr) # <<<<<<<<<<<<<< * X_aspect_counts = np.ediff1d(X.tocsc().indptr) * X_uids = np.repeat(np.arange(self.train_set.num_users), X_user_counts).astype(X.indices.dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { @@ -5264,25 +5259,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); __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, 195, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_X_user_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":196 + /* "cornac/models/efm/recom_efm.pyx":199 * A_uids = np.repeat(np.arange(self.train_set.num_users), A_user_counts).astype(A.indices.dtype) * X_user_counts = np.ediff1d(X.indptr) * X_aspect_counts = np.ediff1d(X.tocsc().indptr) # <<<<<<<<<<<<<< * X_uids = np.repeat(np.arange(self.train_set.num_users), X_user_counts).astype(X.indices.dtype) * Y_item_counts = np.ediff1d(Y.indptr) */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -5296,10 +5291,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE } __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 196, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -5315,32 +5310,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_X_aspect_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":197 + /* "cornac/models/efm/recom_efm.pyx":200 * X_user_counts = np.ediff1d(X.indptr) * X_aspect_counts = np.ediff1d(X.tocsc().indptr) * X_uids = np.repeat(np.arange(self.train_set.num_users), X_user_counts).astype(X.indices.dtype) # <<<<<<<<<<<<<< * Y_item_counts = np.ediff1d(Y.indptr) * Y_aspect_counts = np.ediff1d(Y.tocsc().indptr) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_repeat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_repeat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5356,7 +5351,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -5374,7 +5369,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_2, __pyx_v_X_user_counts}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5383,14 +5378,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_2, __pyx_v_X_user_counts}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -5401,17 +5396,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_GIVEREF(__pyx_v_X_user_counts); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_v_X_user_counts); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5427,25 +5422,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_X_uids = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":198 + /* "cornac/models/efm/recom_efm.pyx":201 * X_aspect_counts = np.ediff1d(X.tocsc().indptr) * X_uids = np.repeat(np.arange(self.train_set.num_users), X_user_counts).astype(X.indices.dtype) * Y_item_counts = np.ediff1d(Y.indptr) # <<<<<<<<<<<<<< * Y_aspect_counts = np.ediff1d(Y.tocsc().indptr) * Y_iids = np.repeat(np.arange(self.train_set.num_items), Y_item_counts).astype(Y.indices.dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indptr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indptr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -5460,25 +5455,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Y_item_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":199 + /* "cornac/models/efm/recom_efm.pyx":202 * X_uids = np.repeat(np.arange(self.train_set.num_users), X_user_counts).astype(X.indices.dtype) * Y_item_counts = np.ediff1d(Y.indptr) * Y_aspect_counts = np.ediff1d(Y.tocsc().indptr) # <<<<<<<<<<<<<< * Y_iids = np.repeat(np.arange(self.train_set.num_items), Y_item_counts).astype(Y.indices.dtype) * self._fit_efm(self.num_threads, */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ediff1d); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -5492,10 +5487,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE } __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -5511,32 +5506,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_Y_aspect_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":200 + /* "cornac/models/efm/recom_efm.pyx":203 * Y_item_counts = np.ediff1d(Y.indptr) * Y_aspect_counts = np.ediff1d(Y.tocsc().indptr) * Y_iids = np.repeat(np.arange(self.train_set.num_items), Y_item_counts).astype(Y.indices.dtype) # <<<<<<<<<<<<<< * self._fit_efm(self.num_threads, * A.data.astype(np.float32), A_uids, A.indices, A_user_counts, A_item_counts, */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repeat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repeat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5552,7 +5547,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -5570,7 +5565,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_Y_item_counts}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5579,14 +5574,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_Y_item_counts}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -5597,17 +5592,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __Pyx_GIVEREF(__pyx_v_Y_item_counts); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_Y_item_counts); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indices); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indices); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -5623,39 +5618,39 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Y_iids = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":201 + /* "cornac/models/efm/recom_efm.pyx":204 * Y_aspect_counts = np.ediff1d(Y.tocsc().indptr) * Y_iids = np.repeat(np.arange(self.train_set.num_items), Y_item_counts).astype(Y.indices.dtype) * self._fit_efm(self.num_threads, # <<<<<<<<<<<<<< * A.data.astype(np.float32), A_uids, A.indices, A_user_counts, A_item_counts, * X.data.astype(np.float32), X_uids, X.indices, X_user_counts, X_aspect_counts, */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fit_efm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fit_efm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_threads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_threads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "cornac/models/efm/recom_efm.pyx":202 + /* "cornac/models/efm/recom_efm.pyx":205 * Y_iids = np.repeat(np.arange(self.train_set.num_items), Y_item_counts).astype(Y.indices.dtype) * self._fit_efm(self.num_threads, * A.data.astype(np.float32), A_uids, A.indices, A_user_counts, A_item_counts, # <<<<<<<<<<<<<< * X.data.astype(np.float32), X_uids, X.indices, X_user_counts, X_aspect_counts, * Y.data.astype(np.float32), Y_iids, Y.indices, Y_item_counts, Y_aspect_counts, */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5671,27 +5666,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_11 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - /* "cornac/models/efm/recom_efm.pyx":203 + /* "cornac/models/efm/recom_efm.pyx":206 * self._fit_efm(self.num_threads, * A.data.astype(np.float32), A_uids, A.indices, A_user_counts, A_item_counts, * X.data.astype(np.float32), X_uids, X.indices, X_user_counts, X_aspect_counts, # <<<<<<<<<<<<<< * Y.data.astype(np.float32), Y_iids, Y.indices, Y_item_counts, Y_aspect_counts, * self.U1, self.U2, self.V, self.H1, self.H2) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5707,27 +5702,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_5, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - /* "cornac/models/efm/recom_efm.pyx":204 + /* "cornac/models/efm/recom_efm.pyx":207 * A.data.astype(np.float32), A_uids, A.indices, A_user_counts, A_item_counts, * X.data.astype(np.float32), X_uids, X.indices, X_user_counts, X_aspect_counts, * Y.data.astype(np.float32), Y_iids, Y.indices, Y_item_counts, Y_aspect_counts, # <<<<<<<<<<<<<< * self.U1, self.U2, self.V, self.H1, self.H2) * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5743,28 +5738,28 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_13 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_5, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indices); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_indices); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - /* "cornac/models/efm/recom_efm.pyx":205 + /* "cornac/models/efm/recom_efm.pyx":208 * X.data.astype(np.float32), X_uids, X.indices, X_user_counts, X_aspect_counts, * Y.data.astype(np.float32), Y_iids, Y.indices, Y_item_counts, Y_aspect_counts, * self.U1, self.U2, self.V, self.H1, self.H2) # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = NULL; __pyx_t_4 = 0; @@ -5781,7 +5776,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[22] = {__pyx_t_19, __pyx_t_3, __pyx_t_11, __pyx_v_A_uids, __pyx_t_10, __pyx_v_A_user_counts, __pyx_v_A_item_counts, __pyx_t_2, __pyx_v_X_uids, __pyx_t_12, __pyx_v_X_user_counts, __pyx_v_X_aspect_counts, __pyx_t_13, __pyx_v_Y_iids, __pyx_t_14, __pyx_v_Y_item_counts, __pyx_v_Y_aspect_counts, __pyx_t_15, __pyx_t_5, __pyx_t_16, __pyx_t_17, __pyx_t_18}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 21+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 21+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5801,7 +5796,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[22] = {__pyx_t_19, __pyx_t_3, __pyx_t_11, __pyx_v_A_uids, __pyx_t_10, __pyx_v_A_user_counts, __pyx_v_A_item_counts, __pyx_t_2, __pyx_v_X_uids, __pyx_t_12, __pyx_v_X_user_counts, __pyx_v_X_aspect_counts, __pyx_t_13, __pyx_v_Y_iids, __pyx_t_14, __pyx_v_Y_item_counts, __pyx_v_Y_aspect_counts, __pyx_t_15, __pyx_t_5, __pyx_t_16, __pyx_t_17, __pyx_t_18}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 21+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 21+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5819,7 +5814,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE } else #endif { - __pyx_t_20 = PyTuple_New(21+__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_20 = PyTuple_New(21+__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_19) { __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL; @@ -5887,14 +5882,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":169 + /* "cornac/models/efm/recom_efm.pyx":172 * high=high, random_state=rng)) * * def fit(self, train_set, val_set=None): # <<<<<<<<<<<<<< @@ -5942,7 +5937,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_4fit(CYTHON_UNUSE return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":209 +/* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -5989,23 +5984,23 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_7_fit_efm(PyObjec case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -6022,7 +6017,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_7_fit_efm(PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6076,7 +6071,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ int __pyx_t_18; __Pyx_RefNannySetupContext("_fit_efm", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) { @@ -6094,7 +6089,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -6102,7 +6097,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -6112,14 +6107,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_v_long_is_signed = (!((((long)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_2 = ((2 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 2); __Pyx_INCREF(__pyx_t_1); @@ -6136,18 +6131,18 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_A, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_A, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -6156,12 +6151,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_22); __Pyx_GIVEREF(__pyx_int_22); @@ -6172,15 +6167,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -6190,7 +6185,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -6199,14 +6194,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -6228,14 +6223,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -6250,15 +6245,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); @@ -6267,15 +6262,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = __pyx_t_2; goto __pyx_L19_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L19_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -6302,7 +6297,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -6324,27 +6319,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_3 = ((3 < __pyx_t_5) != 0); if (__pyx_t_3) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } __pyx_t_6 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 3); __Pyx_INCREF(__pyx_t_6); @@ -6361,18 +6356,18 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_A_uids, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_A_uids, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L30_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_A_uids); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_A_uids); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_6); __pyx_t_6 = 0; @@ -6381,12 +6376,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_22); __Pyx_GIVEREF(__pyx_int_22); @@ -6397,15 +6392,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } __pyx_L29:; while (1) { @@ -6415,7 +6410,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -6424,14 +6419,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -6453,14 +6448,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_3 = (__pyx_v_dtype != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -6473,9 +6468,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; goto __pyx_L39_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -6487,7 +6482,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; __pyx_L39_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } __pyx_t_3 = (((sizeof(int)) == __pyx_v_itemsize) != 0); @@ -6496,9 +6491,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; goto __pyx_L43_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -6510,7 +6505,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; __pyx_L43_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } __pyx_t_3 = (((sizeof(long)) == __pyx_v_itemsize) != 0); @@ -6519,9 +6514,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; goto __pyx_L47_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -6533,7 +6528,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = __pyx_t_3; __pyx_L47_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } break; @@ -6562,7 +6557,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } /*else*/ { @@ -6584,7 +6579,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } /*else*/ { @@ -6606,27 +6601,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 212, __pyx_L1_error) goto __pyx_L33_break; } __pyx_L33_break:; - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; @@ -6634,12 +6629,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -6653,10 +6648,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s_); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -6671,12 +6666,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ } __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -6687,11 +6682,11 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_t_2 = (__pyx_v_dst_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_3) { __pyx_v_match_found = 1; @@ -6707,35 +6702,35 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_6_fit_efm(CYTHON_ __pyx_L65_break:; __pyx_t_3 = (__pyx_v_match_found != 0); if (__pyx_t_3) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 212, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 209, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6859,131 +6854,131 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_19_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -7012,31 +7007,31 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_19_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7341,165 +7336,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -7507,32 +7502,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -7540,23 +7535,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -7564,32 +7559,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -7597,23 +7592,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -7621,32 +7616,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -7654,23 +7649,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -7678,32 +7673,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -7711,23 +7706,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -7735,32 +7730,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -7768,23 +7763,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -7792,32 +7787,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -7825,23 +7820,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -7849,32 +7844,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -7882,23 +7877,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -7906,32 +7901,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -7939,23 +7934,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -7963,32 +7958,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -7996,23 +7991,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -8020,32 +8015,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -8053,7 +8048,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -8062,19 +8057,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -8082,16 +8077,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8099,17 +8094,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -8119,7 +8114,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -8128,7 +8123,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -8137,14 +8132,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8158,19 +8153,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8184,19 +8179,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8210,19 +8205,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8236,19 +8231,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8262,19 +8257,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8288,19 +8283,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8314,19 +8309,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8340,19 +8335,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8366,19 +8361,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8392,12 +8387,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -8433,14 +8428,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -8460,7 +8455,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -8470,7 +8465,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -8480,7 +8475,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -8492,7 +8487,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -8505,7 +8500,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -8515,7 +8510,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -8524,7 +8519,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -8536,7 +8531,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -8549,7 +8544,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -8562,7 +8557,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -8575,7 +8570,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -8589,7 +8584,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -8601,7 +8596,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -8614,7 +8609,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -8627,7 +8622,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -8640,7 +8635,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -8658,14 +8653,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -8685,7 +8680,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -8695,7 +8690,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -8705,7 +8700,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -8718,7 +8713,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -8728,7 +8723,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -8737,7 +8732,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -8749,7 +8744,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -8762,7 +8757,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -8775,7 +8770,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -8788,7 +8783,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -8806,14 +8801,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -8833,7 +8828,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -8843,7 +8838,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -8853,7 +8848,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -8866,7 +8861,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -8876,7 +8871,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -8885,7 +8880,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -8897,7 +8892,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -8910,7 +8905,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -8923,7 +8918,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -8936,7 +8931,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -8954,7 +8949,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -8984,7 +8979,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -8996,7 +8991,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -9009,7 +9004,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -9024,7 +9019,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -9045,7 +9040,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -9113,7 +9108,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -9143,7 +9138,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -9155,7 +9150,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -9168,7 +9163,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -9183,7 +9178,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -9204,14 +9199,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -9223,7 +9218,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -9236,7 +9231,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -9250,7 +9245,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((short *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -9271,7 +9266,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -9339,7 +9334,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -9369,7 +9364,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -9381,7 +9376,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -9394,7 +9389,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -9409,7 +9404,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -9430,14 +9425,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -9449,7 +9444,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -9462,7 +9457,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -9476,7 +9471,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((short *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -9497,7 +9492,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -9631,7 +9626,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -9657,27 +9652,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -9685,7 +9680,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -9696,9 +9691,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -9706,15 +9701,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -9723,7 +9718,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -9733,31 +9728,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -9766,7 +9761,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_18_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -9941,131 +9936,131 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_21_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -10094,31 +10089,31 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_21_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10423,165 +10418,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -10589,32 +10584,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -10622,23 +10617,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -10646,32 +10641,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -10679,23 +10674,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -10703,32 +10698,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -10736,23 +10731,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -10760,32 +10755,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -10793,23 +10788,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -10817,32 +10812,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -10850,23 +10845,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -10874,32 +10869,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -10907,23 +10902,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -10931,32 +10926,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -10964,23 +10959,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -10988,32 +10983,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -11021,23 +11016,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -11045,32 +11040,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -11078,23 +11073,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -11102,32 +11097,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -11135,7 +11130,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -11144,19 +11139,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -11164,16 +11159,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11181,17 +11176,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -11201,7 +11196,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -11210,7 +11205,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -11219,14 +11214,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11240,19 +11235,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11266,19 +11261,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11292,19 +11287,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11318,19 +11313,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11344,19 +11339,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11370,19 +11365,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11396,19 +11391,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11422,19 +11417,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11448,19 +11443,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -11474,12 +11469,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -11515,14 +11510,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -11542,7 +11537,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -11552,7 +11547,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -11562,7 +11557,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -11574,7 +11569,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -11587,7 +11582,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -11597,7 +11592,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -11606,7 +11601,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -11618,7 +11613,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -11631,7 +11626,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -11644,7 +11639,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -11657,7 +11652,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -11671,7 +11666,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -11683,7 +11678,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -11696,7 +11691,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -11709,7 +11704,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -11722,7 +11717,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -11740,14 +11735,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -11767,7 +11762,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -11777,7 +11772,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -11787,7 +11782,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -11800,7 +11795,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -11810,7 +11805,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -11819,7 +11814,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -11831,7 +11826,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -11844,7 +11839,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -11857,7 +11852,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -11870,7 +11865,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -11888,14 +11883,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -11915,7 +11910,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -11925,7 +11920,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -11935,7 +11930,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -11948,7 +11943,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -11958,7 +11953,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -11967,7 +11962,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -11979,7 +11974,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -11992,7 +11987,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -12005,7 +12000,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -12018,7 +12013,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -12036,7 +12031,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -12066,7 +12061,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -12078,7 +12073,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -12091,7 +12086,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -12106,7 +12101,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -12127,7 +12122,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -12195,7 +12190,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -12225,7 +12220,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -12237,7 +12232,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -12250,7 +12245,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -12265,7 +12260,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -12286,14 +12281,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -12305,7 +12300,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -12318,7 +12313,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -12332,7 +12327,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((int *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -12353,7 +12348,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -12421,7 +12416,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -12451,7 +12446,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -12463,7 +12458,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -12476,7 +12471,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -12491,7 +12486,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -12512,14 +12507,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -12531,7 +12526,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -12544,7 +12539,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -12558,7 +12553,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((int *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -12579,7 +12574,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -12713,7 +12708,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -12739,27 +12734,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -12767,7 +12762,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -12778,9 +12773,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -12788,15 +12783,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -12805,7 +12800,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -12815,31 +12810,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -12848,7 +12843,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_20_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -13023,131 +13018,131 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_23_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -13176,31 +13171,31 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_23_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13505,165 +13500,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -13671,32 +13666,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -13704,23 +13699,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -13728,32 +13723,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -13761,23 +13756,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -13785,32 +13780,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -13818,23 +13813,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -13842,32 +13837,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -13875,23 +13870,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -13899,32 +13894,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -13932,23 +13927,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -13956,32 +13951,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -13989,23 +13984,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -14013,32 +14008,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -14046,23 +14041,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -14070,32 +14065,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -14103,23 +14098,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -14127,32 +14122,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -14160,23 +14155,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -14184,32 +14179,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -14217,7 +14212,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -14226,19 +14221,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -14246,16 +14241,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14263,17 +14258,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -14283,7 +14278,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -14292,7 +14287,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -14301,14 +14296,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14322,19 +14317,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14348,19 +14343,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14374,19 +14369,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14400,19 +14395,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14426,19 +14421,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14452,19 +14447,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14478,19 +14473,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14504,19 +14499,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14530,19 +14525,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -14556,12 +14551,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -14597,14 +14592,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -14624,7 +14619,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -14634,7 +14629,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -14644,7 +14639,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -14656,7 +14651,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -14669,7 +14664,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -14679,7 +14674,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -14688,7 +14683,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -14700,7 +14695,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -14713,7 +14708,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -14726,7 +14721,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -14739,7 +14734,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -14753,7 +14748,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -14765,7 +14760,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -14778,7 +14773,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -14791,7 +14786,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -14804,7 +14799,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -14822,14 +14817,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -14849,7 +14844,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -14859,7 +14854,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -14869,7 +14864,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -14882,7 +14877,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -14892,7 +14887,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -14901,7 +14896,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -14913,7 +14908,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -14926,7 +14921,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -14939,7 +14934,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -14952,7 +14947,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -14970,14 +14965,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -14997,7 +14992,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_v_prediction = ((float)__PYX_NAN()); __pyx_v_score = ((float)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -15007,7 +15002,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -15017,7 +15012,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -15030,7 +15025,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_0__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -15040,7 +15035,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((float *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -15049,7 +15044,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -15061,7 +15056,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -15074,7 +15069,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -15087,7 +15082,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -15100,7 +15095,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -15118,7 +15113,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -15148,7 +15143,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -15160,7 +15155,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -15173,7 +15168,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -15188,7 +15183,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -15209,7 +15204,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -15277,7 +15272,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -15307,7 +15302,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -15319,7 +15314,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -15332,7 +15327,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -15347,7 +15342,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -15368,14 +15363,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -15387,7 +15382,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -15400,7 +15395,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -15414,7 +15409,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((long *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -15435,7 +15430,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -15503,7 +15498,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -15533,7 +15528,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -15545,7 +15540,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -15558,7 +15553,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -15573,7 +15568,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -15594,14 +15589,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -15613,7 +15608,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -15626,7 +15621,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -15640,7 +15635,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((long *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -15661,7 +15656,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -15795,7 +15790,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -15821,27 +15816,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -15849,7 +15844,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -15860,9 +15855,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -15870,15 +15865,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -15887,7 +15882,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -15897,31 +15892,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -15930,7 +15925,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_22_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -16105,131 +16100,131 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_25_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -16258,31 +16253,31 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_25_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_short(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16587,165 +16582,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -16753,32 +16748,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -16786,23 +16781,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -16810,32 +16805,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -16843,23 +16838,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -16867,32 +16862,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -16900,23 +16895,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -16924,32 +16919,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -16957,23 +16952,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -16981,32 +16976,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -17014,23 +17009,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -17038,32 +17033,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -17071,23 +17066,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -17095,32 +17090,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -17128,23 +17123,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -17152,32 +17147,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -17185,23 +17180,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -17209,32 +17204,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -17242,23 +17237,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -17266,32 +17261,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -17299,7 +17294,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -17308,19 +17303,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -17328,16 +17323,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -17345,17 +17340,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -17365,7 +17360,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -17374,7 +17369,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -17383,14 +17378,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17404,19 +17399,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17430,19 +17425,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17456,19 +17451,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17482,19 +17477,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17508,19 +17503,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17534,19 +17529,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17560,19 +17555,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17586,19 +17581,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17612,19 +17607,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17638,12 +17633,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -17679,14 +17674,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -17706,7 +17701,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -17716,7 +17711,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -17726,7 +17721,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -17738,7 +17733,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -17751,7 +17746,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -17761,7 +17756,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -17770,7 +17765,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -17782,7 +17777,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -17795,7 +17790,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -17808,7 +17803,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -17821,7 +17816,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -17835,7 +17830,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -17847,7 +17842,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -17860,7 +17855,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -17873,7 +17868,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -17886,7 +17881,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -17904,14 +17899,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -17931,7 +17926,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -17941,7 +17936,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -17951,7 +17946,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -17964,7 +17959,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -17974,7 +17969,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -17983,7 +17978,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -17995,7 +17990,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -18008,7 +18003,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -18021,7 +18016,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -18034,7 +18029,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -18052,14 +18047,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -18079,7 +18074,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -18089,7 +18084,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((short *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -18099,7 +18094,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((short *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -18112,7 +18107,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -18122,7 +18117,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -18131,7 +18126,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -18143,7 +18138,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -18156,7 +18151,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -18169,7 +18164,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -18182,7 +18177,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -18200,7 +18195,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -18230,7 +18225,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -18242,7 +18237,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -18255,7 +18250,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -18270,7 +18265,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -18291,7 +18286,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -18359,7 +18354,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -18389,7 +18384,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -18401,7 +18396,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -18414,7 +18409,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -18429,7 +18424,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -18450,14 +18445,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -18469,7 +18464,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -18482,7 +18477,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -18496,7 +18491,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((short *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -18517,7 +18512,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -18585,7 +18580,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -18615,7 +18610,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -18627,7 +18622,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -18640,7 +18635,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -18655,7 +18650,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((short *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((short *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -18676,14 +18671,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -18695,7 +18690,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -18708,7 +18703,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -18722,7 +18717,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((short *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -18743,7 +18738,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -18877,7 +18872,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -18903,27 +18898,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -18931,7 +18926,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -18942,9 +18937,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -18952,15 +18947,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -18969,7 +18964,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -18979,31 +18974,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -19012,7 +19007,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_24_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -19187,131 +19182,131 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_27_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -19340,31 +19335,31 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_27_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19669,165 +19664,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -19835,32 +19830,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -19868,23 +19863,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -19892,32 +19887,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -19925,23 +19920,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -19949,32 +19944,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -19982,23 +19977,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -20006,32 +20001,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -20039,23 +20034,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -20063,32 +20058,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -20096,23 +20091,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -20120,32 +20115,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -20153,23 +20148,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -20177,32 +20172,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -20210,23 +20205,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -20234,32 +20229,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -20267,23 +20262,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -20291,32 +20286,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -20324,23 +20319,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -20348,32 +20343,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -20381,7 +20376,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -20390,19 +20385,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -20410,16 +20405,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -20427,17 +20422,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -20447,7 +20442,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -20456,7 +20451,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -20465,14 +20460,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20486,19 +20481,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20512,19 +20507,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20538,19 +20533,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20564,19 +20559,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20590,19 +20585,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20616,19 +20611,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20642,19 +20637,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20668,19 +20663,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20694,19 +20689,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -20720,12 +20715,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -20761,14 +20756,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -20788,7 +20783,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -20798,7 +20793,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -20808,7 +20803,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -20820,7 +20815,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -20833,7 +20828,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -20843,7 +20838,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -20852,7 +20847,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -20864,7 +20859,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -20877,7 +20872,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -20890,7 +20885,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -20903,7 +20898,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -20917,7 +20912,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -20929,7 +20924,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -20942,7 +20937,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -20955,7 +20950,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -20968,7 +20963,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -20986,14 +20981,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -21013,7 +21008,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -21023,7 +21018,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -21033,7 +21028,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -21046,7 +21041,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -21056,7 +21051,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -21065,7 +21060,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -21077,7 +21072,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -21090,7 +21085,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -21103,7 +21098,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -21116,7 +21111,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -21134,14 +21129,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -21161,7 +21156,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -21171,7 +21166,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((int *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -21181,7 +21176,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((int *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -21194,7 +21189,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -21204,7 +21199,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -21213,7 +21208,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -21225,7 +21220,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -21238,7 +21233,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -21251,7 +21246,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -21264,7 +21259,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -21282,7 +21277,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -21312,7 +21307,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -21324,7 +21319,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -21337,7 +21332,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -21352,7 +21347,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -21373,7 +21368,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -21441,7 +21436,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -21471,7 +21466,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -21483,7 +21478,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -21496,7 +21491,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -21511,7 +21506,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -21532,14 +21527,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -21551,7 +21546,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -21564,7 +21559,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -21578,7 +21573,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((int *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -21599,7 +21594,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -21667,7 +21662,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -21697,7 +21692,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -21709,7 +21704,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -21722,7 +21717,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -21737,7 +21732,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((int *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -21758,14 +21753,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -21777,7 +21772,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -21790,7 +21785,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -21804,7 +21799,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((int *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -21825,7 +21820,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -21959,7 +21954,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -21985,27 +21980,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -22013,7 +22008,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -22024,9 +22019,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -22034,15 +22029,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -22051,7 +22046,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -22061,31 +22056,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -22094,7 +22089,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_26_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -22269,131 +22264,131 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_29_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 4); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 5); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 6); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 7); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_uids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 8); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 9); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_user_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 10); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 11); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 12); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_iids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 13); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aids)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 14); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_item_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 15); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y_aspect_counts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 16); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 17: if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 17); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 18: if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 18); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 19: if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 19); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 20: if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 20); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 21: if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, 21); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fit_efm") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 22) { goto __pyx_L5_argtuple_error; @@ -22422,31 +22417,31 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_29_ values[21] = PyTuple_GET_ITEM(__pyx_args, 21); } __pyx_v_self = values[0]; - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 210, __pyx_L3_error) - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 211, __pyx_L3_error) - __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 212, __pyx_L3_error) - __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + __pyx_v_A = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_uids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_iids.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_user_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_A_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_A_item_counts.memview)) __PYX_ERR(0, 213, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_uids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_uids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aids.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_user_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_user_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_X_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X_aspect_counts.memview)) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_Y = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_iids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_iids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aids = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aids.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_item_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_item_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_Y_aspect_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[16], PyBUF_WRITABLE); if (unlikely(!__pyx_v_Y_aspect_counts.memview)) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_U1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[17], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_U2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[18], PyBUF_WRITABLE); if (unlikely(!__pyx_v_U2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_V = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[19], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[20], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H1.memview)) __PYX_ERR(0, 216, __pyx_L3_error) + __pyx_v_H2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[21], PyBUF_WRITABLE); if (unlikely(!__pyx_v_H2.memview)) __PYX_ERR(0, 216, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_fit_efm", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._fit_efm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -22751,165 +22746,165 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_pybuffernd_H2_denominator.data = NULL; __pyx_pybuffernd_H2_denominator.rcbuffer = &__pyx_pybuffer_H2_denominator; - /* "cornac/models/efm/recom_efm.pyx":217 + /* "cornac/models/efm/recom_efm.pyx":220 * """ * cdef: * long num_users = self.train_set.num_users # <<<<<<<<<<<<<< * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_users); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num_users = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":218 + /* "cornac/models/efm/recom_efm.pyx":221 * cdef: * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items # <<<<<<<<<<<<<< * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_items = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":219 + /* "cornac/models/efm/recom_efm.pyx":222 * long num_users = self.train_set.num_users * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects # <<<<<<<<<<<<<< * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_aspects = __pyx_t_3; - /* "cornac/models/efm/recom_efm.pyx":220 + /* "cornac/models/efm/recom_efm.pyx":223 * long num_items = self.train_set.num_items * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors # <<<<<<<<<<<<<< * int num_latent_factors = self.num_latent_factors * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_explicit_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_explicit_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":221 + /* "cornac/models/efm/recom_efm.pyx":224 * long num_aspects = self.train_set.sentiment.num_aspects * int num_explicit_factors = self.num_explicit_factors * int num_latent_factors = self.num_latent_factors # <<<<<<<<<<<<<< * * floating lambda_x = self.lambda_x */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_latent_factors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_latent_factors = __pyx_t_4; - /* "cornac/models/efm/recom_efm.pyx":223 + /* "cornac/models/efm/recom_efm.pyx":226 * int num_latent_factors = self.num_latent_factors * * floating lambda_x = self.lambda_x # <<<<<<<<<<<<<< * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_x = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":224 + /* "cornac/models/efm/recom_efm.pyx":227 * * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y # <<<<<<<<<<<<<< * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_y = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":225 + /* "cornac/models/efm/recom_efm.pyx":228 * floating lambda_x = self.lambda_x * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u # <<<<<<<<<<<<<< * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_u = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":226 + /* "cornac/models/efm/recom_efm.pyx":229 * floating lambda_y = self.lambda_y * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h # <<<<<<<<<<<<<< * floating lambda_v = self.lambda_v * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_h = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":227 + /* "cornac/models/efm/recom_efm.pyx":230 * floating lambda_u = self.lambda_u * floating lambda_h = self.lambda_h * floating lambda_v = self.lambda_v # <<<<<<<<<<<<<< * * floating prediction, score, loss */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lambda_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_lambda_v = __pyx_t_5; - /* "cornac/models/efm/recom_efm.pyx":231 + /* "cornac/models/efm/recom_efm.pyx":234 * floating prediction, score, loss * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -22917,32 +22912,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 231, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } else {__pyx_pybuffernd_U1_numerator.diminfo[0].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_numerator.diminfo[0].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_numerator.diminfo[1].strides = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_numerator.diminfo[1].shape = __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -22950,23 +22945,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_U1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":232 + /* "cornac/models/efm/recom_efm.pyx":235 * * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -22974,32 +22969,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 232, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } else {__pyx_pybuffernd_U1_denominator.diminfo[0].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U1_denominator.diminfo[0].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U1_denominator.diminfo[1].strides = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U1_denominator.diminfo[1].shape = __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -23007,23 +23002,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_U1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":233 + /* "cornac/models/efm/recom_efm.pyx":236 * np.ndarray[np.float32_t, ndim=2] U1_numerator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -23031,32 +23026,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 233, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } else {__pyx_pybuffernd_U2_numerator.diminfo[0].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_numerator.diminfo[0].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_numerator.diminfo[1].strides = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_numerator.diminfo[1].shape = __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -23064,23 +23059,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_U2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":234 + /* "cornac/models/efm/recom_efm.pyx":237 * np.ndarray[np.float32_t, ndim=2] U1_denominator = np.empty((num_users, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -23088,32 +23083,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 234, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_U2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 234, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else {__pyx_pybuffernd_U2_denominator.diminfo[0].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U2_denominator.diminfo[0].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U2_denominator.diminfo[1].strides = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U2_denominator.diminfo[1].shape = __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -23121,23 +23116,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_U2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":235 + /* "cornac/models/efm/recom_efm.pyx":238 * np.ndarray[np.float32_t, ndim=2] U2_numerator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -23145,32 +23140,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else {__pyx_pybuffernd_V_numerator.diminfo[0].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_numerator.diminfo[0].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_numerator.diminfo[1].strides = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_numerator.diminfo[1].shape = __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -23178,23 +23173,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_V_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":236 + /* "cornac/models/efm/recom_efm.pyx":239 * np.ndarray[np.float32_t, ndim=2] U2_denominator = np.empty((num_items, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_aspects); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_explicit_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -23202,32 +23197,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 236, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_V_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } else {__pyx_pybuffernd_V_denominator.diminfo[0].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_denominator.diminfo[0].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_denominator.diminfo[1].strides = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_denominator.diminfo[1].shape = __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -23235,23 +23230,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_V_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":237 + /* "cornac/models/efm/recom_efm.pyx":240 * np.ndarray[np.float32_t, ndim=2] V_numerator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -23259,32 +23254,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 237, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else {__pyx_pybuffernd_H1_numerator.diminfo[0].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_numerator.diminfo[0].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_numerator.diminfo[1].strides = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_numerator.diminfo[1].shape = __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -23292,23 +23287,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_H1_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":238 + /* "cornac/models/efm/recom_efm.pyx":241 * np.ndarray[np.float32_t, ndim=2] V_denominator = np.empty((num_aspects, num_explicit_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -23316,32 +23311,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 238, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H1_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else {__pyx_pybuffernd_H1_denominator.diminfo[0].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H1_denominator.diminfo[0].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H1_denominator.diminfo[1].strides = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H1_denominator.diminfo[1].shape = __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -23349,23 +23344,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_H1_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":239 + /* "cornac/models/efm/recom_efm.pyx":242 * np.ndarray[np.float32_t, ndim=2] H1_numerator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) * int i, j, k, idx */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -23373,32 +23368,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_t_17 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_numerator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else {__pyx_pybuffernd_H2_numerator.diminfo[0].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_numerator.diminfo[0].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_numerator.diminfo[1].strides = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_numerator.diminfo[1].shape = __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.shape[1]; } } @@ -23406,23 +23401,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_H2_numerator = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":240 + /* "cornac/models/efm/recom_efm.pyx":243 * np.ndarray[np.float32_t, ndim=2] H1_denominator = np.empty((num_users, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_numerator = np.empty((num_items, num_latent_factors), dtype=np.float32) * np.ndarray[np.float32_t, ndim=2] H2_denominator = np.empty((num_items, num_latent_factors), dtype=np.float32) # <<<<<<<<<<<<<< * int i, j, k, idx * long n_ratings */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_num_latent_factors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -23430,32 +23425,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 240, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_H2_denominator = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else {__pyx_pybuffernd_H2_denominator.diminfo[0].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H2_denominator.diminfo[0].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H2_denominator.diminfo[1].strides = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H2_denominator.diminfo[1].shape = __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.shape[1]; } } @@ -23463,7 +23458,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_H2_denominator = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":244 + /* "cornac/models/efm/recom_efm.pyx":247 * long n_ratings * * floating eps = 1e-9 # <<<<<<<<<<<<<< @@ -23472,19 +23467,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ __pyx_v_eps = 1e-9; - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< * loss = 0. * U1_numerator.fill(0) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__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(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -23492,16 +23487,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -23509,17 +23504,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 249, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -23529,7 +23524,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 246, __pyx_L1_error) + else __PYX_ERR(0, 249, __pyx_L1_error) } break; } @@ -23538,7 +23533,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":247 + /* "cornac/models/efm/recom_efm.pyx":250 * * for t in range(1, self.max_iter + 1): * loss = 0. # <<<<<<<<<<<<<< @@ -23547,14 +23542,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ __pyx_v_loss = 0.; - /* "cornac/models/efm/recom_efm.pyx":248 + /* "cornac/models/efm/recom_efm.pyx":251 * for t in range(1, self.max_iter + 1): * loss = 0. * U1_numerator.fill(0) # <<<<<<<<<<<<<< * U1_denominator.fill(0) * U2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23568,19 +23563,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":249 + /* "cornac/models/efm/recom_efm.pyx":252 * loss = 0. * U1_numerator.fill(0) * U1_denominator.fill(0) # <<<<<<<<<<<<<< * U2_numerator.fill(0) * U2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23594,19 +23589,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":250 + /* "cornac/models/efm/recom_efm.pyx":253 * U1_numerator.fill(0) * U1_denominator.fill(0) * U2_numerator.fill(0) # <<<<<<<<<<<<<< * U2_denominator.fill(0) * V_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23620,19 +23615,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":251 + /* "cornac/models/efm/recom_efm.pyx":254 * U1_denominator.fill(0) * U2_numerator.fill(0) * U2_denominator.fill(0) # <<<<<<<<<<<<<< * V_numerator.fill(0) * V_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23646,19 +23641,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":252 + /* "cornac/models/efm/recom_efm.pyx":255 * U2_numerator.fill(0) * U2_denominator.fill(0) * V_numerator.fill(0) # <<<<<<<<<<<<<< * V_denominator.fill(0) * H1_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23672,19 +23667,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":253 + /* "cornac/models/efm/recom_efm.pyx":256 * U2_denominator.fill(0) * V_numerator.fill(0) * V_denominator.fill(0) # <<<<<<<<<<<<<< * H1_numerator.fill(0) * H1_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23698,19 +23693,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":254 + /* "cornac/models/efm/recom_efm.pyx":257 * V_numerator.fill(0) * V_denominator.fill(0) * H1_numerator.fill(0) # <<<<<<<<<<<<<< * H1_denominator.fill(0) * H2_numerator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23724,19 +23719,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":255 + /* "cornac/models/efm/recom_efm.pyx":258 * V_denominator.fill(0) * H1_numerator.fill(0) * H1_denominator.fill(0) # <<<<<<<<<<<<<< * H2_numerator.fill(0) * H2_denominator.fill(0) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H1_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23750,19 +23745,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":256 + /* "cornac/models/efm/recom_efm.pyx":259 * H1_numerator.fill(0) * H1_denominator.fill(0) * H2_numerator.fill(0) # <<<<<<<<<<<<<< * H2_denominator.fill(0) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_numerator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23776,19 +23771,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":257 + /* "cornac/models/efm/recom_efm.pyx":260 * H1_denominator.fill(0) * H2_numerator.fill(0) * H2_denominator.fill(0) # <<<<<<<<<<<<<< * * with nogil, parallel(num_threads=num_threads): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H2_denominator), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -23802,12 +23797,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_0); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -23843,14 +23838,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON Py_BEGIN_ALLOW_THREADS #endif /* _OPENMP */ - /* "cornac/models/efm/recom_efm.pyx":261 + /* "cornac/models/efm/recom_efm.pyx":264 * with nogil, parallel(num_threads=num_threads): * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): # <<<<<<<<<<<<<< * i = A_uids[idx] * j = A_iids[idx] */ - if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 261, __pyx_L12_error) } + if (unlikely(!__pyx_v_A.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("A"); __PYX_ERR(0, 264, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_A.shape[0]); if (1 == 0) abort(); { @@ -23870,7 +23865,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":262 + /* "cornac/models/efm/recom_efm.pyx":265 * # compute numerators and denominators for all factors * for idx in prange(A.shape[0]): * i = A_uids[idx] # <<<<<<<<<<<<<< @@ -23880,7 +23875,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_24 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_A_uids.data + __pyx_t_24 * __pyx_v_A_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":263 + /* "cornac/models/efm/recom_efm.pyx":266 * for idx in prange(A.shape[0]): * i = A_uids[idx] * j = A_iids[idx] # <<<<<<<<<<<<<< @@ -23890,7 +23885,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_25 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_A_iids.data + __pyx_t_25 * __pyx_v_A_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":264 + /* "cornac/models/efm/recom_efm.pyx":267 * i = A_uids[idx] * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ # <<<<<<<<<<<<<< @@ -23902,7 +23897,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_28 = __pyx_v_j; __pyx_t_29 = 0; - /* "cornac/models/efm/recom_efm.pyx":265 + /* "cornac/models/efm/recom_efm.pyx":268 * j = A_iids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) # <<<<<<<<<<<<<< @@ -23915,7 +23910,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_33 = 0; __pyx_v_prediction = (__pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_26 * __pyx_v_U1.strides[0]) ) + __pyx_t_27 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_28 * __pyx_v_U2.strides[0]) ) + __pyx_t_29 * __pyx_v_U2.strides[1]) )))), 1) + __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_latent_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_30 * __pyx_v_H1.strides[0]) ) + __pyx_t_31 * __pyx_v_H1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_32 * __pyx_v_H2.strides[0]) ) + __pyx_t_33 * __pyx_v_H2.strides[1]) )))), 1)); - /* "cornac/models/efm/recom_efm.pyx":266 + /* "cornac/models/efm/recom_efm.pyx":269 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &U2[j, 0], 1) \ * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] # <<<<<<<<<<<<<< @@ -23925,7 +23920,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_34 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_34 * __pyx_v_A.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":267 + /* "cornac/models/efm/recom_efm.pyx":270 * + _dot(num_latent_factors, &H1[i, 0], 1, &H2[j, 0], 1) * score = A[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -23934,7 +23929,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":268 + /* "cornac/models/efm/recom_efm.pyx":271 * score = A[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -23946,7 +23941,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":269 + /* "cornac/models/efm/recom_efm.pyx":272 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] # <<<<<<<<<<<<<< @@ -23959,7 +23954,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_40 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_37 * __pyx_v_U2.strides[0]) ) + __pyx_t_38 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":270 + /* "cornac/models/efm/recom_efm.pyx":273 * for k in range(num_explicit_factors): * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] # <<<<<<<<<<<<<< @@ -23972,7 +23967,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_44 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_41 * __pyx_v_U2.strides[0]) ) + __pyx_t_42 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":271 + /* "cornac/models/efm/recom_efm.pyx":274 * U1_numerator[i, k] += score * U2[j, k] * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] # <<<<<<<<<<<<<< @@ -23985,7 +23980,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_48 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_45 * __pyx_v_U1.strides[0]) ) + __pyx_t_46 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":272 + /* "cornac/models/efm/recom_efm.pyx":275 * U1_denominator[i, k] += prediction * U2[j, k] * U2_numerator[j, k] += score * U1[i, k] * U2_denominator[j, k] += prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -23999,7 +23994,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_49 * __pyx_v_U1.strides[0]) ) + __pyx_t_50 * __pyx_v_U1.strides[1]) )))); } - /* "cornac/models/efm/recom_efm.pyx":274 + /* "cornac/models/efm/recom_efm.pyx":277 * U2_denominator[j, k] += prediction * U1[i, k] * * for k in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -24011,7 +24006,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":275 + /* "cornac/models/efm/recom_efm.pyx":278 * * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] # <<<<<<<<<<<<<< @@ -24024,7 +24019,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_56 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_numerator.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_H1_numerator.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_H1_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_53 * __pyx_v_H2.strides[0]) ) + __pyx_t_54 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":276 + /* "cornac/models/efm/recom_efm.pyx":279 * for k in range(num_latent_factors): * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] # <<<<<<<<<<<<<< @@ -24037,7 +24032,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_60 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += (__pyx_v_prediction * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_57 * __pyx_v_H2.strides[0]) ) + __pyx_t_58 * __pyx_v_H2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":277 + /* "cornac/models/efm/recom_efm.pyx":280 * H1_numerator[i, k] += score * H2[j, k] * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] # <<<<<<<<<<<<<< @@ -24050,7 +24045,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_64 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_numerator.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_H2_numerator.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_H2_numerator.diminfo[1].strides) += (__pyx_v_score * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_61 * __pyx_v_H1.strides[0]) ) + __pyx_t_62 * __pyx_v_H1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":278 + /* "cornac/models/efm/recom_efm.pyx":281 * H1_denominator[i, k] += prediction * H2[j, k] * H2_numerator[j, k] += score * H1[i, k] * H2_denominator[j, k] += prediction * H1[i, k] # <<<<<<<<<<<<<< @@ -24068,14 +24063,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":280 + /* "cornac/models/efm/recom_efm.pyx":283 * H2_denominator[j, k] += prediction * H1[i, k] * * for idx in prange(X.shape[0]): # <<<<<<<<<<<<<< * i = X_uids[idx] * j = X_aids[idx] */ - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 280, __pyx_L12_error) } + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("X"); __PYX_ERR(0, 283, __pyx_L12_error) } __pyx_t_23 = (__pyx_v_X.shape[0]); if (1 == 0) abort(); { @@ -24095,7 +24090,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":281 + /* "cornac/models/efm/recom_efm.pyx":284 * * for idx in prange(X.shape[0]): * i = X_uids[idx] # <<<<<<<<<<<<<< @@ -24105,7 +24100,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_69 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_X_uids.data + __pyx_t_69 * __pyx_v_X_uids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":282 + /* "cornac/models/efm/recom_efm.pyx":285 * for idx in prange(X.shape[0]): * i = X_uids[idx] * j = X_aids[idx] # <<<<<<<<<<<<<< @@ -24115,7 +24110,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_70 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_X_aids.data + __pyx_t_70 * __pyx_v_X_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":283 + /* "cornac/models/efm/recom_efm.pyx":286 * i = X_uids[idx] * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -24128,7 +24123,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_74 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_71 * __pyx_v_U1.strides[0]) ) + __pyx_t_72 * __pyx_v_U1.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_73 * __pyx_v_V.strides[0]) ) + __pyx_t_74 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":284 + /* "cornac/models/efm/recom_efm.pyx":287 * j = X_aids[idx] * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] # <<<<<<<<<<<<<< @@ -24138,7 +24133,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_75 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_X.data + __pyx_t_75 * __pyx_v_X.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":285 + /* "cornac/models/efm/recom_efm.pyx":288 * prediction = _dot(num_explicit_factors, &U1[i, 0], 1, &V[j, 0], 1) * score = X[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -24147,7 +24142,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":286 + /* "cornac/models/efm/recom_efm.pyx":289 * score = X[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -24159,7 +24154,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":287 + /* "cornac/models/efm/recom_efm.pyx":290 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] # <<<<<<<<<<<<<< @@ -24172,7 +24167,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_79 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_76 * __pyx_v_U1.strides[0]) ) + __pyx_t_77 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":288 + /* "cornac/models/efm/recom_efm.pyx":291 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] # <<<<<<<<<<<<<< @@ -24185,7 +24180,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_83 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_80 * __pyx_v_U1.strides[0]) ) + __pyx_t_81 * __pyx_v_U1.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":289 + /* "cornac/models/efm/recom_efm.pyx":292 * V_numerator[j, k] += lambda_x * score * U1[i, k] * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] # <<<<<<<<<<<<<< @@ -24198,7 +24193,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_87 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_numerator.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_U1_numerator.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_U1_numerator.diminfo[1].strides) += ((__pyx_v_lambda_x * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_84 * __pyx_v_V.strides[0]) ) + __pyx_t_85 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":290 + /* "cornac/models/efm/recom_efm.pyx":293 * V_denominator[j, k] += lambda_x * prediction * U1[i, k] * U1_numerator[i, k] += lambda_x * score * V[j, k] * U1_denominator[i, k] += lambda_x * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -24216,14 +24211,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":292 + /* "cornac/models/efm/recom_efm.pyx":295 * U1_denominator[i, k] += lambda_x * prediction * V[j, k] * * for idx in prange(Y.shape[0]): # <<<<<<<<<<<<<< * i = Y_iids[idx] * j = Y_aids[idx] */ - if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 292, __pyx_L12_error) } + if (unlikely(!__pyx_v_Y.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("Y"); __PYX_ERR(0, 295, __pyx_L12_error) } __pyx_t_21 = (__pyx_v_Y.shape[0]); if (1 == 0) abort(); { @@ -24243,7 +24238,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_v_prediction = ((double)__PYX_NAN()); __pyx_v_score = ((double)__PYX_NAN()); - /* "cornac/models/efm/recom_efm.pyx":293 + /* "cornac/models/efm/recom_efm.pyx":296 * * for idx in prange(Y.shape[0]): * i = Y_iids[idx] # <<<<<<<<<<<<<< @@ -24253,7 +24248,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_92 = __pyx_v_idx; __pyx_v_i = (*((long *) ( /* dim=0 */ (__pyx_v_Y_iids.data + __pyx_t_92 * __pyx_v_Y_iids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":294 + /* "cornac/models/efm/recom_efm.pyx":297 * for idx in prange(Y.shape[0]): * i = Y_iids[idx] * j = Y_aids[idx] # <<<<<<<<<<<<<< @@ -24263,7 +24258,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_93 = __pyx_v_idx; __pyx_v_j = (*((long *) ( /* dim=0 */ (__pyx_v_Y_aids.data + __pyx_t_93 * __pyx_v_Y_aids.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":295 + /* "cornac/models/efm/recom_efm.pyx":298 * i = Y_iids[idx] * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) # <<<<<<<<<<<<<< @@ -24276,7 +24271,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_97 = 0; __pyx_v_prediction = __pyx_fuse_1__pyx_f_6cornac_6models_3efm_9recom_efm__dot(__pyx_v_num_explicit_factors, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_94 * __pyx_v_U2.strides[0]) ) + __pyx_t_95 * __pyx_v_U2.strides[1]) )))), 1, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_96 * __pyx_v_V.strides[0]) ) + __pyx_t_97 * __pyx_v_V.strides[1]) )))), 1); - /* "cornac/models/efm/recom_efm.pyx":296 + /* "cornac/models/efm/recom_efm.pyx":299 * j = Y_aids[idx] * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] # <<<<<<<<<<<<<< @@ -24286,7 +24281,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_98 = __pyx_v_idx; __pyx_v_score = (*((double *) ( /* dim=0 */ (__pyx_v_Y.data + __pyx_t_98 * __pyx_v_Y.strides[0]) ))); - /* "cornac/models/efm/recom_efm.pyx":297 + /* "cornac/models/efm/recom_efm.pyx":300 * prediction = _dot(num_explicit_factors, &U2[i, 0], 1, &V[j, 0], 1) * score = Y[idx] * loss += (prediction - score) * (prediction - score) # <<<<<<<<<<<<<< @@ -24295,7 +24290,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_prediction - __pyx_v_score) * (__pyx_v_prediction - __pyx_v_score))); - /* "cornac/models/efm/recom_efm.pyx":298 + /* "cornac/models/efm/recom_efm.pyx":301 * score = Y[idx] * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -24307,7 +24302,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_k = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":299 + /* "cornac/models/efm/recom_efm.pyx":302 * loss += (prediction - score) * (prediction - score) * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] # <<<<<<<<<<<<<< @@ -24320,7 +24315,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_102 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_numerator.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_V_numerator.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_V_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_99 * __pyx_v_U2.strides[0]) ) + __pyx_t_100 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":300 + /* "cornac/models/efm/recom_efm.pyx":303 * for k in range(num_explicit_factors): * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] # <<<<<<<<<<<<<< @@ -24333,7 +24328,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_106 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_prediction) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_103 * __pyx_v_U2.strides[0]) ) + __pyx_t_104 * __pyx_v_U2.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":301 + /* "cornac/models/efm/recom_efm.pyx":304 * V_numerator[j, k] += lambda_y * score * U2[i, k] * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] # <<<<<<<<<<<<<< @@ -24346,7 +24341,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_110 = __pyx_v_k; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_numerator.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_U2_numerator.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_U2_numerator.diminfo[1].strides) += ((__pyx_v_lambda_y * __pyx_v_score) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_107 * __pyx_v_V.strides[0]) ) + __pyx_t_108 * __pyx_v_V.strides[1]) )))); - /* "cornac/models/efm/recom_efm.pyx":302 + /* "cornac/models/efm/recom_efm.pyx":305 * V_denominator[j, k] += lambda_y * prediction * U2[i, k] * U2_numerator[i, k] += lambda_y * score * V[j, k] * U2_denominator[i, k] += lambda_y * prediction * V[j, k] # <<<<<<<<<<<<<< @@ -24364,7 +24359,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":305 + /* "cornac/models/efm/recom_efm.pyx":308 * * # update V * for i in prange(num_aspects): # <<<<<<<<<<<<<< @@ -24394,7 +24389,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":306 + /* "cornac/models/efm/recom_efm.pyx":309 * # update V * for i in prange(num_aspects): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -24406,7 +24401,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":307 + /* "cornac/models/efm/recom_efm.pyx":310 * for i in prange(num_aspects): * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] # <<<<<<<<<<<<<< @@ -24419,7 +24414,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_120 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_v * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_117 * __pyx_v_V.strides[0]) ) + __pyx_t_118 * __pyx_v_V.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_119 * __pyx_v_V.strides[0]) ) + __pyx_t_120 * __pyx_v_V.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":308 + /* "cornac/models/efm/recom_efm.pyx":311 * for j in range(num_explicit_factors): * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps # <<<<<<<<<<<<<< @@ -24434,7 +24429,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_126 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_V_denominator.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_V_denominator.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_V_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_X_aspect_counts.data + __pyx_t_121 * __pyx_v_X_aspect_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_Y_aspect_counts.data + __pyx_t_122 * __pyx_v_Y_aspect_counts.strides[0]) )))) * __pyx_v_lambda_v) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_V.data + __pyx_t_123 * __pyx_v_V.strides[0]) ) + __pyx_t_124 * __pyx_v_V.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":309 + /* "cornac/models/efm/recom_efm.pyx":312 * loss += lambda_v * V[i, j] * V[i, j] * V_denominator[i, j] += (X_aspect_counts[i] + Y_aspect_counts[i]) * lambda_v * V[i, j] + eps * V[i, j] *= sqrt(V_numerator[i, j] / V_denominator[i, j]) # <<<<<<<<<<<<<< @@ -24455,7 +24450,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 309, __pyx_L42_error) + __PYX_ERR(0, 312, __pyx_L42_error) } __pyx_t_133 = __pyx_v_i; __pyx_t_134 = __pyx_v_j; @@ -24523,7 +24518,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":312 + /* "cornac/models/efm/recom_efm.pyx":315 * * # update U1, H1 * for i in prange(num_users): # <<<<<<<<<<<<<< @@ -24553,7 +24548,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":313 + /* "cornac/models/efm/recom_efm.pyx":316 * # update U1, H1 * for i in prange(num_users): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -24565,7 +24560,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":314 + /* "cornac/models/efm/recom_efm.pyx":317 * for i in prange(num_users): * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] # <<<<<<<<<<<<<< @@ -24578,7 +24573,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_138 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_135 * __pyx_v_U1.strides[0]) ) + __pyx_t_136 * __pyx_v_U1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_137 * __pyx_v_U1.strides[0]) ) + __pyx_t_138 * __pyx_v_U1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":315 + /* "cornac/models/efm/recom_efm.pyx":318 * for j in range(num_explicit_factors): * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps # <<<<<<<<<<<<<< @@ -24593,7 +24588,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_144 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U1_denominator.rcbuffer->pybuffer.buf, __pyx_t_143, __pyx_pybuffernd_U1_denominator.diminfo[0].strides, __pyx_t_144, __pyx_pybuffernd_U1_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_139 * __pyx_v_A_user_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_X_user_counts.data + __pyx_t_140 * __pyx_v_X_user_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_141 * __pyx_v_U1.strides[0]) ) + __pyx_t_142 * __pyx_v_U1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":316 + /* "cornac/models/efm/recom_efm.pyx":319 * loss += lambda_u * U1[i, j] * U1[i, j] * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -24614,14 +24609,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 316, __pyx_L50_error) + __PYX_ERR(0, 319, __pyx_L50_error) } __pyx_t_149 = __pyx_v_i; __pyx_t_150 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U1.data + __pyx_t_149 * __pyx_v_U1.strides[0]) ) + __pyx_t_150 * __pyx_v_U1.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":317 + /* "cornac/models/efm/recom_efm.pyx":320 * U1_denominator[i, j] += (A_user_counts[i] + X_user_counts[i])* lambda_u * U1[i, j] + eps * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -24633,7 +24628,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":318 + /* "cornac/models/efm/recom_efm.pyx":321 * U1[i, j] *= sqrt(U1_numerator[i, j] / U1_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] # <<<<<<<<<<<<<< @@ -24646,7 +24641,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_154 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_151 * __pyx_v_H1.strides[0]) ) + __pyx_t_152 * __pyx_v_H1.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_153 * __pyx_v_H1.strides[0]) ) + __pyx_t_154 * __pyx_v_H1.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":319 + /* "cornac/models/efm/recom_efm.pyx":322 * for j in range(num_latent_factors): * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps # <<<<<<<<<<<<<< @@ -24660,7 +24655,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_159 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H1_denominator.rcbuffer->pybuffer.buf, __pyx_t_158, __pyx_pybuffernd_H1_denominator.diminfo[0].strides, __pyx_t_159, __pyx_pybuffernd_H1_denominator.diminfo[1].strides) += ((((*((long *) ( /* dim=0 */ (__pyx_v_A_user_counts.data + __pyx_t_155 * __pyx_v_A_user_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H1.data + __pyx_t_156 * __pyx_v_H1.strides[0]) ) + __pyx_t_157 * __pyx_v_H1.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":320 + /* "cornac/models/efm/recom_efm.pyx":323 * loss += lambda_h * H1[i, j] * H1[i, j] * H1_denominator[i, j] += A_user_counts[i] * lambda_h * H1[i, j] + eps * H1[i, j] *= sqrt(H1_numerator[i, j] / H1_denominator[i, j]) # <<<<<<<<<<<<<< @@ -24681,7 +24676,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 320, __pyx_L50_error) + __PYX_ERR(0, 323, __pyx_L50_error) } __pyx_t_164 = __pyx_v_i; __pyx_t_165 = __pyx_v_j; @@ -24749,7 +24744,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":323 + /* "cornac/models/efm/recom_efm.pyx":326 * * # update U2, H2 * for i in prange(num_items): # <<<<<<<<<<<<<< @@ -24779,7 +24774,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON /* Initialize private variables to invalid values */ __pyx_v_j = ((int)0xbad0bad0); - /* "cornac/models/efm/recom_efm.pyx":324 + /* "cornac/models/efm/recom_efm.pyx":327 * # update U2, H2 * for i in prange(num_items): * for j in range(num_explicit_factors): # <<<<<<<<<<<<<< @@ -24791,7 +24786,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":325 + /* "cornac/models/efm/recom_efm.pyx":328 * for i in prange(num_items): * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] # <<<<<<<<<<<<<< @@ -24804,7 +24799,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_169 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_u * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_166 * __pyx_v_U2.strides[0]) ) + __pyx_t_167 * __pyx_v_U2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_168 * __pyx_v_U2.strides[0]) ) + __pyx_t_169 * __pyx_v_U2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":326 + /* "cornac/models/efm/recom_efm.pyx":329 * for j in range(num_explicit_factors): * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps # <<<<<<<<<<<<<< @@ -24819,7 +24814,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_175 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_U2_denominator.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_U2_denominator.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_U2_denominator.diminfo[1].strides) += (((((*((long *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_170 * __pyx_v_A_item_counts.strides[0]) ))) + (*((long *) ( /* dim=0 */ (__pyx_v_Y_item_counts.data + __pyx_t_171 * __pyx_v_Y_item_counts.strides[0]) )))) * __pyx_v_lambda_u) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_172 * __pyx_v_U2.strides[0]) ) + __pyx_t_173 * __pyx_v_U2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":327 + /* "cornac/models/efm/recom_efm.pyx":330 * loss += lambda_u * U2[i, j] * U2[i, j] * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -24840,14 +24835,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 327, __pyx_L60_error) + __PYX_ERR(0, 330, __pyx_L60_error) } __pyx_t_180 = __pyx_v_i; __pyx_t_181 = __pyx_v_j; *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_U2.data + __pyx_t_180 * __pyx_v_U2.strides[0]) ) + __pyx_t_181 * __pyx_v_U2.strides[1]) )) *= sqrt((__pyx_t_132 / __pyx_t_129)); } - /* "cornac/models/efm/recom_efm.pyx":328 + /* "cornac/models/efm/recom_efm.pyx":331 * U2_denominator[i, j] += (A_item_counts[i] + Y_item_counts[i]) * lambda_u * U2[i, j] + eps * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): # <<<<<<<<<<<<<< @@ -24859,7 +24854,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) { __pyx_v_j = __pyx_t_36; - /* "cornac/models/efm/recom_efm.pyx":329 + /* "cornac/models/efm/recom_efm.pyx":332 * U2[i, j] *= sqrt(U2_numerator[i, j] / U2_denominator[i, j]) * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] # <<<<<<<<<<<<<< @@ -24872,7 +24867,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_185 = __pyx_v_j; __pyx_v_loss = (__pyx_v_loss + ((__pyx_v_lambda_h * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_182 * __pyx_v_H2.strides[0]) ) + __pyx_t_183 * __pyx_v_H2.strides[1]) )))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_184 * __pyx_v_H2.strides[0]) ) + __pyx_t_185 * __pyx_v_H2.strides[1]) ))))); - /* "cornac/models/efm/recom_efm.pyx":330 + /* "cornac/models/efm/recom_efm.pyx":333 * for j in range(num_latent_factors): * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps # <<<<<<<<<<<<<< @@ -24886,7 +24881,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_190 = __pyx_v_j; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_H2_denominator.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_H2_denominator.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_H2_denominator.diminfo[1].strides) += ((((*((long *) ( /* dim=0 */ (__pyx_v_A_item_counts.data + __pyx_t_186 * __pyx_v_A_item_counts.strides[0]) ))) * __pyx_v_lambda_h) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_H2.data + __pyx_t_187 * __pyx_v_H2.strides[0]) ) + __pyx_t_188 * __pyx_v_H2.strides[1]) )))) + __pyx_v_eps); - /* "cornac/models/efm/recom_efm.pyx":331 + /* "cornac/models/efm/recom_efm.pyx":334 * loss += lambda_h * H2[i, j] * H2[i, j] * H2_denominator[i, j] += A_item_counts[i] * lambda_h * H2[i, j] + eps * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) # <<<<<<<<<<<<<< @@ -24907,7 +24902,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 331, __pyx_L60_error) + __PYX_ERR(0, 334, __pyx_L60_error) } __pyx_t_195 = __pyx_v_i; __pyx_t_196 = __pyx_v_j; @@ -25041,7 +25036,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON #endif } - /* "cornac/models/efm/recom_efm.pyx":259 + /* "cornac/models/efm/recom_efm.pyx":262 * H2_denominator.fill(0) * * with nogil, parallel(num_threads=num_threads): # <<<<<<<<<<<<<< @@ -25067,27 +25062,27 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } } - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< * print('iter: %d, loss: %f' % (t, loss)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":334 + /* "cornac/models/efm/recom_efm.pyx":337 * * if self.verbose: * print('iter: %d, loss: %f' % (t, loss)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_23 = 0; __pyx_t_198 = 127; @@ -25095,7 +25090,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_23 += 6; __Pyx_GIVEREF(__pyx_kp_u_iter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_iter); - __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Format(__pyx_v_t, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_198; __pyx_t_23 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -25106,9 +25101,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __pyx_t_23 += 8; __Pyx_GIVEREF(__pyx_kp_u_loss); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_loss); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_198 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_198) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_198; @@ -25116,15 +25111,15 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_23, __pyx_t_198); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":333 + /* "cornac/models/efm/recom_efm.pyx":336 * H2[i, j] *= sqrt(H2_numerator[i, j] / H2_denominator[i, j]) * * if self.verbose: # <<<<<<<<<<<<<< @@ -25133,7 +25128,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":246 + /* "cornac/models/efm/recom_efm.pyx":249 * floating eps = 1e-9 * * for t in range(1, self.max_iter + 1): # <<<<<<<<<<<<<< @@ -25143,31 +25138,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Optimization finished!') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_197 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_197 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_197) { - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":336 + /* "cornac/models/efm/recom_efm.pyx":339 * print('iter: %d, loss: %f' % (t, loss)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -25176,7 +25171,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON */ } - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< @@ -25259,7 +25254,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_28_fit_efm(CYTHON return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":339 +/* "cornac/models/efm/recom_efm.pyx":342 * print('Optimization finished!') * * def _build_matrices(self, data_set): # <<<<<<<<<<<<<< @@ -25299,11 +25294,11 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_9_build_matrices( case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_set)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_build_matrices", 1, 2, 2, 1); __PYX_ERR(0, 339, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_build_matrices", 1, 2, 2, 1); __PYX_ERR(0, 342, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_build_matrices") < 0)) __PYX_ERR(0, 339, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_build_matrices") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -25316,7 +25311,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_9_build_matrices( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_build_matrices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_build_matrices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 342, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._build_matrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -25386,65 +25381,65 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyObject *__pyx_t_21 = NULL; __Pyx_RefNannySetupContext("_build_matrices", 0); - /* "cornac/models/efm/recom_efm.pyx":340 + /* "cornac/models/efm/recom_efm.pyx":343 * * def _build_matrices(self, data_set): * sentiment = self.train_set.sentiment # <<<<<<<<<<<<<< * ratings = [] * map_uid = [] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentiment = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":341 + /* "cornac/models/efm/recom_efm.pyx":344 * def _build_matrices(self, data_set): * sentiment = self.train_set.sentiment * ratings = [] # <<<<<<<<<<<<<< * map_uid = [] * map_iid = [] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ratings = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":342 + /* "cornac/models/efm/recom_efm.pyx":345 * sentiment = self.train_set.sentiment * ratings = [] * map_uid = [] # <<<<<<<<<<<<<< * map_iid = [] * */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_map_uid = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":343 + /* "cornac/models/efm/recom_efm.pyx":346 * ratings = [] * map_uid = [] * map_iid = [] # <<<<<<<<<<<<<< * * for uid, iid, rating in data_set.uir_iter(): */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_map_iid = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":345 + /* "cornac/models/efm/recom_efm.pyx":348 * map_iid = [] * * for uid, iid, rating in data_set.uir_iter(): # <<<<<<<<<<<<<< * if self.train_set.is_unk_user(uid) or self.train_set.is_unk_item(iid): * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_set, __pyx_n_s_uir_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_set, __pyx_n_s_uir_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -25458,16 +25453,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __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_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -25475,17 +25470,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -25495,7 +25490,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( 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) + else __PYX_ERR(0, 348, __pyx_L1_error) } break; } @@ -25507,7 +25502,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 345, __pyx_L1_error) + __PYX_ERR(0, 348, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25523,17 +25518,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __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, 345, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -25543,7 +25538,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_GOTREF(__pyx_t_6); index = 2; __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), 3) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 348, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -25551,7 +25546,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 345, __pyx_L1_error) + __PYX_ERR(0, 348, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_uid, __pyx_t_3); @@ -25561,16 +25556,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_rating, __pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":346 + /* "cornac/models/efm/recom_efm.pyx":349 * * for uid, iid, rating in data_set.uir_iter(): * if self.train_set.is_unk_user(uid) or self.train_set.is_unk_item(iid): # <<<<<<<<<<<<<< * continue * ratings.append(rating) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -25585,19 +25580,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_uid) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_uid); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -25612,16 +25607,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_iid) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_iid); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __pyx_t_11; __pyx_L8_bool_binop_done:; if (__pyx_t_10) { - /* "cornac/models/efm/recom_efm.pyx":347 + /* "cornac/models/efm/recom_efm.pyx":350 * for uid, iid, rating in data_set.uir_iter(): * if self.train_set.is_unk_user(uid) or self.train_set.is_unk_item(iid): * continue # <<<<<<<<<<<<<< @@ -25630,7 +25625,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ goto __pyx_L3_continue; - /* "cornac/models/efm/recom_efm.pyx":346 + /* "cornac/models/efm/recom_efm.pyx":349 * * for uid, iid, rating in data_set.uir_iter(): * if self.train_set.is_unk_user(uid) or self.train_set.is_unk_item(iid): # <<<<<<<<<<<<<< @@ -25639,34 +25634,34 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ } - /* "cornac/models/efm/recom_efm.pyx":348 + /* "cornac/models/efm/recom_efm.pyx":351 * if self.train_set.is_unk_user(uid) or self.train_set.is_unk_item(iid): * continue * ratings.append(rating) # <<<<<<<<<<<<<< * map_uid.append(uid) * map_iid.append(iid) */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ratings, __pyx_v_rating); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ratings, __pyx_v_rating); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 351, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":349 + /* "cornac/models/efm/recom_efm.pyx":352 * continue * ratings.append(rating) * map_uid.append(uid) # <<<<<<<<<<<<<< * map_iid.append(iid) * */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_uid, __pyx_v_uid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_uid, __pyx_v_uid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":350 + /* "cornac/models/efm/recom_efm.pyx":353 * ratings.append(rating) * map_uid.append(uid) * map_iid.append(iid) # <<<<<<<<<<<<<< * * ratings = np.asarray(ratings, dtype=np.float).flatten() */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_iid, __pyx_v_iid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_iid, __pyx_v_iid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 353, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":345 + /* "cornac/models/efm/recom_efm.pyx":348 * map_iid = [] * * for uid, iid, rating in data_set.uir_iter(): # <<<<<<<<<<<<<< @@ -25677,38 +25672,38 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":352 + /* "cornac/models/efm/recom_efm.pyx":355 * map_iid.append(iid) * * ratings = np.asarray(ratings, dtype=np.float).flatten() # <<<<<<<<<<<<<< * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ratings); __Pyx_GIVEREF(__pyx_v_ratings); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ratings); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -25723,44 +25718,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_ratings, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":353 + /* "cornac/models/efm/recom_efm.pyx":356 * * ratings = np.asarray(ratings, dtype=np.float).flatten() * map_uid = np.asarray(map_uid, dtype=np.int).flatten() # <<<<<<<<<<<<<< * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * A = sp.csr_matrix((ratings, (map_uid, map_iid)), */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_map_uid); __Pyx_GIVEREF(__pyx_v_map_uid); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_map_uid); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 353, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -25775,44 +25770,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_map_uid, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":354 + /* "cornac/models/efm/recom_efm.pyx":357 * ratings = np.asarray(ratings, dtype=np.float).flatten() * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() # <<<<<<<<<<<<<< * A = sp.csr_matrix((ratings, (map_uid, map_iid)), * shape=(self.train_set.num_users, self.train_set.num_items)) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_map_iid); __Pyx_GIVEREF(__pyx_v_map_iid); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_map_iid); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 354, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -25827,25 +25822,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_map_iid, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":355 + /* "cornac/models/efm/recom_efm.pyx":358 * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * A = sp.csr_matrix((ratings, (map_uid, map_iid)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_users, self.train_set.num_items)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_map_uid); __Pyx_GIVEREF(__pyx_v_map_uid); @@ -25853,7 +25848,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_v_map_iid); __Pyx_GIVEREF(__pyx_v_map_iid); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_map_iid); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_ratings); __Pyx_GIVEREF(__pyx_v_ratings); @@ -25861,32 +25856,32 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":356 + /* "cornac/models/efm/recom_efm.pyx":359 * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * A = sp.csr_matrix((ratings, (map_uid, map_iid)), * shape=(self.train_set.num_users, self.train_set.num_items)) # <<<<<<<<<<<<<< * * attention_scores = [] */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_users); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_users); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); @@ -25894,17 +25889,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_t_2) < 0) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":355 + /* "cornac/models/efm/recom_efm.pyx":358 * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * A = sp.csr_matrix((ratings, (map_uid, map_iid)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_users, self.train_set.num_items)) * */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -25912,43 +25907,43 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_v_A = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":358 + /* "cornac/models/efm/recom_efm.pyx":361 * shape=(self.train_set.num_users, self.train_set.num_items)) * * attention_scores = [] # <<<<<<<<<<<<<< * map_uid = [] * map_aspect_id = [] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_attention_scores = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":359 + /* "cornac/models/efm/recom_efm.pyx":362 * * attention_scores = [] * map_uid = [] # <<<<<<<<<<<<<< * map_aspect_id = [] * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_map_uid, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":360 + /* "cornac/models/efm/recom_efm.pyx":363 * attention_scores = [] * map_uid = [] * map_aspect_id = [] # <<<<<<<<<<<<<< * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): * if self.train_set.is_unk_user(uid): */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_map_aspect_id = __pyx_t_2; __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":361 + /* "cornac/models/efm/recom_efm.pyx":364 * map_uid = [] * map_aspect_id = [] * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): # <<<<<<<<<<<<<< @@ -25956,13 +25951,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * continue */ __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_user_sentiment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_user_sentiment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_t_7 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 361, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_n_s_items, (&__pyx_t_13), (&__pyx_t_14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); @@ -25971,7 +25966,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_13, &__pyx_t_4, &__pyx_t_1, &__pyx_t_7, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; - if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_uid, __pyx_t_1); @@ -25979,16 +25974,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_sentiment_tup_ids_by_item, __pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":362 + /* "cornac/models/efm/recom_efm.pyx":365 * map_aspect_id = [] * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): * if self.train_set.is_unk_user(uid): # <<<<<<<<<<<<<< * continue * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -26003,14 +25998,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_uid) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_uid); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_10) { - /* "cornac/models/efm/recom_efm.pyx":363 + /* "cornac/models/efm/recom_efm.pyx":366 * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): * if self.train_set.is_unk_user(uid): * continue # <<<<<<<<<<<<<< @@ -26019,7 +26014,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ goto __pyx_L10_continue; - /* "cornac/models/efm/recom_efm.pyx":362 + /* "cornac/models/efm/recom_efm.pyx":365 * map_aspect_id = [] * for uid, sentiment_tup_ids_by_item in sentiment.user_sentiment.items(): * if self.train_set.is_unk_user(uid): # <<<<<<<<<<<<<< @@ -26028,7 +26023,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ } - /* "cornac/models/efm/recom_efm.pyx":364 + /* "cornac/models/efm/recom_efm.pyx":367 * if self.train_set.is_unk_user(uid): * continue * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() # <<<<<<<<<<<<<< @@ -26036,14 +26031,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * user_aspect_count = Counter(user_aspects) */ { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L15_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_16 = 0; if (unlikely(__pyx_v_sentiment_tup_ids_by_item == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); - __PYX_ERR(0, 364, __pyx_L15_error) + __PYX_ERR(0, 367, __pyx_L15_error) } - __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_item, 0, __pyx_n_s_values, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L15_error) + __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_item, 0, __pyx_n_s_values, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -26051,30 +26046,30 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_17, &__pyx_t_16, NULL, &__pyx_t_1, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 364, __pyx_L15_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 367, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_tup_id, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":365 + /* "cornac/models/efm/recom_efm.pyx":368 * continue * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() * for tup in sentiment.sentiment[tup_id]] # <<<<<<<<<<<<<< * user_aspect_count = Counter(user_aspects) * for aid, count in user_aspect_count.items(): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_7genexpr__pyx_v_tup_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_7genexpr__pyx_v_tup_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_19 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_19 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L15_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -26082,17 +26077,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L15_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L15_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L15_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -26102,7 +26097,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 365, __pyx_L15_error) + else __PYX_ERR(0, 368, __pyx_L15_error) } break; } @@ -26111,19 +26106,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_tup, __pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":364 + /* "cornac/models/efm/recom_efm.pyx":367 * if self.train_set.is_unk_user(uid): * continue * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() # <<<<<<<<<<<<<< * for tup in sentiment.sentiment[tup_id]] * user_aspect_count = Counter(user_aspects) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L15_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 367, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 364, __pyx_L15_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 367, __pyx_L15_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cornac/models/efm/recom_efm.pyx":365 + /* "cornac/models/efm/recom_efm.pyx":368 * continue * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() * for tup in sentiment.sentiment[tup_id]] # <<<<<<<<<<<<<< @@ -26146,14 +26141,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_user_aspects, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":366 + /* "cornac/models/efm/recom_efm.pyx":369 * user_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_item.values() * for tup in sentiment.sentiment[tup_id]] * user_aspect_count = Counter(user_aspects) # <<<<<<<<<<<<<< * for aid, count in user_aspect_count.items(): * attention_scores.append(self._compute_attention_score(count)) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Counter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Counter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -26167,13 +26162,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_user_aspects) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_user_aspects); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_user_aspect_count, __pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":367 + /* "cornac/models/efm/recom_efm.pyx":370 * for tup in sentiment.sentiment[tup_id]] * user_aspect_count = Counter(user_aspects) * for aid, count in user_aspect_count.items(): # <<<<<<<<<<<<<< @@ -26183,9 +26178,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_t_17 = 0; if (unlikely(__pyx_v_user_aspect_count == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 367, __pyx_L1_error) + __PYX_ERR(0, 370, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_user_aspect_count, 0, __pyx_n_s_items, (&__pyx_t_16), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_user_aspect_count, 0, __pyx_n_s_items, (&__pyx_t_16), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_6; @@ -26193,7 +26188,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_16, &__pyx_t_17, &__pyx_t_6, &__pyx_t_1, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 367, __pyx_L1_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_aid, __pyx_t_6); @@ -26201,14 +26196,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":368 + /* "cornac/models/efm/recom_efm.pyx":371 * user_aspect_count = Counter(user_aspects) * for aid, count in user_aspect_count.items(): * attention_scores.append(self._compute_attention_score(count)) # <<<<<<<<<<<<<< * map_uid.append(uid) * map_aspect_id.append(aid) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_attention_score); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_attention_score); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -26222,67 +26217,67 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_count) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_count); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_attention_scores, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_attention_scores, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":369 + /* "cornac/models/efm/recom_efm.pyx":372 * for aid, count in user_aspect_count.items(): * attention_scores.append(self._compute_attention_score(count)) * map_uid.append(uid) # <<<<<<<<<<<<<< * map_aspect_id.append(aid) * */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_uid, __pyx_v_uid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_uid, __pyx_v_uid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":370 + /* "cornac/models/efm/recom_efm.pyx":373 * attention_scores.append(self._compute_attention_score(count)) * map_uid.append(uid) * map_aspect_id.append(aid) # <<<<<<<<<<<<<< * * attention_scores = np.asarray(attention_scores, dtype=np.float).flatten() */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_aspect_id, __pyx_v_aid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_aspect_id, __pyx_v_aid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 373, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":372 + /* "cornac/models/efm/recom_efm.pyx":375 * map_aspect_id.append(aid) * * attention_scores = np.asarray(attention_scores, dtype=np.float).flatten() # <<<<<<<<<<<<<< * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_attention_scores); __Pyx_GIVEREF(__pyx_v_attention_scores); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_attention_scores); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 372, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -26297,44 +26292,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_attention_scores, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":373 + /* "cornac/models/efm/recom_efm.pyx":376 * * attention_scores = np.asarray(attention_scores, dtype=np.float).flatten() * map_uid = np.asarray(map_uid, dtype=np.int).flatten() # <<<<<<<<<<<<<< * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * X = sp.csr_matrix((attention_scores, (map_uid, map_aspect_id)), */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_map_uid); __Pyx_GIVEREF(__pyx_v_map_uid); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_map_uid); - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 373, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -26349,44 +26344,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_map_uid, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":374 + /* "cornac/models/efm/recom_efm.pyx":377 * attention_scores = np.asarray(attention_scores, dtype=np.float).flatten() * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() # <<<<<<<<<<<<<< * X = sp.csr_matrix((attention_scores, (map_uid, map_aspect_id)), * shape=(self.train_set.num_users, sentiment.num_aspects)) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_map_aspect_id); __Pyx_GIVEREF(__pyx_v_map_aspect_id); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_map_aspect_id); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __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; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -26401,25 +26396,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_map_aspect_id, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":375 + /* "cornac/models/efm/recom_efm.pyx":378 * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * X = sp.csr_matrix((attention_scores, (map_uid, map_aspect_id)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_users, sentiment.num_aspects)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_map_uid); __Pyx_GIVEREF(__pyx_v_map_uid); @@ -26427,7 +26422,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_v_map_aspect_id); __Pyx_GIVEREF(__pyx_v_map_aspect_id); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_map_aspect_id); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_attention_scores); __Pyx_GIVEREF(__pyx_v_attention_scores); @@ -26435,29 +26430,29 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":376 + /* "cornac/models/efm/recom_efm.pyx":379 * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * X = sp.csr_matrix((attention_scores, (map_uid, map_aspect_id)), * shape=(self.train_set.num_users, sentiment.num_aspects)) # <<<<<<<<<<<<<< * * quality_scores = [] */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_num_users); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); @@ -26465,17 +26460,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_8 = 0; __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":375 + /* "cornac/models/efm/recom_efm.pyx":378 * map_uid = np.asarray(map_uid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * X = sp.csr_matrix((attention_scores, (map_uid, map_aspect_id)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_users, sentiment.num_aspects)) * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26483,43 +26478,43 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_v_X = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":378 + /* "cornac/models/efm/recom_efm.pyx":381 * shape=(self.train_set.num_users, sentiment.num_aspects)) * * quality_scores = [] # <<<<<<<<<<<<<< * map_iid = [] * map_aspect_id = [] */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_quality_scores = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":379 + /* "cornac/models/efm/recom_efm.pyx":382 * * quality_scores = [] * map_iid = [] # <<<<<<<<<<<<<< * map_aspect_id = [] * */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_map_iid, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":380 + /* "cornac/models/efm/recom_efm.pyx":383 * quality_scores = [] * map_iid = [] * map_aspect_id = [] # <<<<<<<<<<<<<< * * for iid, sentiment_tup_ids_by_user in sentiment.item_sentiment.items(): */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_map_aspect_id, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":382 + /* "cornac/models/efm/recom_efm.pyx":385 * map_aspect_id = [] * * for iid, sentiment_tup_ids_by_user in sentiment.item_sentiment.items(): # <<<<<<<<<<<<<< @@ -26527,13 +26522,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * continue */ __pyx_t_13 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_item_sentiment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_item_sentiment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 382, __pyx_L1_error) + __PYX_ERR(0, 385, __pyx_L1_error) } - __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); @@ -26542,7 +26537,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_13, &__pyx_t_2, &__pyx_t_1, NULL, __pyx_t_14); if (unlikely(__pyx_t_15 == 0)) break; - if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_iid, __pyx_t_2); @@ -26550,16 +26545,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_sentiment_tup_ids_by_user, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":383 + /* "cornac/models/efm/recom_efm.pyx":386 * * for iid, sentiment_tup_ids_by_user in sentiment.item_sentiment.items(): * if self.train_set.is_unk_item(iid): # <<<<<<<<<<<<<< * continue * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -26574,14 +26569,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_iid) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_iid); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_10) { - /* "cornac/models/efm/recom_efm.pyx":384 + /* "cornac/models/efm/recom_efm.pyx":387 * for iid, sentiment_tup_ids_by_user in sentiment.item_sentiment.items(): * if self.train_set.is_unk_item(iid): * continue # <<<<<<<<<<<<<< @@ -26590,7 +26585,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ goto __pyx_L23_continue; - /* "cornac/models/efm/recom_efm.pyx":383 + /* "cornac/models/efm/recom_efm.pyx":386 * * for iid, sentiment_tup_ids_by_user in sentiment.item_sentiment.items(): * if self.train_set.is_unk_item(iid): # <<<<<<<<<<<<<< @@ -26599,7 +26594,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ } - /* "cornac/models/efm/recom_efm.pyx":385 + /* "cornac/models/efm/recom_efm.pyx":388 * if self.train_set.is_unk_item(iid): * continue * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() # <<<<<<<<<<<<<< @@ -26607,14 +26602,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * item_aspect_count = Counter(item_aspects) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L28_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = 0; if (unlikely(__pyx_v_sentiment_tup_ids_by_user == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); - __PYX_ERR(0, 385, __pyx_L28_error) + __PYX_ERR(0, 388, __pyx_L28_error) } - __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_user, 0, __pyx_n_s_values, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L28_error) + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_user, 0, __pyx_n_s_values, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_2; @@ -26622,30 +26617,30 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_17, &__pyx_t_16, NULL, &__pyx_t_2, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 385, __pyx_L28_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 388, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_tup_id, __pyx_t_2); __pyx_t_2 = 0; - /* "cornac/models/efm/recom_efm.pyx":386 + /* "cornac/models/efm/recom_efm.pyx":389 * continue * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() * for tup in sentiment.sentiment[tup_id]] # <<<<<<<<<<<<<< * item_aspect_count = Counter(item_aspects) * total_sentiment_by_aspect = OrderedDict() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_8genexpr1__pyx_v_tup_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_8genexpr1__pyx_v_tup_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L28_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_19 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_19 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L28_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -26653,17 +26648,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_7); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_7); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 389, __pyx_L28_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_7); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_7); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 389, __pyx_L28_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L28_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -26673,7 +26668,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 386, __pyx_L28_error) + else __PYX_ERR(0, 389, __pyx_L28_error) } break; } @@ -26682,19 +26677,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_tup, __pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":385 + /* "cornac/models/efm/recom_efm.pyx":388 * if self.train_set.is_unk_item(iid): * continue * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() # <<<<<<<<<<<<<< * for tup in sentiment.sentiment[tup_id]] * item_aspect_count = Counter(item_aspects) */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L28_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 385, __pyx_L28_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 388, __pyx_L28_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":386 + /* "cornac/models/efm/recom_efm.pyx":389 * continue * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() * for tup in sentiment.sentiment[tup_id]] # <<<<<<<<<<<<<< @@ -26717,14 +26712,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_item_aspects, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":387 + /* "cornac/models/efm/recom_efm.pyx":390 * item_aspects = [tup[0] for tup_id in sentiment_tup_ids_by_user.values() * for tup in sentiment.sentiment[tup_id]] * item_aspect_count = Counter(item_aspects) # <<<<<<<<<<<<<< * total_sentiment_by_aspect = OrderedDict() * for tup_id in sentiment_tup_ids_by_user.values(): */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Counter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Counter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -26738,20 +26733,20 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_item_aspects) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_item_aspects); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_item_aspect_count, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":388 + /* "cornac/models/efm/recom_efm.pyx":391 * for tup in sentiment.sentiment[tup_id]] * item_aspect_count = Counter(item_aspects) * total_sentiment_by_aspect = OrderedDict() # <<<<<<<<<<<<<< * for tup_id in sentiment_tup_ids_by_user.values(): * for aid, _, sentiment_polarity in sentiment.sentiment[tup_id]: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -26765,13 +26760,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_total_sentiment_by_aspect, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":389 + /* "cornac/models/efm/recom_efm.pyx":392 * item_aspect_count = Counter(item_aspects) * total_sentiment_by_aspect = OrderedDict() * for tup_id in sentiment_tup_ids_by_user.values(): # <<<<<<<<<<<<<< @@ -26781,9 +26776,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_t_17 = 0; if (unlikely(__pyx_v_sentiment_tup_ids_by_user == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); - __PYX_ERR(0, 389, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_user, 0, __pyx_n_s_values, (&__pyx_t_16), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_sentiment_tup_ids_by_user, 0, __pyx_n_s_values, (&__pyx_t_16), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; @@ -26791,30 +26786,30 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_16, &__pyx_t_17, NULL, &__pyx_t_6, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_tup_id, __pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":390 + /* "cornac/models/efm/recom_efm.pyx":393 * total_sentiment_by_aspect = OrderedDict() * for tup_id in sentiment_tup_ids_by_user.values(): * for aid, _, sentiment_polarity in sentiment.sentiment[tup_id]: # <<<<<<<<<<<<<< * total_sentiment_by_aspect[aid] = total_sentiment_by_aspect.get(aid, 0) + sentiment_polarity * for aid, total_sentiment in total_sentiment_by_aspect.items(): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_sentiment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_tup_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_tup_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_19 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -26822,17 +26817,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 393, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_19); __Pyx_INCREF(__pyx_t_2); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 393, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -26842,7 +26837,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 390, __pyx_L1_error) + else __PYX_ERR(0, 393, __pyx_L1_error) } break; } @@ -26854,7 +26849,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 390, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -26870,17 +26865,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_20); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_20 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_20 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_21 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_21 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_21)->tp_iternext; @@ -26890,7 +26885,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_20 = __pyx_t_9(__pyx_t_21); if (unlikely(!__pyx_t_20)) goto __pyx_L38_unpacking_failed; __Pyx_GOTREF(__pyx_t_20); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_21), 3) < 0) __PYX_ERR(0, 390, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_21), 3) < 0) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L39_unpacking_done; @@ -26898,7 +26893,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 390, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) __pyx_L39_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_aid, __pyx_t_7); @@ -26908,14 +26903,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_sentiment_polarity, __pyx_t_20); __pyx_t_20 = 0; - /* "cornac/models/efm/recom_efm.pyx":391 + /* "cornac/models/efm/recom_efm.pyx":394 * for tup_id in sentiment_tup_ids_by_user.values(): * for aid, _, sentiment_polarity in sentiment.sentiment[tup_id]: * total_sentiment_by_aspect[aid] = total_sentiment_by_aspect.get(aid, 0) + sentiment_polarity # <<<<<<<<<<<<<< * for aid, total_sentiment in total_sentiment_by_aspect.items(): * map_iid.append(iid) */ - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_total_sentiment_by_aspect, __pyx_n_s_get); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_total_sentiment_by_aspect, __pyx_n_s_get); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_8 = NULL; __pyx_t_18 = 0; @@ -26932,7 +26927,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_20)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_aid, __pyx_int_0}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -26940,13 +26935,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_aid, __pyx_int_0}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -26957,18 +26952,18 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_18, __pyx_int_0); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = PyNumber_Add(__pyx_t_2, __pyx_v_sentiment_polarity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_20 = PyNumber_Add(__pyx_t_2, __pyx_v_sentiment_polarity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_total_sentiment_by_aspect, __pyx_v_aid, __pyx_t_20) < 0)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_total_sentiment_by_aspect, __pyx_v_aid, __pyx_t_20) < 0)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - /* "cornac/models/efm/recom_efm.pyx":390 + /* "cornac/models/efm/recom_efm.pyx":393 * total_sentiment_by_aspect = OrderedDict() * for tup_id in sentiment_tup_ids_by_user.values(): * for aid, _, sentiment_polarity in sentiment.sentiment[tup_id]: # <<<<<<<<<<<<<< @@ -26980,7 +26975,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":392 + /* "cornac/models/efm/recom_efm.pyx":395 * for aid, _, sentiment_polarity in sentiment.sentiment[tup_id]: * total_sentiment_by_aspect[aid] = total_sentiment_by_aspect.get(aid, 0) + sentiment_polarity * for aid, total_sentiment in total_sentiment_by_aspect.items(): # <<<<<<<<<<<<<< @@ -26990,9 +26985,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_t_16 = 0; if (unlikely(__pyx_v_total_sentiment_by_aspect == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 392, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_total_sentiment_by_aspect, 0, __pyx_n_s_items, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_total_sentiment_by_aspect, 0, __pyx_n_s_items, (&__pyx_t_17), (&__pyx_t_15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; @@ -27000,7 +26995,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_17, &__pyx_t_16, &__pyx_t_6, &__pyx_t_20, NULL, __pyx_t_15); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 392, __pyx_L1_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_20); __Pyx_XDECREF_SET(__pyx_v_aid, __pyx_t_6); @@ -27008,45 +27003,45 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_XDECREF_SET(__pyx_v_total_sentiment, __pyx_t_20); __pyx_t_20 = 0; - /* "cornac/models/efm/recom_efm.pyx":393 + /* "cornac/models/efm/recom_efm.pyx":396 * total_sentiment_by_aspect[aid] = total_sentiment_by_aspect.get(aid, 0) + sentiment_polarity * for aid, total_sentiment in total_sentiment_by_aspect.items(): * map_iid.append(iid) # <<<<<<<<<<<<<< * map_aspect_id.append(aid) * if self.use_item_aspect_popularity: */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_iid, __pyx_v_iid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_iid, __pyx_v_iid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 396, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":394 + /* "cornac/models/efm/recom_efm.pyx":397 * for aid, total_sentiment in total_sentiment_by_aspect.items(): * map_iid.append(iid) * map_aspect_id.append(aid) # <<<<<<<<<<<<<< * if self.use_item_aspect_popularity: * quality_scores.append(self._compute_quality_score(total_sentiment)) */ - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_aspect_id, __pyx_v_aid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_map_aspect_id, __pyx_v_aid); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 397, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":395 + /* "cornac/models/efm/recom_efm.pyx":398 * map_iid.append(iid) * map_aspect_id.append(aid) * if self.use_item_aspect_popularity: # <<<<<<<<<<<<<< * quality_scores.append(self._compute_quality_score(total_sentiment)) * else: */ - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_use_item_aspect_popularity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_use_item_aspect_popularity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (__pyx_t_10) { - /* "cornac/models/efm/recom_efm.pyx":396 + /* "cornac/models/efm/recom_efm.pyx":399 * map_aspect_id.append(aid) * if self.use_item_aspect_popularity: * quality_scores.append(self._compute_quality_score(total_sentiment)) # <<<<<<<<<<<<<< * else: * avg_sentiment = total_sentiment / item_aspect_count[aid] */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_quality_score); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_quality_score); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -27060,13 +27055,13 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_20 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_total_sentiment) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_total_sentiment); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_quality_scores, __pyx_t_20); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_quality_scores, __pyx_t_20); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - /* "cornac/models/efm/recom_efm.pyx":395 + /* "cornac/models/efm/recom_efm.pyx":398 * map_iid.append(iid) * map_aspect_id.append(aid) * if self.use_item_aspect_popularity: # <<<<<<<<<<<<<< @@ -27076,7 +27071,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( goto __pyx_L42; } - /* "cornac/models/efm/recom_efm.pyx":398 + /* "cornac/models/efm/recom_efm.pyx":401 * quality_scores.append(self._compute_quality_score(total_sentiment)) * else: * avg_sentiment = total_sentiment / item_aspect_count[aid] # <<<<<<<<<<<<<< @@ -27084,22 +27079,22 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * */ /*else*/ { - __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_v_item_aspect_count, __pyx_v_aid); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_v_item_aspect_count, __pyx_v_aid); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_total_sentiment, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_total_sentiment, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF_SET(__pyx_v_avg_sentiment, __pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":399 + /* "cornac/models/efm/recom_efm.pyx":402 * else: * avg_sentiment = total_sentiment / item_aspect_count[aid] * quality_scores.append(self._compute_quality_score(avg_sentiment)) # <<<<<<<<<<<<<< * * quality_scores = np.asarray(quality_scores, dtype=np.float).flatten() */ - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_quality_score); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compute_quality_score); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { @@ -27113,10 +27108,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_2, __pyx_v_avg_sentiment) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_avg_sentiment); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_quality_scores, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_quality_scores, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L42:; @@ -27126,38 +27121,38 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":401 + /* "cornac/models/efm/recom_efm.pyx":404 * quality_scores.append(self._compute_quality_score(avg_sentiment)) * * quality_scores = np.asarray(quality_scores, dtype=np.float).flatten() # <<<<<<<<<<<<<< * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_quality_scores); __Pyx_GIVEREF(__pyx_v_quality_scores); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_quality_scores); - __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flatten); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flatten); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -27172,44 +27167,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF_SET(__pyx_v_quality_scores, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":402 + /* "cornac/models/efm/recom_efm.pyx":405 * * quality_scores = np.asarray(quality_scores, dtype=np.float).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() # <<<<<<<<<<<<<< * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * Y = sp.csr_matrix((quality_scores, (map_iid, map_aspect_id)), */ - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_INCREF(__pyx_v_map_iid); __Pyx_GIVEREF(__pyx_v_map_iid); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_map_iid); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -27224,44 +27219,44 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_map_iid, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":403 + /* "cornac/models/efm/recom_efm.pyx":406 * quality_scores = np.asarray(quality_scores, dtype=np.float).flatten() * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() # <<<<<<<<<<<<<< * Y = sp.csr_matrix((quality_scores, (map_iid, map_aspect_id)), * shape=(self.train_set.num_items, sentiment.num_aspects)) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __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, 403, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_map_aspect_id); __Pyx_GIVEREF(__pyx_v_map_aspect_id); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_map_aspect_id); - __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 403, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_20); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -27276,25 +27271,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF_SET(__pyx_v_map_aspect_id, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":404 + /* "cornac/models/efm/recom_efm.pyx":407 * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * Y = sp.csr_matrix((quality_scores, (map_iid, map_aspect_id)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_items, sentiment.num_aspects)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_map_iid); __Pyx_GIVEREF(__pyx_v_map_iid); @@ -27302,7 +27297,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_INCREF(__pyx_v_map_aspect_id); __Pyx_GIVEREF(__pyx_v_map_aspect_id); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_map_aspect_id); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_quality_scores); __Pyx_GIVEREF(__pyx_v_quality_scores); @@ -27310,29 +27305,29 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":405 + /* "cornac/models/efm/recom_efm.pyx":408 * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * Y = sp.csr_matrix((quality_scores, (map_iid, map_aspect_id)), * shape=(self.train_set.num_items, sentiment.num_aspects)) # <<<<<<<<<<<<<< * * if self.verbose: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sentiment, __pyx_n_s_num_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); @@ -27340,17 +27335,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 405, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":404 + /* "cornac/models/efm/recom_efm.pyx":407 * map_iid = np.asarray(map_iid, dtype=np.int).flatten() * map_aspect_id = np.asarray(map_aspect_id, dtype=np.int).flatten() * Y = sp.csr_matrix((quality_scores, (map_iid, map_aspect_id)), # <<<<<<<<<<<<<< * shape=(self.train_set.num_items, sentiment.num_aspects)) * */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27358,31 +27353,31 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_v_Y = __pyx_t_7; __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":407 + /* "cornac/models/efm/recom_efm.pyx":410 * shape=(self.train_set.num_items, sentiment.num_aspects)) * * if self.verbose: # <<<<<<<<<<<<<< * print('Building matrices completed!') * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_verbose); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_10) { - /* "cornac/models/efm/recom_efm.pyx":408 + /* "cornac/models/efm/recom_efm.pyx":411 * * if self.verbose: * print('Building matrices completed!') # <<<<<<<<<<<<<< * * return A, X, Y */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cornac/models/efm/recom_efm.pyx":407 + /* "cornac/models/efm/recom_efm.pyx":410 * shape=(self.train_set.num_items, sentiment.num_aspects)) * * if self.verbose: # <<<<<<<<<<<<<< @@ -27391,7 +27386,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( */ } - /* "cornac/models/efm/recom_efm.pyx":410 + /* "cornac/models/efm/recom_efm.pyx":413 * print('Building matrices completed!') * * return A, X, Y # <<<<<<<<<<<<<< @@ -27399,7 +27394,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( * def _compute_attention_score(self, count): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_A); __Pyx_GIVEREF(__pyx_v_A); @@ -27414,7 +27409,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( __pyx_t_7 = 0; goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":339 + /* "cornac/models/efm/recom_efm.pyx":342 * print('Optimization finished!') * * def _build_matrices(self, data_set): # <<<<<<<<<<<<<< @@ -27471,7 +27466,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_8_build_matrices( return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":412 +/* "cornac/models/efm/recom_efm.pyx":415 * return A, X, Y * * def _compute_attention_score(self, count): # <<<<<<<<<<<<<< @@ -27511,11 +27506,11 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_11_compute_attent case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_compute_attention_score", 1, 2, 2, 1); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_compute_attention_score", 1, 2, 2, 1); __PYX_ERR(0, 415, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_compute_attention_score") < 0)) __PYX_ERR(0, 412, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_compute_attention_score") < 0)) __PYX_ERR(0, 415, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27528,7 +27523,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_11_compute_attent } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_compute_attention_score", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 412, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_compute_attention_score", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 415, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._compute_attention_score", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27551,7 +27546,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_10_compute_attent PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_compute_attention_score", 0); - /* "cornac/models/efm/recom_efm.pyx":413 + /* "cornac/models/efm/recom_efm.pyx":416 * * def _compute_attention_score(self, count): * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) # <<<<<<<<<<<<<< @@ -27559,17 +27554,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_10_compute_attent * def _compute_quality_score(self, sentiment): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Negative(__pyx_v_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_3 = PyNumber_Negative(__pyx_v_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -27584,30 +27579,30 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_10_compute_attent __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __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, 413, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":412 + /* "cornac/models/efm/recom_efm.pyx":415 * return A, X, Y * * def _compute_attention_score(self, count): # <<<<<<<<<<<<<< @@ -27630,7 +27625,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_10_compute_attent return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":415 +/* "cornac/models/efm/recom_efm.pyx":418 * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * * def _compute_quality_score(self, sentiment): # <<<<<<<<<<<<<< @@ -27670,11 +27665,11 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_13_compute_qualit case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sentiment)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_compute_quality_score", 1, 2, 2, 1); __PYX_ERR(0, 415, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_compute_quality_score", 1, 2, 2, 1); __PYX_ERR(0, 418, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_compute_quality_score") < 0)) __PYX_ERR(0, 415, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_compute_quality_score") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27687,7 +27682,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_13_compute_qualit } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_compute_quality_score", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 415, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_compute_quality_score", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM._compute_quality_score", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27710,7 +27705,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_12_compute_qualit PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_compute_quality_score", 0); - /* "cornac/models/efm/recom_efm.pyx":416 + /* "cornac/models/efm/recom_efm.pyx":419 * * def _compute_quality_score(self, sentiment): * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) # <<<<<<<<<<<<<< @@ -27718,17 +27713,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_12_compute_qualit * def score(self, user_idx, item_idx=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Negative(__pyx_v_sentiment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = PyNumber_Negative(__pyx_v_sentiment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -27743,24 +27738,24 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_12_compute_qualit __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __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, 416, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":415 + /* "cornac/models/efm/recom_efm.pyx":418 * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * * def _compute_quality_score(self, sentiment): # <<<<<<<<<<<<<< @@ -27783,7 +27778,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_12_compute_qualit return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":418 +/* "cornac/models/efm/recom_efm.pyx":421 * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * * def score(self, user_idx, item_idx=None): # <<<<<<<<<<<<<< @@ -27828,7 +27823,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_15score(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user_idx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("score", 0, 2, 3, 1); __PYX_ERR(0, 418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("score", 0, 2, 3, 1); __PYX_ERR(0, 421, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -27838,7 +27833,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_15score(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "score") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "score") < 0)) __PYX_ERR(0, 421, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -27856,7 +27851,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_15score(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("score", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("score", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM.score", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27886,7 +27881,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN Py_UCS4 __pyx_t_10; __Pyx_RefNannySetupContext("score", 0); - /* "cornac/models/efm/recom_efm.pyx":436 + /* "cornac/models/efm/recom_efm.pyx":439 * * """ * if item_idx is None: # <<<<<<<<<<<<<< @@ -27897,16 +27892,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cornac/models/efm/recom_efm.pyx":437 + /* "cornac/models/efm/recom_efm.pyx":440 * """ * if item_idx is None: * if self.train_set.is_unk_user(user_idx): # <<<<<<<<<<<<<< * raise ScoreException("Can't make score prediction for (user_id=%d" & user_idx) * item_scores = self.U2.dot(self.U1[user_idx, :]) + self.H2.dot(self.H1[user_idx, :]) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -27921,23 +27916,23 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_user_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_user_idx); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { - /* "cornac/models/efm/recom_efm.pyx":438 + /* "cornac/models/efm/recom_efm.pyx":441 * if item_idx is None: * if self.train_set.is_unk_user(user_idx): * raise ScoreException("Can't make score prediction for (user_id=%d" & user_idx) # <<<<<<<<<<<<<< * item_scores = self.U2.dot(self.U1[user_idx, :]) + self.H2.dot(self.H1[user_idx, :]) * return item_scores */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ScoreException); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ScoreException); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_And(__pyx_kp_u_Can_t_make_score_prediction_for, __pyx_v_user_idx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_4 = PyNumber_And(__pyx_kp_u_Can_t_make_score_prediction_for, __pyx_v_user_idx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -27952,14 +27947,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 438, __pyx_L1_error) + __PYX_ERR(0, 441, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":437 + /* "cornac/models/efm/recom_efm.pyx":440 * """ * if item_idx is None: * if self.train_set.is_unk_user(user_idx): # <<<<<<<<<<<<<< @@ -27968,21 +27963,21 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN */ } - /* "cornac/models/efm/recom_efm.pyx":439 + /* "cornac/models/efm/recom_efm.pyx":442 * if self.train_set.is_unk_user(user_idx): * raise ScoreException("Can't make score prediction for (user_id=%d" & user_idx) * item_scores = self.U2.dot(self.U1[user_idx, :]) + self.H2.dot(self.H1[user_idx, :]) # <<<<<<<<<<<<<< * return item_scores * else: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __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_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_user_idx); __Pyx_GIVEREF(__pyx_v_user_idx); @@ -27990,7 +27985,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__7); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -28007,17 +28002,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_user_idx); __Pyx_GIVEREF(__pyx_v_user_idx); @@ -28025,7 +28020,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__7); - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -28042,17 +28037,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_item_scores = __pyx_t_6; __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":440 + /* "cornac/models/efm/recom_efm.pyx":443 * raise ScoreException("Can't make score prediction for (user_id=%d" & user_idx) * item_scores = self.U2.dot(self.U1[user_idx, :]) + self.H2.dot(self.H1[user_idx, :]) * return item_scores # <<<<<<<<<<<<<< @@ -28064,7 +28059,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_r = __pyx_v_item_scores; goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":436 + /* "cornac/models/efm/recom_efm.pyx":439 * * """ * if item_idx is None: # <<<<<<<<<<<<<< @@ -28073,7 +28068,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN */ } - /* "cornac/models/efm/recom_efm.pyx":442 + /* "cornac/models/efm/recom_efm.pyx":445 * return item_scores * else: * if self.train_set.is_unk_user(user_idx) or self.train_set.is_unk_item(item_idx): # <<<<<<<<<<<<<< @@ -28081,9 +28076,9 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN * item_score = self.U2[item_idx, :].dot(self.U1[user_idx, :]) + self.H2[item_idx, :].dot(self.H1[user_idx, :]) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_unk_user); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -28098,19 +28093,19 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN } __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_user_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_user_idx); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_unk_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -28125,25 +28120,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_item_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_item_idx); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_2)) { - /* "cornac/models/efm/recom_efm.pyx":443 + /* "cornac/models/efm/recom_efm.pyx":446 * else: * if self.train_set.is_unk_user(user_idx) or self.train_set.is_unk_item(item_idx): * raise ScoreException("Can't make score prediction for (user_id=%d, item_id=%d)" % (user_idx, item_idx)) # <<<<<<<<<<<<<< * item_score = self.U2[item_idx, :].dot(self.U1[user_idx, :]) + self.H2[item_idx, :].dot(self.H1[user_idx, :]) * return item_score */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ScoreException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ScoreException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_10 = 127; @@ -28151,7 +28146,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_9 += 41; __Pyx_GIVEREF(__pyx_kp_u_Can_t_make_score_prediction_for_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Can_t_make_score_prediction_for_2); - __pyx_t_8 = __Pyx_PyObject_Format(__pyx_v_user_idx, __pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Format(__pyx_v_user_idx, __pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_10; __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); @@ -28162,7 +28157,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_9 += 10; __Pyx_GIVEREF(__pyx_kp_u_item_id); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_item_id); - __pyx_t_8 = __Pyx_PyObject_Format(__pyx_v_item_idx, __pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Format(__pyx_v_item_idx, __pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_10; __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); @@ -28173,7 +28168,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_9 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__8); - __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -28189,14 +28184,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 443, __pyx_L1_error) + __PYX_ERR(0, 446, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":442 + /* "cornac/models/efm/recom_efm.pyx":445 * return item_scores * else: * if self.train_set.is_unk_user(user_idx) or self.train_set.is_unk_item(item_idx): # <<<<<<<<<<<<<< @@ -28205,16 +28200,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN */ } - /* "cornac/models/efm/recom_efm.pyx":444 + /* "cornac/models/efm/recom_efm.pyx":447 * if self.train_set.is_unk_user(user_idx) or self.train_set.is_unk_item(item_idx): * raise ScoreException("Can't make score prediction for (user_id=%d, item_id=%d)" % (user_idx, item_idx)) * item_score = self.U2[item_idx, :].dot(self.U1[user_idx, :]) + self.H2[item_idx, :].dot(self.H1[user_idx, :]) # <<<<<<<<<<<<<< * return item_score * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_item_idx); __Pyx_GIVEREF(__pyx_v_item_idx); @@ -28222,16 +28217,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice__7); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_user_idx); __Pyx_GIVEREF(__pyx_v_user_idx); @@ -28239,7 +28234,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__7); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -28256,12 +28251,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_item_idx); __Pyx_GIVEREF(__pyx_v_item_idx); @@ -28269,16 +28264,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__7); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_H1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_user_idx); __Pyx_GIVEREF(__pyx_v_user_idx); @@ -28286,7 +28281,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__7); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -28303,17 +28298,17 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_item_score = __pyx_t_4; __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":445 + /* "cornac/models/efm/recom_efm.pyx":448 * raise ScoreException("Can't make score prediction for (user_id=%d, item_id=%d)" % (user_idx, item_idx)) * item_score = self.U2[item_idx, :].dot(self.U1[user_idx, :]) + self.H2[item_idx, :].dot(self.H1[user_idx, :]) * return item_score # <<<<<<<<<<<<<< @@ -28326,7 +28321,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN goto __pyx_L0; } - /* "cornac/models/efm/recom_efm.pyx":418 + /* "cornac/models/efm/recom_efm.pyx":421 * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * * def score(self, user_idx, item_idx=None): # <<<<<<<<<<<<<< @@ -28352,7 +28347,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_14score(CYTHON_UN return __pyx_r; } -/* "cornac/models/efm/recom_efm.pyx":447 +/* "cornac/models/efm/recom_efm.pyx":450 * return item_score * * def rank(self, user_idx, item_indices=None): # <<<<<<<<<<<<<< @@ -28397,7 +28392,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_17rank(PyObject * case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user_idx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rank", 0, 2, 3, 1); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rank", 0, 2, 3, 1); __PYX_ERR(0, 450, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -28407,7 +28402,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_17rank(PyObject * } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank") < 0)) __PYX_ERR(0, 447, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -28425,7 +28420,7 @@ static PyObject *__pyx_pw_6cornac_6models_3efm_9recom_efm_3EFM_17rank(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rank", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rank", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cornac.models.efm.recom_efm.EFM.rank", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -28458,16 +28453,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU int __pyx_t_7; __Pyx_RefNannySetupContext("rank", 0); - /* "cornac/models/efm/recom_efm.pyx":465 + /* "cornac/models/efm/recom_efm.pyx":468 * * """ * X_ = self.U1[user_idx, :].dot(self.V.T) # <<<<<<<<<<<<<< * most_cared_aspects_indices = (-X_).argsort()[:self.num_most_cared_aspects] * most_cared_X_ = X_[most_cared_aspects_indices] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_user_idx); __Pyx_GIVEREF(__pyx_v_user_idx); @@ -28475,16 +28470,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__7); - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __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; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -28500,22 +28495,22 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __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, 465, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_X_ = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":466 + /* "cornac/models/efm/recom_efm.pyx":469 * """ * X_ = self.U1[user_idx, :].dot(self.V.T) * most_cared_aspects_indices = (-X_).argsort()[:self.num_most_cared_aspects] # <<<<<<<<<<<<<< * most_cared_X_ = X_[most_cared_aspects_indices] * most_cared_Y_ = self.U2.dot(self.V[most_cared_aspects_indices, :].T) */ - __pyx_t_3 = PyNumber_Negative(__pyx_v_X_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_3 = PyNumber_Negative(__pyx_v_X_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -28530,45 +28525,45 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __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_self, __pyx_n_s_num_most_cared_aspects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_most_cared_aspects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_most_cared_aspects_indices = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":467 + /* "cornac/models/efm/recom_efm.pyx":470 * X_ = self.U1[user_idx, :].dot(self.V.T) * most_cared_aspects_indices = (-X_).argsort()[:self.num_most_cared_aspects] * most_cared_X_ = X_[most_cared_aspects_indices] # <<<<<<<<<<<<<< * most_cared_Y_ = self.U2.dot(self.V[most_cared_aspects_indices, :].T) * explicit_scores = most_cared_X_.dot(most_cared_Y_.T) / (self.num_most_cared_aspects * self.rating_scale) */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_X_, __pyx_v_most_cared_aspects_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_X_, __pyx_v_most_cared_aspects_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_most_cared_X_ = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":468 + /* "cornac/models/efm/recom_efm.pyx":471 * most_cared_aspects_indices = (-X_).argsort()[:self.num_most_cared_aspects] * most_cared_X_ = X_[most_cared_aspects_indices] * most_cared_Y_ = self.U2.dot(self.V[most_cared_aspects_indices, :].T) # <<<<<<<<<<<<<< * explicit_scores = most_cared_X_.dot(most_cared_Y_.T) / (self.num_most_cared_aspects * self.rating_scale) * item_scores = self.alpha * explicit_scores + (1 - self.alpha) * self.score(user_idx) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_U2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __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_self, __pyx_n_s_V); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_most_cared_aspects_indices); __Pyx_GIVEREF(__pyx_v_most_cared_aspects_indices); @@ -28576,11 +28571,11 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __Pyx_INCREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__7); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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, 468, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -28596,22 +28591,22 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_most_cared_Y_ = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":469 + /* "cornac/models/efm/recom_efm.pyx":472 * most_cared_X_ = X_[most_cared_aspects_indices] * most_cared_Y_ = self.U2.dot(self.V[most_cared_aspects_indices, :].T) * explicit_scores = most_cared_X_.dot(most_cared_Y_.T) / (self.num_most_cared_aspects * self.rating_scale) # <<<<<<<<<<<<<< * item_scores = self.alpha * explicit_scores + (1 - self.alpha) * self.score(user_idx) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_most_cared_X_, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_most_cared_X_, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_most_cared_Y_, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_most_cared_Y_, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -28626,42 +28621,42 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_most_cared_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_most_cared_aspects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rating_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_explicit_scores = __pyx_t_4; __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":470 + /* "cornac/models/efm/recom_efm.pyx":473 * most_cared_Y_ = self.U2.dot(self.V[most_cared_aspects_indices, :].T) * explicit_scores = most_cared_X_.dot(most_cared_Y_.T) / (self.num_most_cared_aspects * self.rating_scale) * item_scores = self.alpha * explicit_scores + (1 - self.alpha) * self.score(user_idx) # <<<<<<<<<<<<<< * * if item_indices is None: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_explicit_scores); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_explicit_scores); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -28675,21 +28670,21 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_user_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_user_idx); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_item_scores = __pyx_t_4; __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":472 + /* "cornac/models/efm/recom_efm.pyx":475 * item_scores = self.alpha * explicit_scores + (1 - self.alpha) * self.score(user_idx) * * if item_indices is None: # <<<<<<<<<<<<<< @@ -28700,7 +28695,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "cornac/models/efm/recom_efm.pyx":473 + /* "cornac/models/efm/recom_efm.pyx":476 * * if item_indices is None: * item_scores = item_scores # <<<<<<<<<<<<<< @@ -28710,14 +28705,14 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __Pyx_INCREF(__pyx_v_item_scores); __Pyx_DECREF_SET(__pyx_v_item_scores, __pyx_v_item_scores); - /* "cornac/models/efm/recom_efm.pyx":474 + /* "cornac/models/efm/recom_efm.pyx":477 * if item_indices is None: * item_scores = item_scores * item_rank = item_scores.argsort()[::-1] # <<<<<<<<<<<<<< * else: * num_items = max(self.train_set.num_items, max(item_indices) + 1) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item_scores, __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item_scores, __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -28731,16 +28726,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_slice__9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_slice__9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_item_rank = __pyx_t_1; __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":472 + /* "cornac/models/efm/recom_efm.pyx":475 * item_scores = self.alpha * explicit_scores + (1 - self.alpha) * self.score(user_idx) * * if item_indices is None: # <<<<<<<<<<<<<< @@ -28750,7 +28745,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU goto __pyx_L3; } - /* "cornac/models/efm/recom_efm.pyx":476 + /* "cornac/models/efm/recom_efm.pyx":479 * item_rank = item_scores.argsort()[::-1] * else: * num_items = max(self.train_set.num_items, max(item_indices) + 1) # <<<<<<<<<<<<<< @@ -28758,18 +28753,18 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU * item_scores[:self.train_set.num_items] = item_scores */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_item_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_item_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__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(0, 476, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_num_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { __Pyx_INCREF(__pyx_t_4); @@ -28786,16 +28781,16 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_v_num_items = __pyx_t_4; __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":477 + /* "cornac/models/efm/recom_efm.pyx":480 * else: * num_items = max(self.train_set.num_items, max(item_indices) + 1) * item_scores = np.ones(num_items) * np.min(item_scores) # <<<<<<<<<<<<<< * item_scores[:self.train_set.num_items] = item_scores * item_rank = item_scores.argsort()[::-1] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -28810,12 +28805,12 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_num_items) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_num_items); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -28830,39 +28825,39 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_item_scores) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item_scores); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_item_scores, __pyx_t_3); __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":478 + /* "cornac/models/efm/recom_efm.pyx":481 * num_items = max(self.train_set.num_items, max(item_indices) + 1) * item_scores = np.ones(num_items) * np.min(item_scores) * item_scores[:self.train_set.num_items] = item_scores # <<<<<<<<<<<<<< * item_rank = item_scores.argsort()[::-1] * item_rank = intersects(item_rank, item_indices, assume_unique=True) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_train_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_num_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetSlice(__pyx_v_item_scores, __pyx_v_item_scores, 0, 0, NULL, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 478, __pyx_L1_error) + if (__Pyx_PyObject_SetSlice(__pyx_v_item_scores, __pyx_v_item_scores, 0, 0, NULL, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":479 + /* "cornac/models/efm/recom_efm.pyx":482 * item_scores = np.ones(num_items) * np.min(item_scores) * item_scores[:self.train_set.num_items] = item_scores * item_rank = item_scores.argsort()[::-1] # <<<<<<<<<<<<<< * item_rank = intersects(item_rank, item_indices, assume_unique=True) * item_scores = item_scores[item_indices] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item_scores, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item_scores, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -28876,25 +28871,25 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_slice__9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_slice__9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_item_rank = __pyx_t_3; __pyx_t_3 = 0; - /* "cornac/models/efm/recom_efm.pyx":480 + /* "cornac/models/efm/recom_efm.pyx":483 * item_scores[:self.train_set.num_items] = item_scores * item_rank = item_scores.argsort()[::-1] * item_rank = intersects(item_rank, item_indices, assume_unique=True) # <<<<<<<<<<<<<< * item_scores = item_scores[item_indices] * return item_rank, item_scores */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_intersects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_intersects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_item_rank); __Pyx_GIVEREF(__pyx_v_item_rank); @@ -28902,10 +28897,10 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __Pyx_INCREF(__pyx_v_item_indices); __Pyx_GIVEREF(__pyx_v_item_indices); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_item_indices); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assume_unique, Py_True) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assume_unique, Py_True) < 0) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -28913,26 +28908,26 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __Pyx_DECREF_SET(__pyx_v_item_rank, __pyx_t_1); __pyx_t_1 = 0; - /* "cornac/models/efm/recom_efm.pyx":481 + /* "cornac/models/efm/recom_efm.pyx":484 * item_rank = item_scores.argsort()[::-1] * item_rank = intersects(item_rank, item_indices, assume_unique=True) * item_scores = item_scores[item_indices] # <<<<<<<<<<<<<< * return item_rank, item_scores */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_item_scores, __pyx_v_item_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_item_scores, __pyx_v_item_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_item_scores, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; - /* "cornac/models/efm/recom_efm.pyx":482 + /* "cornac/models/efm/recom_efm.pyx":485 * item_rank = intersects(item_rank, item_indices, assume_unique=True) * item_scores = item_scores[item_indices] * return item_rank, item_scores # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_item_rank); __Pyx_GIVEREF(__pyx_v_item_rank); @@ -28944,7 +28939,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU __pyx_t_1 = 0; goto __pyx_L0; - /* "cornac/models/efm/recom_efm.pyx":447 + /* "cornac/models/efm/recom_efm.pyx":450 * return item_score * * def rank(self, user_idx, item_indices=None): # <<<<<<<<<<<<<< @@ -28975,7 +28970,7 @@ static PyObject *__pyx_pf_6cornac_6models_3efm_9recom_efm_3EFM_16rank(CYTHON_UNU return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -29024,7 +29019,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -29033,7 +29028,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -29042,7 +29037,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -29051,7 +29046,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29065,7 +29060,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -29076,7 +29071,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29085,7 +29080,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -29098,7 +29093,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 272, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29107,7 +29102,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29121,7 +29116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -29132,7 +29127,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29141,7 +29136,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -29154,7 +29149,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 276, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -29163,7 +29158,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -29172,7 +29167,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -29181,7 +29176,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -29191,7 +29186,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -29200,7 +29195,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -29209,7 +29204,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -29221,7 +29216,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -29230,7 +29225,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -29240,7 +29235,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -29250,7 +29245,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -29260,7 +29255,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -29271,7 +29266,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -29280,7 +29275,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -29289,7 +29284,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -29298,7 +29293,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -29307,7 +29302,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * cdef int t * cdef char* f = NULL * cdef dtype descr = PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -29320,7 +29315,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -29333,7 +29328,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -29343,7 +29338,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -29353,7 +29348,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -29373,7 +29368,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -29390,7 +29385,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -29399,7 +29394,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -29412,7 +29407,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 306, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -29421,7 +29416,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -29434,7 +29429,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UBYTE: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -29445,7 +29440,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_SHORT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -29456,7 +29451,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_USHORT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -29467,7 +29462,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_INT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -29478,7 +29473,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UINT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -29489,7 +29484,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONG: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -29500,7 +29495,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONG: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -29511,7 +29506,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGLONG: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -29522,7 +29517,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONGLONG: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -29533,7 +29528,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_FLOAT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -29544,7 +29539,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_DOUBLE: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -29555,7 +29550,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGDOUBLE: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -29566,7 +29561,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CFLOAT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -29577,7 +29572,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CDOUBLE: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -29588,7 +29583,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CLONGDOUBLE: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -29599,7 +29594,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_OBJECT: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -29610,7 +29605,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -29631,7 +29626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -29640,7 +29635,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -29650,7 +29645,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -29659,7 +29654,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -29669,7 +29664,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -29678,7 +29673,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -29687,7 +29682,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -29697,7 +29692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error) __pyx_v_f = __pyx_t_9; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -29707,7 +29702,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -29739,7 +29734,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -29763,7 +29758,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -29773,7 +29768,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -29782,7 +29777,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -29791,7 +29786,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -29801,7 +29796,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -29810,7 +29805,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -29819,7 +29814,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -29831,7 +29826,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -29845,7 +29840,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -29859,7 +29854,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -29878,7 +29873,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -29892,7 +29887,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -29906,7 +29901,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -29925,7 +29920,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -29939,7 +29934,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -29953,7 +29948,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -29972,7 +29967,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -29986,7 +29981,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -30000,7 +29995,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -30019,7 +30014,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -30033,7 +30028,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -30047,7 +30042,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -30066,7 +30061,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -30080,7 +30075,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -30090,7 +30085,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -30102,7 +30097,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -30111,7 +30106,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -30125,7 +30120,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -30140,7 +30135,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -30169,7 +30164,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -30178,7 +30173,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -30187,7 +30182,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -30210,7 +30205,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -30227,7 +30222,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -30262,7 +30257,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -30279,7 +30274,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -30292,7 +30287,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 856, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -30301,7 +30296,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -30321,7 +30316,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -30338,7 +30333,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -30347,7 +30342,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -30360,7 +30355,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 860, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -30369,7 +30364,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -30385,7 +30380,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -30394,7 +30389,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -30403,7 +30398,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -30414,7 +30409,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -30424,7 +30419,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -30434,7 +30429,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -30446,7 +30441,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -30456,7 +30451,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -30469,7 +30464,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 880, __pyx_L1_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -30478,7 +30473,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -30496,7 +30491,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -30514,7 +30509,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -30532,7 +30527,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -30550,7 +30545,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -30568,7 +30563,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -30586,7 +30581,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -30604,7 +30599,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -30622,7 +30617,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -30640,7 +30635,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -30658,7 +30653,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -30676,7 +30671,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -30694,7 +30689,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -30712,7 +30707,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -30732,7 +30727,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -30752,7 +30747,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -30772,7 +30767,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -30790,7 +30785,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -30809,7 +30804,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -30818,7 +30813,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -30828,7 +30823,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -30841,7 +30836,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -30851,7 +30846,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -30861,7 +30856,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -30886,7 +30881,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -30898,7 +30893,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -30907,7 +30902,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024 * 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) # <<<<<<<<<<<<<< @@ -30916,7 +30911,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -30928,7 +30923,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -30943,7 +30938,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -30952,7 +30947,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -30962,7 +30957,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -30973,7 +30968,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -30982,7 +30977,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -30994,7 +30989,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -31009,7 +31004,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -31030,7 +31025,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31046,7 +31041,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -31055,7 +31050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31069,7 +31064,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -31084,7 +31079,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -31100,7 +31095,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31115,7 +31110,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -31138,7 +31133,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -31159,7 +31154,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31175,7 +31170,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -31184,7 +31179,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31198,7 +31193,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -31213,7 +31208,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -31229,7 +31224,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31244,7 +31239,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -31267,7 +31262,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 +/* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -31288,7 +31283,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -31304,7 +31299,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -31313,7 +31308,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error) - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -31327,7 +31322,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -31341,7 +31336,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -31355,7 +31350,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -31370,7 +31365,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -34150,7 +34145,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) - * elif (<__pyx_buffer *> &self.view).obj == Py_None: + * */ __pyx_t_1 = (__pyx_v_self->obj != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); @@ -34160,8 +34155,8 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< - * elif (<__pyx_buffer *> &self.view).obj == Py_None: * + * cdef int i */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); @@ -34170,50 +34165,11 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) - * elif (<__pyx_buffer *> &self.view).obj == Py_None: - */ - goto __pyx_L3; - } - - /* "View.MemoryView":375 - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) - * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * - * (<__pyx_buffer *> &self.view).obj = NULL - */ - __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); - if (__pyx_t_2) { - - /* "View.MemoryView":377 - * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * - * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< - * Py_DECREF(Py_None) - * - */ - ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; - - /* "View.MemoryView":378 - * - * (<__pyx_buffer *> &self.view).obj = NULL - * Py_DECREF(Py_None) # <<<<<<<<<<<<<< - * - * cdef int i - */ - Py_DECREF(Py_None); - - /* "View.MemoryView":375 - * if self.obj is not None: - * __Pyx_ReleaseBuffer(&self.view) - * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< * - * (<__pyx_buffer *> &self.view).obj = NULL */ } - __pyx_L3:; - /* "View.MemoryView":382 + /* "View.MemoryView":378 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -34223,7 +34179,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":383 + /* "View.MemoryView":379 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< @@ -34235,7 +34191,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":384 + /* "View.MemoryView":380 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -34245,7 +34201,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); if (__pyx_t_2) { - /* "View.MemoryView":385 + /* "View.MemoryView":381 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< @@ -34254,7 +34210,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* "View.MemoryView":386 + /* "View.MemoryView":382 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -34264,7 +34220,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); if (__pyx_t_2) { - /* "View.MemoryView":388 + /* "View.MemoryView":384 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< @@ -34274,7 +34230,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":387 + /* "View.MemoryView":383 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< @@ -34284,7 +34240,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; - /* "View.MemoryView":386 + /* "View.MemoryView":382 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -34293,7 +34249,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":389 + /* "View.MemoryView":385 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< @@ -34302,7 +34258,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ goto __pyx_L6_break; - /* "View.MemoryView":384 + /* "View.MemoryView":380 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -34313,7 +34269,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } /*else*/ { - /* "View.MemoryView":391 + /* "View.MemoryView":387 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< @@ -34324,7 +34280,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L6_break:; - /* "View.MemoryView":382 + /* "View.MemoryView":378 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -34345,7 +34301,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":393 +/* "View.MemoryView":389 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -34368,7 +34324,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py char *__pyx_t_7; __Pyx_RefNannySetupContext("get_item_pointer", 0); - /* "View.MemoryView":395 + /* "View.MemoryView":391 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< @@ -34377,7 +34333,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":397 + /* "View.MemoryView":393 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -34389,26 +34345,26 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 393, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 393, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 393, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -34418,7 +34374,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 397, __pyx_L1_error) + else __PYX_ERR(2, 393, __pyx_L1_error) } break; } @@ -34429,18 +34385,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - /* "View.MemoryView":398 + /* "View.MemoryView":394 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 394, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 394, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; - /* "View.MemoryView":397 + /* "View.MemoryView":393 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -34450,7 +34406,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":400 + /* "View.MemoryView":396 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< @@ -34460,7 +34416,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":393 + /* "View.MemoryView":389 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -34480,7 +34436,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py return __pyx_r; } -/* "View.MemoryView":403 +/* "View.MemoryView":399 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -34515,7 +34471,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ char *__pyx_t_6; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":404 + /* "View.MemoryView":400 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -34526,7 +34482,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":405 + /* "View.MemoryView":401 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< @@ -34538,7 +34494,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "View.MemoryView":404 + /* "View.MemoryView":400 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -34547,14 +34503,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":407 + /* "View.MemoryView":403 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -34562,7 +34518,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 407, __pyx_L1_error) + __PYX_ERR(2, 403, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -34570,31 +34526,31 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 403, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_indices = __pyx_t_5; __pyx_t_5 = 0; - /* "View.MemoryView":410 + /* "View.MemoryView":406 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 406, __pyx_L1_error) if (__pyx_t_2) { - /* "View.MemoryView":411 + /* "View.MemoryView":407 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< @@ -34602,13 +34558,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":410 + /* "View.MemoryView":406 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< @@ -34617,7 +34573,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":413 + /* "View.MemoryView":409 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< @@ -34625,10 +34581,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 409, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; - /* "View.MemoryView":414 + /* "View.MemoryView":410 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< @@ -34636,14 +34592,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":403 + /* "View.MemoryView":399 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -34666,7 +34622,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ return __pyx_r; } -/* "View.MemoryView":416 +/* "View.MemoryView":412 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -34699,7 +34655,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":417 + /* "View.MemoryView":413 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -34709,20 +34665,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":418 + /* "View.MemoryView":414 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 418, __pyx_L1_error) + __PYX_ERR(2, 414, __pyx_L1_error) - /* "View.MemoryView":417 + /* "View.MemoryView":413 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -34731,14 +34687,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit */ } - /* "View.MemoryView":420 + /* "View.MemoryView":416 * raise TypeError("Cannot assign to read-only memoryview") * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ - __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; @@ -34746,7 +34702,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 420, __pyx_L1_error) + __PYX_ERR(2, 416, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -34754,67 +34710,67 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 416, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":422 + /* "View.MemoryView":418 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 418, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":423 + /* "View.MemoryView":419 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_obj = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":420 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 420, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":425 + /* "View.MemoryView":421 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 421, __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; - /* "View.MemoryView":424 + /* "View.MemoryView":420 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< @@ -34824,7 +34780,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L5; } - /* "View.MemoryView":427 + /* "View.MemoryView":423 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< @@ -34832,17 +34788,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 423, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __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; } __pyx_L5:; - /* "View.MemoryView":422 + /* "View.MemoryView":418 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< @@ -34852,7 +34808,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L4; } - /* "View.MemoryView":429 + /* "View.MemoryView":425 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< @@ -34860,13 +34816,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; - /* "View.MemoryView":416 + /* "View.MemoryView":412 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -34891,7 +34847,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit return __pyx_r; } -/* "View.MemoryView":431 +/* "View.MemoryView":427 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -34914,7 +34870,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); - /* "View.MemoryView":432 + /* "View.MemoryView":428 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -34925,7 +34881,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":433 + /* "View.MemoryView":429 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -34941,34 +34897,34 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "View.MemoryView":434 + /* "View.MemoryView":430 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 430, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":435 + /* "View.MemoryView":431 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 431, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":434 + /* "View.MemoryView":430 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 430, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -34979,13 +34935,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 430, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":433 + /* "View.MemoryView":429 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -35002,7 +34958,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "View.MemoryView":436 + /* "View.MemoryView":432 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< @@ -35012,12 +34968,12 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 432, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":437 + /* "View.MemoryView":433 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< @@ -35034,7 +34990,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "View.MemoryView":433 + /* "View.MemoryView":429 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -35055,7 +35011,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_L9_try_end:; } - /* "View.MemoryView":432 + /* "View.MemoryView":428 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -35064,7 +35020,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ */ } - /* "View.MemoryView":439 + /* "View.MemoryView":435 * return None * * return obj # <<<<<<<<<<<<<< @@ -35076,7 +35032,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "View.MemoryView":431 + /* "View.MemoryView":427 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -35098,7 +35054,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ return __pyx_r; } -/* "View.MemoryView":441 +/* "View.MemoryView":437 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -35117,50 +35073,50 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi int __pyx_t_4; __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); - /* "View.MemoryView":445 + /* "View.MemoryView":441 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 441, __pyx_L1_error) - /* "View.MemoryView":446 + /* "View.MemoryView":442 * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) * */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 442, __pyx_L1_error) - /* "View.MemoryView":447 + /* "View.MemoryView":443 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 443, __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(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":445 + /* "View.MemoryView":441 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error) + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 441, __pyx_L1_error) - /* "View.MemoryView":441 + /* "View.MemoryView":437 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -35181,7 +35137,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi return __pyx_r; } -/* "View.MemoryView":449 +/* "View.MemoryView":445 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -35210,7 +35166,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); - /* "View.MemoryView":451 + /* "View.MemoryView":447 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< @@ -35219,7 +35175,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = NULL; - /* "View.MemoryView":456 + /* "View.MemoryView":452 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< @@ -35228,7 +35184,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); - /* "View.MemoryView":458 + /* "View.MemoryView":454 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -35238,7 +35194,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); if (__pyx_t_1) { - /* "View.MemoryView":459 + /* "View.MemoryView":455 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< @@ -35247,7 +35203,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":460 + /* "View.MemoryView":456 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -35257,16 +35213,16 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":461 + /* "View.MemoryView":457 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 457, __pyx_L1_error) - /* "View.MemoryView":460 + /* "View.MemoryView":456 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -35275,7 +35231,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":462 + /* "View.MemoryView":458 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< @@ -35284,7 +35240,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":458 + /* "View.MemoryView":454 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -35294,7 +35250,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L3; } - /* "View.MemoryView":464 + /* "View.MemoryView":460 * item = tmp * else: * item = array # <<<<<<<<<<<<<< @@ -35306,7 +35262,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor } __pyx_L3:; - /* "View.MemoryView":466 + /* "View.MemoryView":462 * item = array * * try: # <<<<<<<<<<<<<< @@ -35315,7 +35271,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ /*try:*/ { - /* "View.MemoryView":467 + /* "View.MemoryView":463 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -35325,7 +35281,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":468 + /* "View.MemoryView":464 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< @@ -35334,7 +35290,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":467 + /* "View.MemoryView":463 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -35344,7 +35300,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L8; } - /* "View.MemoryView":470 + /* "View.MemoryView":466 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< @@ -35352,13 +35308,13 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 470, __pyx_L6_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 466, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L8:; - /* "View.MemoryView":474 + /* "View.MemoryView":470 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -35368,18 +35324,18 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":475 + /* "View.MemoryView":471 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ - __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 475, __pyx_L6_error) + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 471, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":474 + /* "View.MemoryView":470 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -35388,7 +35344,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":476 + /* "View.MemoryView":472 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< @@ -35398,7 +35354,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } - /* "View.MemoryView":479 + /* "View.MemoryView":475 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< @@ -35445,7 +35401,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L7:; } - /* "View.MemoryView":449 + /* "View.MemoryView":445 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -35466,7 +35422,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":481 +/* "View.MemoryView":477 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -35482,28 +35438,28 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("setitem_indexed", 0); - /* "View.MemoryView":482 + /* "View.MemoryView":478 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 478, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":483 + /* "View.MemoryView":479 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":481 + /* "View.MemoryView":477 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -35524,7 +35480,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ return __pyx_r; } -/* "View.MemoryView":485 +/* "View.MemoryView":481 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -35551,31 +35507,31 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview int __pyx_t_11; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":488 + /* "View.MemoryView":484 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":491 + /* "View.MemoryView":487 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":488 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -35591,16 +35547,16 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "View.MemoryView":493 + /* "View.MemoryView":489 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError("Unable to convert item to object") */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -35617,7 +35573,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -35626,14 +35582,14 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -35644,7 +35600,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -35652,7 +35608,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":488 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -35661,7 +35617,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":497 + /* "View.MemoryView":493 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -35673,7 +35629,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { - /* "View.MemoryView":498 + /* "View.MemoryView":494 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< @@ -35681,13 +35637,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 494, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; - /* "View.MemoryView":497 + /* "View.MemoryView":493 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -35696,7 +35652,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":499 + /* "View.MemoryView":495 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< @@ -35715,7 +35671,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "View.MemoryView":494 + /* "View.MemoryView":490 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< @@ -35723,7 +35679,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -35731,28 +35687,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 490, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); - /* "View.MemoryView":495 + /* "View.MemoryView":491 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 491, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 495, __pyx_L5_except_error) + __PYX_ERR(2, 491, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "View.MemoryView":492 + /* "View.MemoryView":488 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -35772,7 +35728,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview goto __pyx_L0; } - /* "View.MemoryView":485 + /* "View.MemoryView":481 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -35798,7 +35754,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":501 +/* "View.MemoryView":497 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -35829,19 +35785,19 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie char *__pyx_t_14; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":504 + /* "View.MemoryView":500 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":505 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -35852,37 +35808,37 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "View.MemoryView":510 + /* "View.MemoryView":506 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 506, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":505 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -35892,7 +35848,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie goto __pyx_L3; } - /* "View.MemoryView":512 + /* "View.MemoryView":508 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< @@ -35900,9 +35856,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * for i, c in enumerate(bytesvalue): */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -35919,7 +35875,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -35928,14 +35884,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -35946,18 +35902,18 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 508, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; - /* "View.MemoryView":514 + /* "View.MemoryView":510 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -35967,7 +35923,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 514, __pyx_L1_error) + __PYX_ERR(2, 510, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -35977,7 +35933,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_11 = __pyx_t_14; __pyx_v_c = (__pyx_t_11[0]); - /* "View.MemoryView":515 + /* "View.MemoryView":511 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -35986,7 +35942,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":514 + /* "View.MemoryView":510 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -35995,7 +35951,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":515 + /* "View.MemoryView":511 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -36006,7 +35962,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "View.MemoryView":501 + /* "View.MemoryView":497 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -36034,7 +35990,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie return __pyx_r; } -/* "View.MemoryView":518 +/* "View.MemoryView":514 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -36074,7 +36030,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":519 + /* "View.MemoryView":515 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -36092,20 +36048,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":520 + /* "View.MemoryView":516 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 520, __pyx_L1_error) + __PYX_ERR(2, 516, __pyx_L1_error) - /* "View.MemoryView":519 + /* "View.MemoryView":515 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -36114,7 +36070,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu */ } - /* "View.MemoryView":522 + /* "View.MemoryView":518 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -36124,7 +36080,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { - /* "View.MemoryView":523 + /* "View.MemoryView":519 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< @@ -36134,7 +36090,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_4; - /* "View.MemoryView":522 + /* "View.MemoryView":518 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -36144,7 +36100,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L6; } - /* "View.MemoryView":525 + /* "View.MemoryView":521 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< @@ -36156,7 +36112,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L6:; - /* "View.MemoryView":527 + /* "View.MemoryView":523 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -36166,7 +36122,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { - /* "View.MemoryView":528 + /* "View.MemoryView":524 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< @@ -36176,7 +36132,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_4; - /* "View.MemoryView":527 + /* "View.MemoryView":523 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -36186,7 +36142,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L7; } - /* "View.MemoryView":530 + /* "View.MemoryView":526 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< @@ -36198,7 +36154,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L7:; - /* "View.MemoryView":532 + /* "View.MemoryView":528 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -36208,7 +36164,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":533 + /* "View.MemoryView":529 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< @@ -36218,7 +36174,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_4; - /* "View.MemoryView":532 + /* "View.MemoryView":528 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -36228,7 +36184,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L8; } - /* "View.MemoryView":535 + /* "View.MemoryView":531 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -36240,7 +36196,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L8:; - /* "View.MemoryView":537 + /* "View.MemoryView":533 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -36250,7 +36206,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":538 + /* "View.MemoryView":534 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< @@ -36260,7 +36216,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_5 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_5; - /* "View.MemoryView":537 + /* "View.MemoryView":533 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -36270,7 +36226,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L9; } - /* "View.MemoryView":540 + /* "View.MemoryView":536 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -36282,7 +36238,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L9:; - /* "View.MemoryView":542 + /* "View.MemoryView":538 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< @@ -36292,7 +36248,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_6 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_6; - /* "View.MemoryView":543 + /* "View.MemoryView":539 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< @@ -36302,7 +36258,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_7 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_7; - /* "View.MemoryView":544 + /* "View.MemoryView":540 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< @@ -36312,7 +36268,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_8; - /* "View.MemoryView":545 + /* "View.MemoryView":541 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< @@ -36322,7 +36278,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_8; - /* "View.MemoryView":546 + /* "View.MemoryView":542 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< @@ -36332,7 +36288,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; - /* "View.MemoryView":547 + /* "View.MemoryView":543 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< @@ -36345,7 +36301,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":518 + /* "View.MemoryView":514 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -36375,7 +36331,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu return __pyx_r; } -/* "View.MemoryView":553 +/* "View.MemoryView":549 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -36404,29 +36360,29 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ int __pyx_t_2; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":554 + /* "View.MemoryView":550 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 550, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":555 + /* "View.MemoryView":551 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 551, __pyx_L1_error) - /* "View.MemoryView":556 + /* "View.MemoryView":552 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< @@ -36438,7 +36394,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":553 + /* "View.MemoryView":549 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -36458,7 +36414,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ return __pyx_r; } -/* "View.MemoryView":559 +/* "View.MemoryView":555 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -36484,7 +36440,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":560 + /* "View.MemoryView":556 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< @@ -36496,7 +36452,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __pyx_r = __pyx_v_self->obj; goto __pyx_L0; - /* "View.MemoryView":559 + /* "View.MemoryView":555 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -36511,7 +36467,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc return __pyx_r; } -/* "View.MemoryView":563 +/* "View.MemoryView":559 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -36543,7 +36499,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":564 + /* "View.MemoryView":560 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -36551,25 +36507,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":563 + /* "View.MemoryView":559 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -36589,7 +36545,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru return __pyx_r; } -/* "View.MemoryView":567 +/* "View.MemoryView":563 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -36622,7 +36578,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":568 + /* "View.MemoryView":564 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -36632,20 +36588,20 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":570 + /* "View.MemoryView":566 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 570, __pyx_L1_error) + __PYX_ERR(2, 566, __pyx_L1_error) - /* "View.MemoryView":568 + /* "View.MemoryView":564 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -36654,7 +36610,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st */ } - /* "View.MemoryView":572 + /* "View.MemoryView":568 * raise ValueError("Buffer view does not expose strides") * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -36662,25 +36618,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "View.MemoryView":567 + /* "View.MemoryView":563 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -36700,7 +36656,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st return __pyx_r; } -/* "View.MemoryView":575 +/* "View.MemoryView":571 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -36733,7 +36689,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ Py_ssize_t *__pyx_t_6; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":576 + /* "View.MemoryView":572 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -36743,7 +36699,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":577 + /* "View.MemoryView":573 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< @@ -36751,16 +36707,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":576 + /* "View.MemoryView":572 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -36769,7 +36725,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ */ } - /* "View.MemoryView":579 + /* "View.MemoryView":575 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -36777,25 +36733,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 575, __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; - /* "View.MemoryView":575 + /* "View.MemoryView":571 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -36815,7 +36771,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ return __pyx_r; } -/* "View.MemoryView":582 +/* "View.MemoryView":578 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -36842,7 +36798,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":583 + /* "View.MemoryView":579 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< @@ -36850,13 +36806,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":582 + /* "View.MemoryView":578 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -36875,7 +36831,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc return __pyx_r; } -/* "View.MemoryView":586 +/* "View.MemoryView":582 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -36902,7 +36858,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":587 + /* "View.MemoryView":583 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< @@ -36910,13 +36866,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":586 + /* "View.MemoryView":582 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -36935,7 +36891,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s return __pyx_r; } -/* "View.MemoryView":590 +/* "View.MemoryView":586 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -36964,7 +36920,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":591 + /* "View.MemoryView":587 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< @@ -36972,11 +36928,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -36984,7 +36940,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":590 + /* "View.MemoryView":586 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -37005,7 +36961,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str return __pyx_r; } -/* "View.MemoryView":594 +/* "View.MemoryView":590 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -37039,7 +36995,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":595 + /* "View.MemoryView":591 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -37050,7 +37006,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":596 + /* "View.MemoryView":592 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< @@ -37060,7 +37016,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; - /* "View.MemoryView":598 + /* "View.MemoryView":594 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< @@ -37070,25 +37026,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; - /* "View.MemoryView":599 + /* "View.MemoryView":595 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; } - /* "View.MemoryView":601 + /* "View.MemoryView":597 * result *= length * * self._size = result # <<<<<<<<<<<<<< @@ -37101,7 +37057,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; - /* "View.MemoryView":595 + /* "View.MemoryView":591 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -37110,7 +37066,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc */ } - /* "View.MemoryView":603 + /* "View.MemoryView":599 * self._size = result * * return self._size # <<<<<<<<<<<<<< @@ -37122,7 +37078,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_r = __pyx_v_self->_size; goto __pyx_L0; - /* "View.MemoryView":594 + /* "View.MemoryView":590 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -37143,7 +37099,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc return __pyx_r; } -/* "View.MemoryView":605 +/* "View.MemoryView":601 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -37170,7 +37126,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 int __pyx_t_1; __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":606 + /* "View.MemoryView":602 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -37180,7 +37136,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":607 + /* "View.MemoryView":603 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< @@ -37190,7 +37146,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; - /* "View.MemoryView":606 + /* "View.MemoryView":602 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -37199,7 +37155,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 */ } - /* "View.MemoryView":609 + /* "View.MemoryView":605 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< @@ -37209,7 +37165,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":605 + /* "View.MemoryView":601 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -37223,7 +37179,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 return __pyx_r; } -/* "View.MemoryView":611 +/* "View.MemoryView":607 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -37252,7 +37208,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":612 + /* "View.MemoryView":608 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< @@ -37260,33 +37216,33 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":613 + /* "View.MemoryView":609 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "View.MemoryView":612 + /* "View.MemoryView":608 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -37294,14 +37250,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __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; - /* "View.MemoryView":611 + /* "View.MemoryView":607 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -37322,7 +37278,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 return __pyx_r; } -/* "View.MemoryView":615 +/* "View.MemoryView":611 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -37350,7 +37306,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":616 + /* "View.MemoryView":612 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< @@ -37358,27 +37314,27 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __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; - /* "View.MemoryView":615 + /* "View.MemoryView":611 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -37398,7 +37354,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 return __pyx_r; } -/* "View.MemoryView":619 +/* "View.MemoryView":615 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -37427,7 +37383,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("is_c_contig", 0); - /* "View.MemoryView":622 + /* "View.MemoryView":618 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< @@ -37436,7 +37392,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 */ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); - /* "View.MemoryView":623 + /* "View.MemoryView":619 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< @@ -37444,13 +37400,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 623, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":619 + /* "View.MemoryView":615 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -37469,7 +37425,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 return __pyx_r; } -/* "View.MemoryView":625 +/* "View.MemoryView":621 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -37498,7 +37454,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("is_f_contig", 0); - /* "View.MemoryView":628 + /* "View.MemoryView":624 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< @@ -37507,7 +37463,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 */ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); - /* "View.MemoryView":629 + /* "View.MemoryView":625 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< @@ -37515,13 +37471,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * def copy(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 629, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":625 + /* "View.MemoryView":621 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -37540,7 +37496,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 return __pyx_r; } -/* "View.MemoryView":631 +/* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -37570,7 +37526,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("copy", 0); - /* "View.MemoryView":633 + /* "View.MemoryView":629 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< @@ -37579,7 +37535,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":635 + /* "View.MemoryView":631 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< @@ -37588,17 +37544,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":636 + /* "View.MemoryView":632 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 632, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":641 + /* "View.MemoryView":637 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< @@ -37606,13 +37562,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":631 + /* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -37631,7 +37587,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 return __pyx_r; } -/* "View.MemoryView":643 +/* "View.MemoryView":639 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -37662,7 +37618,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("copy_fortran", 0); - /* "View.MemoryView":645 + /* "View.MemoryView":641 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< @@ -37671,7 +37627,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":647 + /* "View.MemoryView":643 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< @@ -37680,17 +37636,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); - /* "View.MemoryView":648 + /* "View.MemoryView":644 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 644, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":653 + /* "View.MemoryView":649 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< @@ -37698,13 +37654,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":643 + /* "View.MemoryView":639 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -37830,7 +37786,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st return __pyx_r; } -/* "View.MemoryView":657 +/* "View.MemoryView":653 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -37847,18 +37803,18 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); - /* "View.MemoryView":658 + /* "View.MemoryView":654 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -37869,13 +37825,13 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":659 + /* "View.MemoryView":655 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< @@ -37884,7 +37840,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":660 + /* "View.MemoryView":656 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< @@ -37896,7 +37852,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":657 + /* "View.MemoryView":653 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -37918,7 +37874,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in return __pyx_r; } -/* "View.MemoryView":663 +/* "View.MemoryView":659 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -37932,7 +37888,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_t_1; __Pyx_RefNannySetupContext("memoryview_check", 0); - /* "View.MemoryView":664 + /* "View.MemoryView":660 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< @@ -37943,7 +37899,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "View.MemoryView":663 + /* "View.MemoryView":659 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -37957,7 +37913,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { return __pyx_r; } -/* "View.MemoryView":666 +/* "View.MemoryView":662 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -37988,7 +37944,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("_unellipsify", 0); - /* "View.MemoryView":671 + /* "View.MemoryView":667 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -37999,14 +37955,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":672 + /* "View.MemoryView":668 * """ * if not isinstance(index, tuple): * tup = (index,) # <<<<<<<<<<<<<< * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -38014,7 +37970,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_tup = __pyx_t_3; __pyx_t_3 = 0; - /* "View.MemoryView":671 + /* "View.MemoryView":667 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -38024,7 +37980,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L3; } - /* "View.MemoryView":674 + /* "View.MemoryView":670 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< @@ -38037,19 +37993,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { } __pyx_L3:; - /* "View.MemoryView":676 + /* "View.MemoryView":672 * tup = index * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":677 + /* "View.MemoryView":673 * * result = [] * have_slices = False # <<<<<<<<<<<<<< @@ -38058,7 +38014,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 0; - /* "View.MemoryView":678 + /* "View.MemoryView":674 * result = [] * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< @@ -38067,7 +38023,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 0; - /* "View.MemoryView":679 + /* "View.MemoryView":675 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -38080,26 +38036,26 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 675, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 675, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 675, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -38109,7 +38065,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 679, __pyx_L1_error) + else __PYX_ERR(2, 675, __pyx_L1_error) } break; } @@ -38119,13 +38075,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; - /* "View.MemoryView":680 + /* "View.MemoryView":676 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -38136,7 +38092,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":681 + /* "View.MemoryView":677 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -38146,15 +38102,15 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":682 + /* "View.MemoryView":678 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 678, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { @@ -38163,10 +38119,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":683 + /* "View.MemoryView":679 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True # <<<<<<<<<<<<<< @@ -38175,7 +38131,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":681 + /* "View.MemoryView":677 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -38185,7 +38141,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L7; } - /* "View.MemoryView":685 + /* "View.MemoryView":681 * seen_ellipsis = True * else: * result.append(slice(None)) # <<<<<<<<<<<<<< @@ -38193,11 +38149,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 681, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":686 + /* "View.MemoryView":682 * else: * result.append(slice(None)) * have_slices = True # <<<<<<<<<<<<<< @@ -38206,7 +38162,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 1; - /* "View.MemoryView":680 + /* "View.MemoryView":676 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -38216,7 +38172,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L6; } - /* "View.MemoryView":688 + /* "View.MemoryView":684 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -38236,23 +38192,23 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":689 + /* "View.MemoryView":685 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * * have_slices = have_slices or isinstance(item, slice) */ - __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(2, 685, __pyx_L1_error) - /* "View.MemoryView":688 + /* "View.MemoryView":684 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -38261,7 +38217,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":691 + /* "View.MemoryView":687 * raise TypeError("Cannot index with type '%s'" % type(item)) * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< @@ -38280,18 +38236,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; - /* "View.MemoryView":692 + /* "View.MemoryView":688 * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 688, __pyx_L1_error) } __pyx_L6:; - /* "View.MemoryView":679 + /* "View.MemoryView":675 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -38302,17 +38258,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":694 + /* "View.MemoryView":690 * result.append(item) * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 690, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* "View.MemoryView":695 + /* "View.MemoryView":691 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -38322,14 +38278,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { - /* "View.MemoryView":696 + /* "View.MemoryView":692 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * * return have_slices or nslices, tuple(result) */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { @@ -38338,10 +38294,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":695 + /* "View.MemoryView":691 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -38350,7 +38306,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":698 + /* "View.MemoryView":694 * result.extend([slice(None)] * nslices) * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< @@ -38360,20 +38316,20 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); @@ -38385,7 +38341,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_11 = 0; goto __pyx_L0; - /* "View.MemoryView":666 + /* "View.MemoryView":662 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -38411,7 +38367,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { return __pyx_r; } -/* "View.MemoryView":700 +/* "View.MemoryView":696 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -38430,7 +38386,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); - /* "View.MemoryView":701 + /* "View.MemoryView":697 * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -38442,7 +38398,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); - /* "View.MemoryView":702 + /* "View.MemoryView":698 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -38452,20 +38408,20 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":703 + /* "View.MemoryView":699 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 703, __pyx_L1_error) + __PYX_ERR(2, 699, __pyx_L1_error) - /* "View.MemoryView":702 + /* "View.MemoryView":698 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -38475,7 +38431,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } } - /* "View.MemoryView":700 + /* "View.MemoryView":696 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -38496,7 +38452,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ return __pyx_r; } -/* "View.MemoryView":710 +/* "View.MemoryView":706 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -38537,7 +38493,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ Py_ssize_t __pyx_t_12; __Pyx_RefNannySetupContext("memview_slice", 0); - /* "View.MemoryView":711 + /* "View.MemoryView":707 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< @@ -38547,7 +38503,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; - /* "View.MemoryView":718 + /* "View.MemoryView":714 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< @@ -38556,7 +38512,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); - /* "View.MemoryView":722 + /* "View.MemoryView":718 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< @@ -38567,12 +38523,12 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 722, __pyx_L1_error) + __PYX_ERR(2, 718, __pyx_L1_error) } } #endif - /* "View.MemoryView":724 + /* "View.MemoryView":720 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -38583,20 +38539,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":725 + /* "View.MemoryView":721 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 721, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":726 + /* "View.MemoryView":722 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< @@ -38605,7 +38561,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); - /* "View.MemoryView":724 + /* "View.MemoryView":720 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -38615,7 +38571,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L3; } - /* "View.MemoryView":728 + /* "View.MemoryView":724 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< @@ -38625,7 +38581,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":729 + /* "View.MemoryView":725 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< @@ -38636,7 +38592,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L3:; - /* "View.MemoryView":735 + /* "View.MemoryView":731 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< @@ -38646,7 +38602,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; - /* "View.MemoryView":736 + /* "View.MemoryView":732 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< @@ -38656,7 +38612,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; - /* "View.MemoryView":741 + /* "View.MemoryView":737 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< @@ -38665,7 +38621,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_dst = (&__pyx_v_dst); - /* "View.MemoryView":742 + /* "View.MemoryView":738 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< @@ -38674,7 +38630,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":746 + /* "View.MemoryView":742 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -38686,26 +38642,26 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 742, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 742, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 742, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -38715,7 +38671,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 746, __pyx_L1_error) + else __PYX_ERR(2, 742, __pyx_L1_error) } break; } @@ -38726,7 +38682,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_dim = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "View.MemoryView":747 + /* "View.MemoryView":743 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -38736,25 +38692,25 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_2) { - /* "View.MemoryView":751 + /* "View.MemoryView":747 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< * 0, 0, 0, # have_{start,stop,step} * False) */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error) - /* "View.MemoryView":748 + /* "View.MemoryView":744 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 744, __pyx_L1_error) - /* "View.MemoryView":747 + /* "View.MemoryView":743 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -38764,7 +38720,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":754 + /* "View.MemoryView":750 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -38775,7 +38731,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":755 + /* "View.MemoryView":751 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< @@ -38784,7 +38740,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; - /* "View.MemoryView":756 + /* "View.MemoryView":752 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< @@ -38793,7 +38749,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; - /* "View.MemoryView":757 + /* "View.MemoryView":753 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< @@ -38802,7 +38758,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; - /* "View.MemoryView":758 + /* "View.MemoryView":754 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< @@ -38811,7 +38767,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - /* "View.MemoryView":754 + /* "View.MemoryView":750 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -38821,7 +38777,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":760 + /* "View.MemoryView":756 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< @@ -38829,13 +38785,13 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * step = index.step or 0 */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 756, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 756, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -38844,20 +38800,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_10; - /* "View.MemoryView":761 + /* "View.MemoryView":757 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 757, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 757, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -38866,20 +38822,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":762 + /* "View.MemoryView":758 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 758, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 758, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -38888,55 +38844,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":764 + /* "View.MemoryView":760 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":765 + /* "View.MemoryView":761 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":766 + /* "View.MemoryView":762 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_step = __pyx_t_1; - /* "View.MemoryView":768 + /* "View.MemoryView":764 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 764, __pyx_L1_error) - /* "View.MemoryView":774 + /* "View.MemoryView":770 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< @@ -38947,7 +38903,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L6:; - /* "View.MemoryView":746 + /* "View.MemoryView":742 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -38957,7 +38913,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":776 + /* "View.MemoryView":772 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -38968,7 +38924,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":777 + /* "View.MemoryView":773 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< @@ -38977,39 +38933,39 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":778 + /* "View.MemoryView":774 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 774, __pyx_L1_error) } - /* "View.MemoryView":779 + /* "View.MemoryView":775 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 775, __pyx_L1_error) } - /* "View.MemoryView":777 + /* "View.MemoryView":773 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 773, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":776 + /* "View.MemoryView":772 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -39018,7 +38974,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ } - /* "View.MemoryView":782 + /* "View.MemoryView":778 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< @@ -39028,30 +38984,30 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":783 + /* "View.MemoryView":779 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":782 + /* "View.MemoryView":778 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 778, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":710 + /* "View.MemoryView":706 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -39073,7 +39029,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ return __pyx_r; } -/* "View.MemoryView":807 +/* "View.MemoryView":803 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -39089,7 +39045,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, int __pyx_t_2; int __pyx_t_3; - /* "View.MemoryView":827 + /* "View.MemoryView":823 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -39099,7 +39055,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":829 + /* "View.MemoryView":825 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -39109,7 +39065,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((__pyx_v_start < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":830 + /* "View.MemoryView":826 * * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -39118,7 +39074,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":829 + /* "View.MemoryView":825 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -39127,7 +39083,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":831 + /* "View.MemoryView":827 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -39141,16 +39097,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":832 + /* "View.MemoryView":828 * start += shape * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 828, __pyx_L1_error) - /* "View.MemoryView":831 + /* "View.MemoryView":827 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -39159,7 +39115,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":827 + /* "View.MemoryView":823 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -39169,7 +39125,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L3; } - /* "View.MemoryView":835 + /* "View.MemoryView":831 * else: * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< @@ -39188,7 +39144,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L6_bool_binop_done:; __pyx_v_negative_step = __pyx_t_2; - /* "View.MemoryView":837 + /* "View.MemoryView":833 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -39206,16 +39162,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "View.MemoryView":838 + /* "View.MemoryView":834 * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error) - /* "View.MemoryView":837 + /* "View.MemoryView":833 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -39224,7 +39180,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":841 + /* "View.MemoryView":837 * * * if have_start: # <<<<<<<<<<<<<< @@ -39234,7 +39190,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { - /* "View.MemoryView":842 + /* "View.MemoryView":838 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -39244,7 +39200,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":843 + /* "View.MemoryView":839 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -39253,7 +39209,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":844 + /* "View.MemoryView":840 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -39263,7 +39219,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":845 + /* "View.MemoryView":841 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< @@ -39272,7 +39228,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = 0; - /* "View.MemoryView":844 + /* "View.MemoryView":840 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -39281,7 +39237,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":842 + /* "View.MemoryView":838 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -39291,7 +39247,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L12; } - /* "View.MemoryView":846 + /* "View.MemoryView":842 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -39301,7 +39257,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":847 + /* "View.MemoryView":843 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -39311,7 +39267,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":848 + /* "View.MemoryView":844 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -39320,7 +39276,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":847 + /* "View.MemoryView":843 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -39330,7 +39286,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L14; } - /* "View.MemoryView":850 + /* "View.MemoryView":846 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< @@ -39342,7 +39298,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L14:; - /* "View.MemoryView":846 + /* "View.MemoryView":842 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -39352,7 +39308,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L12:; - /* "View.MemoryView":841 + /* "View.MemoryView":837 * * * if have_start: # <<<<<<<<<<<<<< @@ -39362,7 +39318,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L11; } - /* "View.MemoryView":852 + /* "View.MemoryView":848 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -39373,7 +39329,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":853 + /* "View.MemoryView":849 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -39382,7 +39338,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":852 + /* "View.MemoryView":848 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -39392,7 +39348,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L15; } - /* "View.MemoryView":855 + /* "View.MemoryView":851 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< @@ -39406,7 +39362,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L11:; - /* "View.MemoryView":857 + /* "View.MemoryView":853 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -39416,7 +39372,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { - /* "View.MemoryView":858 + /* "View.MemoryView":854 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -39426,7 +39382,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":859 + /* "View.MemoryView":855 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< @@ -39435,7 +39391,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); - /* "View.MemoryView":860 + /* "View.MemoryView":856 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -39445,7 +39401,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":861 + /* "View.MemoryView":857 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< @@ -39454,7 +39410,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = 0; - /* "View.MemoryView":860 + /* "View.MemoryView":856 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -39463,7 +39419,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":858 + /* "View.MemoryView":854 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -39473,7 +39429,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L17; } - /* "View.MemoryView":862 + /* "View.MemoryView":858 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -39483,7 +39439,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":863 + /* "View.MemoryView":859 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< @@ -39492,7 +39448,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = __pyx_v_shape; - /* "View.MemoryView":862 + /* "View.MemoryView":858 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -39502,7 +39458,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L17:; - /* "View.MemoryView":857 + /* "View.MemoryView":853 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -39512,7 +39468,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L16; } - /* "View.MemoryView":865 + /* "View.MemoryView":861 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -39523,7 +39479,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":866 + /* "View.MemoryView":862 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< @@ -39532,7 +39488,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = -1L; - /* "View.MemoryView":865 + /* "View.MemoryView":861 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -39542,7 +39498,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L19; } - /* "View.MemoryView":868 + /* "View.MemoryView":864 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< @@ -39556,7 +39512,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L16:; - /* "View.MemoryView":870 + /* "View.MemoryView":866 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -39566,7 +39522,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":871 + /* "View.MemoryView":867 * * if not have_step: * step = 1 # <<<<<<<<<<<<<< @@ -39575,7 +39531,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_step = 1; - /* "View.MemoryView":870 + /* "View.MemoryView":866 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -39584,7 +39540,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":875 + /* "View.MemoryView":871 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< @@ -39593,7 +39549,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); - /* "View.MemoryView":877 + /* "View.MemoryView":873 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -39603,7 +39559,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":878 + /* "View.MemoryView":874 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< @@ -39612,7 +39568,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":877 + /* "View.MemoryView":873 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -39621,7 +39577,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":880 + /* "View.MemoryView":876 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -39631,7 +39587,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":881 + /* "View.MemoryView":877 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< @@ -39640,7 +39596,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = 0; - /* "View.MemoryView":880 + /* "View.MemoryView":876 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -39649,7 +39605,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":884 + /* "View.MemoryView":880 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< @@ -39658,7 +39614,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); - /* "View.MemoryView":885 + /* "View.MemoryView":881 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< @@ -39667,7 +39623,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; - /* "View.MemoryView":886 + /* "View.MemoryView":882 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< @@ -39678,7 +39634,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L3:; - /* "View.MemoryView":889 + /* "View.MemoryView":885 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -39688,7 +39644,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":890 + /* "View.MemoryView":886 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< @@ -39697,7 +39653,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); - /* "View.MemoryView":889 + /* "View.MemoryView":885 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -39707,7 +39663,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L23; } - /* "View.MemoryView":892 + /* "View.MemoryView":888 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< @@ -39720,7 +39676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L23:; - /* "View.MemoryView":894 + /* "View.MemoryView":890 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -39730,7 +39686,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":895 + /* "View.MemoryView":891 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -39740,7 +39696,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":896 + /* "View.MemoryView":892 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -39750,7 +39706,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":897 + /* "View.MemoryView":893 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< @@ -39759,7 +39715,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":896 + /* "View.MemoryView":892 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -39769,7 +39725,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L26; } - /* "View.MemoryView":899 + /* "View.MemoryView":895 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< @@ -39778,18 +39734,18 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ /*else*/ { - /* "View.MemoryView":900 + /* "View.MemoryView":896 * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 895, __pyx_L1_error) } __pyx_L26:; - /* "View.MemoryView":895 + /* "View.MemoryView":891 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -39799,7 +39755,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L25; } - /* "View.MemoryView":902 + /* "View.MemoryView":898 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< @@ -39811,7 +39767,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L25:; - /* "View.MemoryView":894 + /* "View.MemoryView":890 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -39820,7 +39776,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":904 + /* "View.MemoryView":900 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< @@ -39830,7 +39786,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":807 + /* "View.MemoryView":803 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -39854,7 +39810,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, return __pyx_r; } -/* "View.MemoryView":910 +/* "View.MemoryView":906 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -39876,7 +39832,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("pybuffer_index", 0); - /* "View.MemoryView":912 + /* "View.MemoryView":908 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< @@ -39885,7 +39841,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = -1L; - /* "View.MemoryView":913 + /* "View.MemoryView":909 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< @@ -39895,7 +39851,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":916 + /* "View.MemoryView":912 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -39905,7 +39861,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":917 + /* "View.MemoryView":913 * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< @@ -39914,15 +39870,15 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 913, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 913, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - /* "View.MemoryView":918 + /* "View.MemoryView":914 * if view.ndim == 0: * shape = view.len / itemsize * stride = itemsize # <<<<<<<<<<<<<< @@ -39931,7 +39887,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = __pyx_v_itemsize; - /* "View.MemoryView":916 + /* "View.MemoryView":912 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -39941,7 +39897,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P goto __pyx_L3; } - /* "View.MemoryView":920 + /* "View.MemoryView":916 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< @@ -39951,7 +39907,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":921 + /* "View.MemoryView":917 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< @@ -39960,7 +39916,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":918 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -39970,7 +39926,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":923 + /* "View.MemoryView":919 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< @@ -39979,7 +39935,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":918 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -39990,7 +39946,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } __pyx_L3:; - /* "View.MemoryView":925 + /* "View.MemoryView":921 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -40000,7 +39956,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":926 + /* "View.MemoryView":922 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< @@ -40009,7 +39965,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); - /* "View.MemoryView":927 + /* "View.MemoryView":923 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -40019,26 +39975,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":928 + /* "View.MemoryView":924 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 928, __pyx_L1_error) + __PYX_ERR(2, 924, __pyx_L1_error) - /* "View.MemoryView":927 + /* "View.MemoryView":923 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -40047,7 +40003,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":925 + /* "View.MemoryView":921 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -40056,7 +40012,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":930 + /* "View.MemoryView":926 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -40066,26 +40022,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":931 + /* "View.MemoryView":927 * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 931, __pyx_L1_error) + __PYX_ERR(2, 927, __pyx_L1_error) - /* "View.MemoryView":930 + /* "View.MemoryView":926 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -40094,7 +40050,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":933 + /* "View.MemoryView":929 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * resultp = bufp + index * stride # <<<<<<<<<<<<<< @@ -40103,7 +40059,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); - /* "View.MemoryView":934 + /* "View.MemoryView":930 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -40113,7 +40069,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":935 + /* "View.MemoryView":931 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< @@ -40122,7 +40078,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":934 + /* "View.MemoryView":930 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -40131,7 +40087,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":937 + /* "View.MemoryView":933 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< @@ -40141,7 +40097,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_r = __pyx_v_resultp; goto __pyx_L0; - /* "View.MemoryView":910 + /* "View.MemoryView":906 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -40160,7 +40116,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P return __pyx_r; } -/* "View.MemoryView":943 +/* "View.MemoryView":939 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -40185,7 +40141,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { int __pyx_t_8; int __pyx_t_9; - /* "View.MemoryView":944 + /* "View.MemoryView":940 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< @@ -40195,7 +40151,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; - /* "View.MemoryView":946 + /* "View.MemoryView":942 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< @@ -40205,7 +40161,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":947 + /* "View.MemoryView":943 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< @@ -40215,7 +40171,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; - /* "View.MemoryView":951 + /* "View.MemoryView":947 * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< @@ -40227,7 +40183,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":952 + /* "View.MemoryView":948 * cdef int i, j * for i in range(ndim / 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< @@ -40236,7 +40192,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); - /* "View.MemoryView":953 + /* "View.MemoryView":949 * for i in range(ndim / 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< @@ -40248,7 +40204,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; - /* "View.MemoryView":954 + /* "View.MemoryView":950 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< @@ -40260,7 +40216,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":956 + /* "View.MemoryView":952 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -40278,16 +40234,16 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_L6_bool_binop_done:; if (__pyx_t_7) { - /* "View.MemoryView":957 + /* "View.MemoryView":953 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 1 */ - __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 953, __pyx_L1_error) - /* "View.MemoryView":956 + /* "View.MemoryView":952 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -40297,7 +40253,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { } } - /* "View.MemoryView":959 + /* "View.MemoryView":955 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 1 # <<<<<<<<<<<<<< @@ -40307,7 +40263,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_r = 1; goto __pyx_L0; - /* "View.MemoryView":943 + /* "View.MemoryView":939 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -40331,7 +40287,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { return __pyx_r; } -/* "View.MemoryView":976 +/* "View.MemoryView":972 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -40354,7 +40310,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":977 + /* "View.MemoryView":973 * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< @@ -40363,7 +40319,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - /* "View.MemoryView":976 + /* "View.MemoryView":972 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -40375,7 +40331,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":979 +/* "View.MemoryView":975 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -40390,7 +40346,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":980 + /* "View.MemoryView":976 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -40400,7 +40356,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":981 + /* "View.MemoryView":977 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< @@ -40408,13 +40364,13 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":980 + /* "View.MemoryView":976 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -40423,7 +40379,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ } - /* "View.MemoryView":983 + /* "View.MemoryView":979 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< @@ -40432,14 +40388,14 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "View.MemoryView":979 + /* "View.MemoryView":975 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -40458,7 +40414,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":985 +/* "View.MemoryView":981 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -40474,7 +40430,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":986 + /* "View.MemoryView":982 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -40484,16 +40440,16 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":987 + /* "View.MemoryView":983 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 983, __pyx_L1_error) - /* "View.MemoryView":986 + /* "View.MemoryView":982 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -40503,7 +40459,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo goto __pyx_L3; } - /* "View.MemoryView":989 + /* "View.MemoryView":985 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< @@ -40511,13 +40467,13 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * @property */ /*else*/ { - __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "View.MemoryView":985 + /* "View.MemoryView":981 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -40538,7 +40494,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo return __pyx_r; } -/* "View.MemoryView":992 +/* "View.MemoryView":988 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -40564,7 +40520,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":993 + /* "View.MemoryView":989 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< @@ -40576,7 +40532,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":992 + /* "View.MemoryView":988 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -40698,7 +40654,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS return __pyx_r; } -/* "View.MemoryView":999 +/* "View.MemoryView":995 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -40723,7 +40679,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl Py_ssize_t __pyx_t_9; __Pyx_RefNannySetupContext("memoryview_fromslice", 0); - /* "View.MemoryView":1007 + /* "View.MemoryView":1003 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -40733,7 +40689,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1008 + /* "View.MemoryView":1004 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< @@ -40744,7 +40700,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "View.MemoryView":1007 + /* "View.MemoryView":1003 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -40753,16 +40709,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ } - /* "View.MemoryView":1013 + /* "View.MemoryView":1009 * * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -40773,13 +40729,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1015 + /* "View.MemoryView":1011 * result = _memoryviewslice(None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< @@ -40788,7 +40744,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1016 + /* "View.MemoryView":1012 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< @@ -40797,14 +40753,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); - /* "View.MemoryView":1018 + /* "View.MemoryView":1014 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -40812,7 +40768,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":1019 + /* "View.MemoryView":1015 * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< @@ -40822,7 +40778,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; - /* "View.MemoryView":1021 + /* "View.MemoryView":1017 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< @@ -40832,7 +40788,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; - /* "View.MemoryView":1022 + /* "View.MemoryView":1018 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< @@ -40841,7 +40797,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); - /* "View.MemoryView":1023 + /* "View.MemoryView":1019 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< @@ -40850,7 +40806,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; - /* "View.MemoryView":1024 + /* "View.MemoryView":1020 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< @@ -40859,7 +40815,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1025 + /* "View.MemoryView":1021 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -40868,7 +40824,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ Py_INCREF(Py_None); - /* "View.MemoryView":1027 + /* "View.MemoryView":1023 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -40878,7 +40834,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1028 + /* "View.MemoryView":1024 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< @@ -40887,7 +40843,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; - /* "View.MemoryView":1027 + /* "View.MemoryView":1023 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -40897,7 +40853,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L4; } - /* "View.MemoryView":1030 + /* "View.MemoryView":1026 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< @@ -40909,7 +40865,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L4:; - /* "View.MemoryView":1032 + /* "View.MemoryView":1028 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< @@ -40918,7 +40874,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); - /* "View.MemoryView":1033 + /* "View.MemoryView":1029 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< @@ -40927,7 +40883,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); - /* "View.MemoryView":1036 + /* "View.MemoryView":1032 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< @@ -40936,7 +40892,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; - /* "View.MemoryView":1037 + /* "View.MemoryView":1033 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -40948,7 +40904,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); - /* "View.MemoryView":1038 + /* "View.MemoryView":1034 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -40958,7 +40914,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1039 + /* "View.MemoryView":1035 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< @@ -40967,7 +40923,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); - /* "View.MemoryView":1040 + /* "View.MemoryView":1036 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< @@ -40976,7 +40932,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ goto __pyx_L6_break; - /* "View.MemoryView":1038 + /* "View.MemoryView":1034 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -40987,7 +40943,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L6_break:; - /* "View.MemoryView":1042 + /* "View.MemoryView":1038 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< @@ -40997,7 +40953,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - /* "View.MemoryView":1043 + /* "View.MemoryView":1039 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< @@ -41007,29 +40963,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1044 + /* "View.MemoryView":1040 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } - /* "View.MemoryView":1046 + /* "View.MemoryView":1042 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< @@ -41038,7 +40994,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; - /* "View.MemoryView":1047 + /* "View.MemoryView":1043 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< @@ -41047,7 +41003,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; - /* "View.MemoryView":1049 + /* "View.MemoryView":1045 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< @@ -41059,7 +41015,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":999 + /* "View.MemoryView":995 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -41081,7 +41037,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl return __pyx_r; } -/* "View.MemoryView":1052 +/* "View.MemoryView":1048 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -41098,7 +41054,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_slice_from_memview", 0); - /* "View.MemoryView":1055 + /* "View.MemoryView":1051 * __Pyx_memviewslice *mslice): * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -41109,20 +41065,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1056 + /* "View.MemoryView":1052 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1052, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1057 + /* "View.MemoryView":1053 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< @@ -41132,7 +41088,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; - /* "View.MemoryView":1055 + /* "View.MemoryView":1051 * __Pyx_memviewslice *mslice): * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -41141,7 +41097,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p */ } - /* "View.MemoryView":1059 + /* "View.MemoryView":1055 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< @@ -41151,7 +41107,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - /* "View.MemoryView":1060 + /* "View.MemoryView":1056 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< @@ -41162,7 +41118,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p goto __pyx_L0; } - /* "View.MemoryView":1052 + /* "View.MemoryView":1048 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -41181,7 +41137,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p return __pyx_r; } -/* "View.MemoryView":1063 +/* "View.MemoryView":1059 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -41202,7 +41158,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("slice_copy", 0); - /* "View.MemoryView":1067 + /* "View.MemoryView":1063 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< @@ -41212,7 +41168,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; - /* "View.MemoryView":1068 + /* "View.MemoryView":1064 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< @@ -41222,7 +41178,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; - /* "View.MemoryView":1069 + /* "View.MemoryView":1065 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< @@ -41232,7 +41188,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; - /* "View.MemoryView":1071 + /* "View.MemoryView":1067 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< @@ -41241,7 +41197,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); - /* "View.MemoryView":1072 + /* "View.MemoryView":1068 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< @@ -41250,7 +41206,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); - /* "View.MemoryView":1074 + /* "View.MemoryView":1070 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< @@ -41262,7 +41218,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; - /* "View.MemoryView":1075 + /* "View.MemoryView":1071 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< @@ -41271,7 +41227,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); - /* "View.MemoryView":1076 + /* "View.MemoryView":1072 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< @@ -41280,7 +41236,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); - /* "View.MemoryView":1077 + /* "View.MemoryView":1073 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< @@ -41295,7 +41251,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } - /* "View.MemoryView":1063 + /* "View.MemoryView":1059 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -41307,7 +41263,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1080 +/* "View.MemoryView":1076 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -41322,7 +41278,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("memoryview_copy", 0); - /* "View.MemoryView":1083 + /* "View.MemoryView":1079 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -41331,7 +41287,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); - /* "View.MemoryView":1084 + /* "View.MemoryView":1080 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -41339,13 +41295,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":1080 + /* "View.MemoryView":1076 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -41364,7 +41320,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx return __pyx_r; } -/* "View.MemoryView":1087 +/* "View.MemoryView":1083 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -41384,7 +41340,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); - /* "View.MemoryView":1094 + /* "View.MemoryView":1090 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -41395,7 +41351,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1095 + /* "View.MemoryView":1091 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< @@ -41405,7 +41361,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_3; - /* "View.MemoryView":1096 + /* "View.MemoryView":1092 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< @@ -41415,7 +41371,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_4; - /* "View.MemoryView":1094 + /* "View.MemoryView":1090 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -41425,7 +41381,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L3; } - /* "View.MemoryView":1098 + /* "View.MemoryView":1094 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< @@ -41435,7 +41391,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /*else*/ { __pyx_v_to_object_func = NULL; - /* "View.MemoryView":1099 + /* "View.MemoryView":1095 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< @@ -41446,7 +41402,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } __pyx_L3:; - /* "View.MemoryView":1101 + /* "View.MemoryView":1097 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< @@ -41455,20 +41411,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview */ __Pyx_XDECREF(__pyx_r); - /* "View.MemoryView":1103 + /* "View.MemoryView":1099 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":1087 + /* "View.MemoryView":1083 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -41487,7 +41443,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":1109 +/* "View.MemoryView":1105 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -41499,7 +41455,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; int __pyx_t_1; - /* "View.MemoryView":1110 + /* "View.MemoryView":1106 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -41509,7 +41465,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_t_1 = ((__pyx_v_arg < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1111 + /* "View.MemoryView":1107 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: * return -arg # <<<<<<<<<<<<<< @@ -41519,7 +41475,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_r = (-__pyx_v_arg); goto __pyx_L0; - /* "View.MemoryView":1110 + /* "View.MemoryView":1106 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -41528,7 +41484,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { */ } - /* "View.MemoryView":1113 + /* "View.MemoryView":1109 * return -arg * else: * return arg # <<<<<<<<<<<<<< @@ -41540,7 +41496,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; } - /* "View.MemoryView":1109 + /* "View.MemoryView":1105 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -41553,7 +41509,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { return __pyx_r; } -/* "View.MemoryView":1116 +/* "View.MemoryView":1112 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -41571,7 +41527,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1121 + /* "View.MemoryView":1117 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< @@ -41580,7 +41536,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = 0; - /* "View.MemoryView":1122 + /* "View.MemoryView":1118 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< @@ -41589,7 +41545,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = 0; - /* "View.MemoryView":1124 + /* "View.MemoryView":1120 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -41599,7 +41555,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1125 + /* "View.MemoryView":1121 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -41609,7 +41565,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1126 + /* "View.MemoryView":1122 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -41618,7 +41574,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1127 + /* "View.MemoryView":1123 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -41627,7 +41583,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L4_break; - /* "View.MemoryView":1125 + /* "View.MemoryView":1121 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -41638,7 +41594,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L4_break:; - /* "View.MemoryView":1129 + /* "View.MemoryView":1125 * break * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -41650,7 +41606,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1130 + /* "View.MemoryView":1126 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -41660,7 +41616,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1131 + /* "View.MemoryView":1127 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -41669,7 +41625,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1132 + /* "View.MemoryView":1128 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -41678,7 +41634,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L7_break; - /* "View.MemoryView":1130 + /* "View.MemoryView":1126 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -41689,7 +41645,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L7_break:; - /* "View.MemoryView":1134 + /* "View.MemoryView":1130 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -41699,7 +41655,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1135 + /* "View.MemoryView":1131 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< @@ -41709,7 +41665,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_r = 'C'; goto __pyx_L0; - /* "View.MemoryView":1134 + /* "View.MemoryView":1130 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -41718,7 +41674,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ } - /* "View.MemoryView":1137 + /* "View.MemoryView":1133 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< @@ -41730,7 +41686,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ goto __pyx_L0; } - /* "View.MemoryView":1116 + /* "View.MemoryView":1112 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -41743,7 +41699,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ return __pyx_r; } -/* "View.MemoryView":1140 +/* "View.MemoryView":1136 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -41764,7 +41720,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; - /* "View.MemoryView":1147 + /* "View.MemoryView":1143 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< @@ -41773,7 +41729,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); - /* "View.MemoryView":1148 + /* "View.MemoryView":1144 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< @@ -41782,7 +41738,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); - /* "View.MemoryView":1149 + /* "View.MemoryView":1145 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< @@ -41791,7 +41747,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); - /* "View.MemoryView":1150 + /* "View.MemoryView":1146 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< @@ -41800,7 +41756,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); - /* "View.MemoryView":1152 + /* "View.MemoryView":1148 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -41810,7 +41766,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1153 + /* "View.MemoryView":1149 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -41830,7 +41786,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L5_bool_binop_done; } - /* "View.MemoryView":1154 + /* "View.MemoryView":1150 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< @@ -41845,7 +41801,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; - /* "View.MemoryView":1153 + /* "View.MemoryView":1149 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -41854,7 +41810,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ if (__pyx_t_1) { - /* "View.MemoryView":1155 + /* "View.MemoryView":1151 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< @@ -41863,7 +41819,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); - /* "View.MemoryView":1153 + /* "View.MemoryView":1149 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -41873,7 +41829,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L4; } - /* "View.MemoryView":1157 + /* "View.MemoryView":1153 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -41886,7 +41842,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1158 + /* "View.MemoryView":1154 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< @@ -41895,7 +41851,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); - /* "View.MemoryView":1159 + /* "View.MemoryView":1155 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -41904,7 +41860,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1160 + /* "View.MemoryView":1156 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -41916,7 +41872,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L4:; - /* "View.MemoryView":1152 + /* "View.MemoryView":1148 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -41926,7 +41882,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L3; } - /* "View.MemoryView":1162 + /* "View.MemoryView":1158 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -41939,7 +41895,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1163 + /* "View.MemoryView":1159 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< @@ -41948,7 +41904,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); - /* "View.MemoryView":1167 + /* "View.MemoryView":1163 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -41957,7 +41913,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1168 + /* "View.MemoryView":1164 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -41969,7 +41925,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L3:; - /* "View.MemoryView":1140 + /* "View.MemoryView":1136 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -41980,7 +41936,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* function exit code */ } -/* "View.MemoryView":1170 +/* "View.MemoryView":1166 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -41990,7 +41946,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { - /* "View.MemoryView":1173 + /* "View.MemoryView":1169 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< @@ -41999,7 +41955,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1170 + /* "View.MemoryView":1166 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -42010,7 +41966,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi /* function exit code */ } -/* "View.MemoryView":1177 +/* "View.MemoryView":1173 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -42027,7 +41983,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1180 + /* "View.MemoryView":1176 * "Return the size of the memory occupied by the slice in number of bytes" * cdef int i * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -42037,7 +41993,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; - /* "View.MemoryView":1182 + /* "View.MemoryView":1178 * cdef Py_ssize_t size = src.memview.view.itemsize * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -42049,7 +42005,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1183 + /* "View.MemoryView":1179 * * for i in range(ndim): * size *= src.shape[i] # <<<<<<<<<<<<<< @@ -42059,7 +42015,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); } - /* "View.MemoryView":1185 + /* "View.MemoryView":1181 * size *= src.shape[i] * * return size # <<<<<<<<<<<<<< @@ -42069,7 +42025,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_r = __pyx_v_size; goto __pyx_L0; - /* "View.MemoryView":1177 + /* "View.MemoryView":1173 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -42082,7 +42038,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr return __pyx_r; } -/* "View.MemoryView":1188 +/* "View.MemoryView":1184 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -42098,7 +42054,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1197 + /* "View.MemoryView":1193 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -42108,7 +42064,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_t_1 = ((__pyx_v_order == 'F') != 0); if (__pyx_t_1) { - /* "View.MemoryView":1198 + /* "View.MemoryView":1194 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< @@ -42120,7 +42076,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; - /* "View.MemoryView":1199 + /* "View.MemoryView":1195 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -42129,7 +42085,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1200 + /* "View.MemoryView":1196 * for idx in range(ndim): * strides[idx] = stride * stride = stride * shape[idx] # <<<<<<<<<<<<<< @@ -42139,7 +42095,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } - /* "View.MemoryView":1197 + /* "View.MemoryView":1193 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -42149,7 +42105,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ goto __pyx_L3; } - /* "View.MemoryView":1202 + /* "View.MemoryView":1198 * stride = stride * shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -42160,7 +42116,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; - /* "View.MemoryView":1203 + /* "View.MemoryView":1199 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -42169,7 +42125,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1204 + /* "View.MemoryView":1200 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride = stride * shape[idx] # <<<<<<<<<<<<<< @@ -42181,7 +42137,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } __pyx_L3:; - /* "View.MemoryView":1206 + /* "View.MemoryView":1202 * stride = stride * shape[idx] * * return stride # <<<<<<<<<<<<<< @@ -42191,7 +42147,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_r = __pyx_v_stride; goto __pyx_L0; - /* "View.MemoryView":1188 + /* "View.MemoryView":1184 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -42204,7 +42160,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ return __pyx_r; } -/* "View.MemoryView":1209 +/* "View.MemoryView":1205 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -42225,7 +42181,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, int __pyx_t_5; int __pyx_t_6; - /* "View.MemoryView":1220 + /* "View.MemoryView":1216 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -42235,7 +42191,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1221 + /* "View.MemoryView":1217 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< @@ -42244,7 +42200,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); - /* "View.MemoryView":1223 + /* "View.MemoryView":1219 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< @@ -42253,7 +42209,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_result = malloc(__pyx_v_size); - /* "View.MemoryView":1224 + /* "View.MemoryView":1220 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -42263,16 +42219,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1225 + /* "View.MemoryView":1221 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1225, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1221, __pyx_L1_error) - /* "View.MemoryView":1224 + /* "View.MemoryView":1220 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -42281,7 +42237,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ } - /* "View.MemoryView":1228 + /* "View.MemoryView":1224 * * * tmpslice.data = result # <<<<<<<<<<<<<< @@ -42290,7 +42246,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1229 + /* "View.MemoryView":1225 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< @@ -42300,7 +42256,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; - /* "View.MemoryView":1230 + /* "View.MemoryView":1226 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< @@ -42312,7 +42268,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1231 + /* "View.MemoryView":1227 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< @@ -42321,7 +42277,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); - /* "View.MemoryView":1232 + /* "View.MemoryView":1228 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -42331,7 +42287,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1234 + /* "View.MemoryView":1230 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< @@ -42340,7 +42296,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); - /* "View.MemoryView":1238 + /* "View.MemoryView":1234 * * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -42352,7 +42308,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1239 + /* "View.MemoryView":1235 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -42362,7 +42318,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1240 + /* "View.MemoryView":1236 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< @@ -42371,7 +42327,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1239 + /* "View.MemoryView":1235 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -42381,7 +42337,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } } - /* "View.MemoryView":1242 + /* "View.MemoryView":1238 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -42391,7 +42347,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1243 + /* "View.MemoryView":1239 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< @@ -42400,7 +42356,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); - /* "View.MemoryView":1242 + /* "View.MemoryView":1238 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -42410,7 +42366,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, goto __pyx_L9; } - /* "View.MemoryView":1245 + /* "View.MemoryView":1241 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< @@ -42422,7 +42378,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } __pyx_L9:; - /* "View.MemoryView":1247 + /* "View.MemoryView":1243 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< @@ -42432,7 +42388,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":1209 + /* "View.MemoryView":1205 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -42456,7 +42412,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, return __pyx_r; } -/* "View.MemoryView":1252 +/* "View.MemoryView":1248 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -42476,20 +42432,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent #endif __Pyx_RefNannySetupContext("_err_extents", 0); - /* "View.MemoryView":1255 + /* "View.MemoryView":1251 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1255, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -42501,24 +42457,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":1254 + /* "View.MemoryView":1250 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 1254, __pyx_L1_error) + __PYX_ERR(2, 1250, __pyx_L1_error) - /* "View.MemoryView":1252 + /* "View.MemoryView":1248 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -42541,7 +42497,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent return __pyx_r; } -/* "View.MemoryView":1258 +/* "View.MemoryView":1254 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -42562,18 +42518,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1259 + /* "View.MemoryView":1255 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1259, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __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; @@ -42591,14 +42547,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1259, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(2, 1259, __pyx_L1_error) + __PYX_ERR(2, 1255, __pyx_L1_error) - /* "View.MemoryView":1258 + /* "View.MemoryView":1254 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -42622,7 +42578,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, return __pyx_r; } -/* "View.MemoryView":1262 +/* "View.MemoryView":1258 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -42644,7 +42600,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1263 + /* "View.MemoryView":1259 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -42654,14 +42610,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":1264 + /* "View.MemoryView":1260 * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< * else: * raise error */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1264, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -42677,14 +42633,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __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(2, 1264, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 1264, __pyx_L1_error) + __PYX_ERR(2, 1260, __pyx_L1_error) - /* "View.MemoryView":1263 + /* "View.MemoryView":1259 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -42693,7 +42649,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ } - /* "View.MemoryView":1266 + /* "View.MemoryView":1262 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< @@ -42702,10 +42658,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1266, __pyx_L1_error) + __PYX_ERR(2, 1262, __pyx_L1_error) } - /* "View.MemoryView":1262 + /* "View.MemoryView":1258 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -42729,7 +42685,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { return __pyx_r; } -/* "View.MemoryView":1269 +/* "View.MemoryView":1265 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -42756,7 +42712,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ void *__pyx_t_7; int __pyx_t_8; - /* "View.MemoryView":1277 + /* "View.MemoryView":1273 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< @@ -42765,7 +42721,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_tmpdata = NULL; - /* "View.MemoryView":1278 + /* "View.MemoryView":1274 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -42775,7 +42731,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1280 + /* "View.MemoryView":1276 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< @@ -42784,7 +42740,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); - /* "View.MemoryView":1281 + /* "View.MemoryView":1277 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< @@ -42793,7 +42749,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 0; - /* "View.MemoryView":1282 + /* "View.MemoryView":1278 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< @@ -42802,7 +42758,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = 0; - /* "View.MemoryView":1285 + /* "View.MemoryView":1281 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -42812,7 +42768,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1286 + /* "View.MemoryView":1282 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -42821,7 +42777,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); - /* "View.MemoryView":1285 + /* "View.MemoryView":1281 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -42831,7 +42787,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L3; } - /* "View.MemoryView":1287 + /* "View.MemoryView":1283 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -42841,7 +42797,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1288 + /* "View.MemoryView":1284 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< @@ -42850,7 +42806,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); - /* "View.MemoryView":1287 + /* "View.MemoryView":1283 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -42860,7 +42816,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L3:; - /* "View.MemoryView":1290 + /* "View.MemoryView":1286 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -42876,7 +42832,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_v_ndim = __pyx_t_5; - /* "View.MemoryView":1292 + /* "View.MemoryView":1288 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -42888,7 +42844,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1293 + /* "View.MemoryView":1289 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -42898,7 +42854,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1294 + /* "View.MemoryView":1290 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -42908,7 +42864,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1295 + /* "View.MemoryView":1291 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< @@ -42917,7 +42873,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 1; - /* "View.MemoryView":1296 + /* "View.MemoryView":1292 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< @@ -42926,7 +42882,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (__pyx_v_src.strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1294 + /* "View.MemoryView":1290 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -42936,7 +42892,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L7; } - /* "View.MemoryView":1298 + /* "View.MemoryView":1294 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< @@ -42944,11 +42900,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1298, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1294, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":1293 + /* "View.MemoryView":1289 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -42957,7 +42913,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1300 + /* "View.MemoryView":1296 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -42967,16 +42923,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1301 + /* "View.MemoryView":1297 * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1301, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error) - /* "View.MemoryView":1300 + /* "View.MemoryView":1296 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -42986,7 +42942,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } } - /* "View.MemoryView":1303 + /* "View.MemoryView":1299 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -42996,7 +42952,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1305 + /* "View.MemoryView":1301 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -43006,7 +42962,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1306 + /* "View.MemoryView":1302 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< @@ -43015,7 +42971,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); - /* "View.MemoryView":1305 + /* "View.MemoryView":1301 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -43024,17 +42980,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1308 + /* "View.MemoryView":1304 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ - __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1308, __pyx_L1_error) + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1304, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; - /* "View.MemoryView":1309 + /* "View.MemoryView":1305 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< @@ -43043,7 +42999,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_src = __pyx_v_tmp; - /* "View.MemoryView":1303 + /* "View.MemoryView":1299 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -43052,7 +43008,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1311 + /* "View.MemoryView":1307 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -43062,7 +43018,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1314 + /* "View.MemoryView":1310 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -43072,7 +43028,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1315 + /* "View.MemoryView":1311 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< @@ -43081,7 +43037,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); - /* "View.MemoryView":1314 + /* "View.MemoryView":1310 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -43091,7 +43047,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L12; } - /* "View.MemoryView":1316 + /* "View.MemoryView":1312 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -43101,7 +43057,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1317 + /* "View.MemoryView":1313 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< @@ -43110,7 +43066,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); - /* "View.MemoryView":1316 + /* "View.MemoryView":1312 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -43120,7 +43076,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L12:; - /* "View.MemoryView":1319 + /* "View.MemoryView":1315 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -43130,7 +43086,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_v_direct_copy != 0); if (__pyx_t_2) { - /* "View.MemoryView":1321 + /* "View.MemoryView":1317 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -43139,7 +43095,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1322 + /* "View.MemoryView":1318 * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< @@ -43148,7 +43104,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); - /* "View.MemoryView":1323 + /* "View.MemoryView":1319 * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -43157,7 +43113,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1324 + /* "View.MemoryView":1320 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< @@ -43166,7 +43122,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1325 + /* "View.MemoryView":1321 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -43176,7 +43132,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1319 + /* "View.MemoryView":1315 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -43185,7 +43141,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1311 + /* "View.MemoryView":1307 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -43194,7 +43150,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1327 + /* "View.MemoryView":1323 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -43208,25 +43164,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { - /* "View.MemoryView":1330 + /* "View.MemoryView":1326 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1326, __pyx_L1_error) - /* "View.MemoryView":1331 + /* "View.MemoryView":1327 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1327, __pyx_L1_error) - /* "View.MemoryView":1327 + /* "View.MemoryView":1323 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -43235,7 +43191,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1333 + /* "View.MemoryView":1329 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -43244,7 +43200,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1334 + /* "View.MemoryView":1330 * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< @@ -43253,7 +43209,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1335 + /* "View.MemoryView":1331 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -43262,7 +43218,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1337 + /* "View.MemoryView":1333 * refcount_copying(&dst, dtype_is_object, ndim, True) * * free(tmpdata) # <<<<<<<<<<<<<< @@ -43271,7 +43227,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1338 + /* "View.MemoryView":1334 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -43281,7 +43237,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1269 + /* "View.MemoryView":1265 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -43305,7 +43261,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ return __pyx_r; } -/* "View.MemoryView":1341 +/* "View.MemoryView":1337 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -43320,7 +43276,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic int __pyx_t_2; int __pyx_t_3; - /* "View.MemoryView":1345 + /* "View.MemoryView":1341 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< @@ -43329,7 +43285,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); - /* "View.MemoryView":1347 + /* "View.MemoryView":1343 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -43339,7 +43295,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1348 + /* "View.MemoryView":1344 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< @@ -43348,7 +43304,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); - /* "View.MemoryView":1349 + /* "View.MemoryView":1345 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< @@ -43357,7 +43313,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1350 + /* "View.MemoryView":1346 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< @@ -43367,7 +43323,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } - /* "View.MemoryView":1352 + /* "View.MemoryView":1348 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< @@ -43379,7 +43335,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1353 + /* "View.MemoryView":1349 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< @@ -43388,7 +43344,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; - /* "View.MemoryView":1354 + /* "View.MemoryView":1350 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< @@ -43397,7 +43353,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); - /* "View.MemoryView":1355 + /* "View.MemoryView":1351 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -43407,7 +43363,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1341 + /* "View.MemoryView":1337 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -43418,7 +43374,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* function exit code */ } -/* "View.MemoryView":1363 +/* "View.MemoryView":1359 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -43429,7 +43385,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; - /* "View.MemoryView":1367 + /* "View.MemoryView":1363 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -43439,7 +43395,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i __pyx_t_1 = (__pyx_v_dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":1368 + /* "View.MemoryView":1364 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< @@ -43448,7 +43404,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1367 + /* "View.MemoryView":1363 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -43457,7 +43413,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ } - /* "View.MemoryView":1363 + /* "View.MemoryView":1359 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -43468,7 +43424,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i /* function exit code */ } -/* "View.MemoryView":1372 +/* "View.MemoryView":1368 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -43483,7 +43439,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); - /* "View.MemoryView":1375 + /* "View.MemoryView":1371 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< @@ -43492,7 +43448,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1372 + /* "View.MemoryView":1368 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -43507,7 +43463,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif } -/* "View.MemoryView":1378 +/* "View.MemoryView":1374 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -43524,7 +43480,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss int __pyx_t_4; __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - /* "View.MemoryView":1382 + /* "View.MemoryView":1378 * cdef Py_ssize_t i * * for i in range(shape[0]): # <<<<<<<<<<<<<< @@ -43536,7 +43492,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1383 + /* "View.MemoryView":1379 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -43546,7 +43502,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_4) { - /* "View.MemoryView":1384 + /* "View.MemoryView":1380 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -43556,7 +43512,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = (__pyx_v_inc != 0); if (__pyx_t_4) { - /* "View.MemoryView":1385 + /* "View.MemoryView":1381 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< @@ -43565,7 +43521,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); - /* "View.MemoryView":1384 + /* "View.MemoryView":1380 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -43575,7 +43531,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L6; } - /* "View.MemoryView":1387 + /* "View.MemoryView":1383 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< @@ -43587,7 +43543,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L6:; - /* "View.MemoryView":1383 + /* "View.MemoryView":1379 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -43597,7 +43553,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L5; } - /* "View.MemoryView":1389 + /* "View.MemoryView":1385 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -43606,7 +43562,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ /*else*/ { - /* "View.MemoryView":1390 + /* "View.MemoryView":1386 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< @@ -43617,7 +43573,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L5:; - /* "View.MemoryView":1392 + /* "View.MemoryView":1388 * ndim - 1, inc) * * data += strides[0] # <<<<<<<<<<<<<< @@ -43627,7 +43583,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } - /* "View.MemoryView":1378 + /* "View.MemoryView":1374 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -43639,7 +43595,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1398 +/* "View.MemoryView":1394 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -43649,7 +43605,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { - /* "View.MemoryView":1401 + /* "View.MemoryView":1397 * size_t itemsize, void *item, * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -43658,7 +43614,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1402 + /* "View.MemoryView":1398 * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< @@ -43667,7 +43623,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1404 + /* "View.MemoryView":1400 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -43676,7 +43632,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1398 + /* "View.MemoryView":1394 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -43687,7 +43643,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst /* function exit code */ } -/* "View.MemoryView":1408 +/* "View.MemoryView":1404 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -43704,7 +43660,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; - /* "View.MemoryView":1412 + /* "View.MemoryView":1408 * size_t itemsize, void *item) nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< @@ -43713,7 +43669,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_stride = (__pyx_v_strides[0]); - /* "View.MemoryView":1413 + /* "View.MemoryView":1409 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< @@ -43722,7 +43678,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_extent = (__pyx_v_shape[0]); - /* "View.MemoryView":1415 + /* "View.MemoryView":1411 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -43732,7 +43688,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1416 + /* "View.MemoryView":1412 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< @@ -43744,7 +43700,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1417 + /* "View.MemoryView":1413 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< @@ -43753,7 +43709,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); - /* "View.MemoryView":1418 + /* "View.MemoryView":1414 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< @@ -43763,7 +43719,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } - /* "View.MemoryView":1415 + /* "View.MemoryView":1411 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -43773,7 +43729,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t goto __pyx_L3; } - /* "View.MemoryView":1420 + /* "View.MemoryView":1416 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< @@ -43786,7 +43742,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1421 + /* "View.MemoryView":1417 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -43795,7 +43751,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1423 + /* "View.MemoryView":1419 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< @@ -43807,7 +43763,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t } __pyx_L3:; - /* "View.MemoryView":1408 + /* "View.MemoryView":1404 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -44382,9 +44338,6 @@ static PyTypeObject __pyx_type___pyx_array = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif }; static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -44493,9 +44446,6 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif }; static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; @@ -44746,9 +44696,6 @@ static PyTypeObject __pyx_type___pyx_memoryview = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif }; static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; @@ -44884,9 +44831,6 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 - 0, /*tp_vectorcall*/ - #endif }; static PyMethodDef __pyx_methods[] = { @@ -45258,18 +45202,18 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 334, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 400, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 609, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 828, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -45279,65 +45223,65 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< * floating[:] A, integral[:] A_uids, integral[:] A_iids, integral[:] A_user_counts, integral[:] A_item_counts, * floating[:] X, integral[:] X_uids, integral[:] X_aids, integral[:] X_user_counts, integral[:] X_aspect_counts, */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "cornac/models/efm/recom_efm.pyx":337 + /* "cornac/models/efm/recom_efm.pyx":340 * * if self.verbose: * print('Optimization finished!') # <<<<<<<<<<<<<< * * def _build_matrices(self, data_set): */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Optimization_finished); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Optimization_finished); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "cornac/models/efm/recom_efm.pyx":408 + /* "cornac/models/efm/recom_efm.pyx":411 * * if self.verbose: * print('Building matrices completed!') # <<<<<<<<<<<<<< * * return A, X, Y */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Building_matrices_completed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Building_matrices_completed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "cornac/models/efm/recom_efm.pyx":439 + /* "cornac/models/efm/recom_efm.pyx":442 * if self.train_set.is_unk_user(user_idx): * raise ScoreException("Can't make score prediction for (user_id=%d" & user_idx) * item_scores = self.U2.dot(self.U1[user_idx, :]) + self.H2.dot(self.H1[user_idx, :]) # <<<<<<<<<<<<<< * return item_scores * else: */ - __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); - /* "cornac/models/efm/recom_efm.pyx":474 + /* "cornac/models/efm/recom_efm.pyx":477 * if item_indices is None: * item_scores = item_scores * item_rank = item_scores.argsort()[::-1] # <<<<<<<<<<<<<< * else: * num_items = max(self.train_set.num_items, max(item_indices) + 1) */ - __pyx_slice__9 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_slice__9 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__9); __Pyx_GIVEREF(__pyx_slice__9); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -45348,7 +45292,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -45359,7 +45303,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -45370,7 +45314,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -45381,7 +45325,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -45392,7 +45336,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -45403,7 +45347,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "../anaconda3/envs/pre/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../anaconda3/envs/cn/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -45488,58 +45432,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - /* "View.MemoryView":418 + /* "View.MemoryView":414 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - /* "View.MemoryView":495 + /* "View.MemoryView":491 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 495, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - /* "View.MemoryView":520 + /* "View.MemoryView":516 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); - /* "View.MemoryView":570 + /* "View.MemoryView":566 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - /* "View.MemoryView":577 + /* "View.MemoryView":573 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); @@ -45565,14 +45509,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); - /* "View.MemoryView":703 + /* "View.MemoryView":699 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); @@ -45595,123 +45539,123 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - /* "cornac/models/efm/recom_efm.pyx":121 + /* "cornac/models/efm/recom_efm.pyx":124 * """ * * def __init__(self, name="EFM", # <<<<<<<<<<<<<< * num_explicit_factors=40, num_latent_factors=60, num_most_cared_aspects=15, * rating_scale=5.0, alpha=0.85, */ - __pyx_tuple__35 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_num_explicit_factors, __pyx_n_s_num_latent_factors, __pyx_n_s_num_most_cared_aspects, __pyx_n_s_rating_scale, __pyx_n_s_alpha, __pyx_n_s_lambda_x, __pyx_n_s_lambda_y, __pyx_n_s_lambda_u, __pyx_n_s_lambda_h, __pyx_n_s_lambda_v, __pyx_n_s_use_item_aspect_popularity, __pyx_n_s_max_iter, __pyx_n_s_num_threads, __pyx_n_s_trainable, __pyx_n_s_verbose, __pyx_n_s_init_params, __pyx_n_s_seed, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_num_explicit_factors, __pyx_n_s_num_latent_factors, __pyx_n_s_num_most_cared_aspects, __pyx_n_s_rating_scale, __pyx_n_s_alpha, __pyx_n_s_lambda_x, __pyx_n_s_lambda_y, __pyx_n_s_lambda_u, __pyx_n_s_lambda_h, __pyx_n_s_lambda_v, __pyx_n_s_use_item_aspect_popularity, __pyx_n_s_max_iter, __pyx_n_s_num_threads, __pyx_n_s_trainable, __pyx_n_s_verbose, __pyx_n_s_init_params, __pyx_n_s_seed, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(19, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_init, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 121, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(18, ((PyObject*)__pyx_n_u_EFM), ((PyObject *)__pyx_int_40), ((PyObject *)__pyx_int_60), ((PyObject *)__pyx_int_15), ((PyObject*)__pyx_float_5_0), ((PyObject*)__pyx_float_0_85), ((PyObject *)__pyx_int_1), ((PyObject *)__pyx_int_1), ((PyObject*)__pyx_float_0_01), ((PyObject*)__pyx_float_0_01), ((PyObject*)__pyx_float_0_01), ((PyObject *)Py_True), ((PyObject *)__pyx_int_100), ((PyObject *)__pyx_int_0), ((PyObject *)Py_True), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(19, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_init, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(18, ((PyObject*)__pyx_n_u_EFM), ((PyObject *)__pyx_int_40), ((PyObject *)__pyx_int_60), ((PyObject *)__pyx_int_15), ((PyObject*)__pyx_float_5_0), ((PyObject*)__pyx_float_0_85), ((PyObject *)__pyx_int_1), ((PyObject *)__pyx_int_1), ((PyObject*)__pyx_float_0_01), ((PyObject*)__pyx_float_0_01), ((PyObject*)__pyx_float_0_01), ((PyObject *)Py_True), ((PyObject *)__pyx_int_100), ((PyObject *)__pyx_int_0), ((PyObject *)Py_True), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "cornac/models/efm/recom_efm.pyx":151 + /* "cornac/models/efm/recom_efm.pyx":154 * self.num_threads = multiprocessing.cpu_count() * * def _init_params(self): # <<<<<<<<<<<<<< * from ...utils import get_rng * from ...utils.init_utils import uniform */ - __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_get_rng, __pyx_n_s_uniform, __pyx_n_s_rng, __pyx_n_s_num_factors, __pyx_n_s_high); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_get_rng, __pyx_n_s_uniform, __pyx_n_s_rng, __pyx_n_s_num_factors, __pyx_n_s_high); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_init_params_2, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_init_params_2, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 154, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":169 + /* "cornac/models/efm/recom_efm.pyx":172 * high=high, random_state=rng)) * * def fit(self, train_set, val_set=None): # <<<<<<<<<<<<<< * """Fit the model to observations. * */ - __pyx_tuple__40 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_train_set, __pyx_n_s_val_set, __pyx_n_s_A, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_A_user_counts, __pyx_n_s_A_item_counts, __pyx_n_s_A_uids, __pyx_n_s_X_user_counts, __pyx_n_s_X_aspect_counts, __pyx_n_s_X_uids, __pyx_n_s_Y_item_counts, __pyx_n_s_Y_aspect_counts, __pyx_n_s_Y_iids); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_train_set, __pyx_n_s_val_set, __pyx_n_s_A, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_A_user_counts, __pyx_n_s_A_item_counts, __pyx_n_s_A_uids, __pyx_n_s_X_user_counts, __pyx_n_s_X_aspect_counts, __pyx_n_s_X_uids, __pyx_n_s_Y_item_counts, __pyx_n_s_Y_aspect_counts, __pyx_n_s_Y_iids); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_fit, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 169, __pyx_L1_error) - __pyx_tuple__42 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_fit, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< * floating[:] A, integral[:] A_uids, integral[:] A_iids, integral[:] A_user_counts, integral[:] A_item_counts, * floating[:] X, integral[:] X_uids, integral[:] X_aids, integral[:] X_user_counts, integral[:] X_aspect_counts, */ - __pyx_tuple__43 = PyTuple_Pack(52, __pyx_n_s_self, __pyx_n_s_num_threads, __pyx_n_s_A, __pyx_n_s_A_uids, __pyx_n_s_A_iids, __pyx_n_s_A_user_counts, __pyx_n_s_A_item_counts, __pyx_n_s_X, __pyx_n_s_X_uids, __pyx_n_s_X_aids, __pyx_n_s_X_user_counts, __pyx_n_s_X_aspect_counts, __pyx_n_s_Y, __pyx_n_s_Y_iids, __pyx_n_s_Y_aids, __pyx_n_s_Y_item_counts, __pyx_n_s_Y_aspect_counts, __pyx_n_s_U1, __pyx_n_s_U2, __pyx_n_s_V, __pyx_n_s_H1, __pyx_n_s_H2, __pyx_n_s_num_users, __pyx_n_s_num_items, __pyx_n_s_num_aspects, __pyx_n_s_num_explicit_factors, __pyx_n_s_num_latent_factors, __pyx_n_s_lambda_x, __pyx_n_s_lambda_y, __pyx_n_s_lambda_u, __pyx_n_s_lambda_h, __pyx_n_s_lambda_v, __pyx_n_s_prediction, __pyx_n_s_score, __pyx_n_s_loss_2, __pyx_n_s_U1_numerator, __pyx_n_s_U1_denominator, __pyx_n_s_U2_numerator, __pyx_n_s_U2_denominator, __pyx_n_s_V_numerator, __pyx_n_s_V_denominator, __pyx_n_s_H1_numerator, __pyx_n_s_H1_denominator, __pyx_n_s_H2_numerator, __pyx_n_s_H2_denominator, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_n_ratings, __pyx_n_s_eps, __pyx_n_s_t); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_tuple__43 = PyTuple_Pack(52, __pyx_n_s_self, __pyx_n_s_num_threads, __pyx_n_s_A, __pyx_n_s_A_uids, __pyx_n_s_A_iids, __pyx_n_s_A_user_counts, __pyx_n_s_A_item_counts, __pyx_n_s_X, __pyx_n_s_X_uids, __pyx_n_s_X_aids, __pyx_n_s_X_user_counts, __pyx_n_s_X_aspect_counts, __pyx_n_s_Y, __pyx_n_s_Y_iids, __pyx_n_s_Y_aids, __pyx_n_s_Y_item_counts, __pyx_n_s_Y_aspect_counts, __pyx_n_s_U1, __pyx_n_s_U2, __pyx_n_s_V, __pyx_n_s_H1, __pyx_n_s_H2, __pyx_n_s_num_users, __pyx_n_s_num_items, __pyx_n_s_num_aspects, __pyx_n_s_num_explicit_factors, __pyx_n_s_num_latent_factors, __pyx_n_s_lambda_x, __pyx_n_s_lambda_y, __pyx_n_s_lambda_u, __pyx_n_s_lambda_h, __pyx_n_s_lambda_v, __pyx_n_s_prediction, __pyx_n_s_score, __pyx_n_s_loss_2, __pyx_n_s_U1_numerator, __pyx_n_s_U1_denominator, __pyx_n_s_U2_numerator, __pyx_n_s_U2_denominator, __pyx_n_s_V_numerator, __pyx_n_s_V_denominator, __pyx_n_s_H1_numerator, __pyx_n_s_H1_denominator, __pyx_n_s_H2_numerator, __pyx_n_s_H2_denominator, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_n_ratings, __pyx_n_s_eps, __pyx_n_s_t); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(22, 0, 52, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_fit_efm, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(22, 0, 52, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_fit_efm, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 212, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":339 + /* "cornac/models/efm/recom_efm.pyx":342 * print('Optimization finished!') * * def _build_matrices(self, data_set): # <<<<<<<<<<<<<< * sentiment = self.train_set.sentiment * ratings = [] */ - __pyx_tuple__46 = PyTuple_Pack(33, __pyx_n_s_self, __pyx_n_s_data_set, __pyx_n_s_sentiment, __pyx_n_s_ratings, __pyx_n_s_map_uid, __pyx_n_s_map_iid, __pyx_n_s_uid, __pyx_n_s_iid, __pyx_n_s_rating, __pyx_n_s_A, __pyx_n_s_attention_scores, __pyx_n_s_map_aspect_id, __pyx_n_s_sentiment_tup_ids_by_item, __pyx_n_s_user_aspects, __pyx_n_s_user_aspect_count, __pyx_n_s_aid, __pyx_n_s_count, __pyx_n_s_X, __pyx_n_s_quality_scores, __pyx_n_s_sentiment_tup_ids_by_user, __pyx_n_s_item_aspects, __pyx_n_s_item_aspect_count, __pyx_n_s_total_sentiment_by_aspect, __pyx_n_s_tup_id, __pyx_n_s__45, __pyx_n_s_sentiment_polarity, __pyx_n_s_total_sentiment, __pyx_n_s_avg_sentiment, __pyx_n_s_Y, __pyx_n_s_tup_id, __pyx_n_s_tup, __pyx_n_s_tup_id, __pyx_n_s_tup); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(33, __pyx_n_s_self, __pyx_n_s_data_set, __pyx_n_s_sentiment, __pyx_n_s_ratings, __pyx_n_s_map_uid, __pyx_n_s_map_iid, __pyx_n_s_uid, __pyx_n_s_iid, __pyx_n_s_rating, __pyx_n_s_A, __pyx_n_s_attention_scores, __pyx_n_s_map_aspect_id, __pyx_n_s_sentiment_tup_ids_by_item, __pyx_n_s_user_aspects, __pyx_n_s_user_aspect_count, __pyx_n_s_aid, __pyx_n_s_count, __pyx_n_s_X, __pyx_n_s_quality_scores, __pyx_n_s_sentiment_tup_ids_by_user, __pyx_n_s_item_aspects, __pyx_n_s_item_aspect_count, __pyx_n_s_total_sentiment_by_aspect, __pyx_n_s_tup_id, __pyx_n_s__45, __pyx_n_s_sentiment_polarity, __pyx_n_s_total_sentiment, __pyx_n_s_avg_sentiment, __pyx_n_s_Y, __pyx_n_s_tup_id, __pyx_n_s_tup, __pyx_n_s_tup_id, __pyx_n_s_tup); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 33, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_build_matrices, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 33, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_build_matrices, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 342, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":412 + /* "cornac/models/efm/recom_efm.pyx":415 * return A, X, Y * * def _compute_attention_score(self, count): # <<<<<<<<<<<<<< * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * */ - __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_count); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_count); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_compute_attention_score, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_compute_attention_score, 415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 415, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":415 + /* "cornac/models/efm/recom_efm.pyx":418 * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * * def _compute_quality_score(self, sentiment): # <<<<<<<<<<<<<< * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * */ - __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sentiment); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sentiment); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_compute_quality_score, 415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_compute_quality_score, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 418, __pyx_L1_error) - /* "cornac/models/efm/recom_efm.pyx":418 + /* "cornac/models/efm/recom_efm.pyx":421 * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * * def score(self, user_idx, item_idx=None): # <<<<<<<<<<<<<< * """Predict the scores/ratings of a user for an item. * */ - __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_user_idx, __pyx_n_s_item_idx, __pyx_n_s_item_scores, __pyx_n_s_item_score); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_user_idx, __pyx_n_s_item_idx, __pyx_n_s_item_scores, __pyx_n_s_item_score); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_score, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 418, __pyx_L1_error) - __pyx_tuple__54 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_score, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); - /* "cornac/models/efm/recom_efm.pyx":447 + /* "cornac/models/efm/recom_efm.pyx":450 * return item_score * * def rank(self, user_idx, item_indices=None): # <<<<<<<<<<<<<< * """Rank all test items for a given user. * */ - __pyx_tuple__55 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_user_idx, __pyx_n_s_item_indices, __pyx_n_s_X_2, __pyx_n_s_most_cared_aspects_indices, __pyx_n_s_most_cared_X, __pyx_n_s_most_cared_Y, __pyx_n_s_explicit_scores, __pyx_n_s_item_scores, __pyx_n_s_item_rank, __pyx_n_s_num_items); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_tuple__55 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_user_idx, __pyx_n_s_item_indices, __pyx_n_s_X_2, __pyx_n_s_most_cared_aspects_indices, __pyx_n_s_most_cared_X, __pyx_n_s_most_cared_Y, __pyx_n_s_explicit_scores, __pyx_n_s_item_scores, __pyx_n_s_item_rank, __pyx_n_s_num_items); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_rank, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_tuple__57 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cornac_models_efm_recom_efm_pyx, __pyx_n_s_rank, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_tuple__57 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); @@ -45857,16 +45801,12 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) - #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_array.tp_print = 0; - #endif if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) - #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_MemviewEnum.tp_print = 0; - #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -45881,9 +45821,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) - #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryview.tp_print = 0; - #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -45895,15 +45833,13 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) - #if PY_VERSION_HEX < 0x030800B1 + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error) __pyx_type___pyx_memoryviewslice.tp_print = 0; - #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; __Pyx_RefNannyFinishContext(); return 0; @@ -46140,9 +46076,10 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -46161,9 +46098,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; + 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(); @@ -46317,151 +46254,151 @@ if (!__Pyx_RefNanny) { __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_EFM, __pyx_n_s_EFM, (PyObject *) NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_kp_s_Explict_Factor_Models_Parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "cornac/models/efm/recom_efm.pyx":121 + /* "cornac/models/efm/recom_efm.pyx":124 * """ * * def __init__(self, name="EFM", # <<<<<<<<<<<<<< * num_explicit_factors=40, num_latent_factors=60, num_most_cared_aspects=15, * rating_scale=5.0, alpha=0.85, */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_1__init__, 0, __pyx_n_s_EFM___init, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_1__init__, 0, __pyx_n_s_EFM___init, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__37); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 121, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":151 + /* "cornac/models/efm/recom_efm.pyx":154 * self.num_threads = multiprocessing.cpu_count() * * def _init_params(self): # <<<<<<<<<<<<<< * from ...utils import get_rng * from ...utils.init_utils import uniform */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_3_init_params, 0, __pyx_n_s_EFM__init_params, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_3_init_params, 0, __pyx_n_s_EFM__init_params, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_params_2, __pyx_t_4) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_params_2, __pyx_t_4) < 0) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":169 + /* "cornac/models/efm/recom_efm.pyx":172 * high=high, random_state=rng)) * * def fit(self, train_set, val_set=None): # <<<<<<<<<<<<<< * """Fit the model to observations. * */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_5fit, 0, __pyx_n_s_EFM_fit, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_5fit, 0, __pyx_n_s_EFM_fit, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__42); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_fit, __pyx_t_4) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_fit, __pyx_t_4) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cornac/models/efm/recom_efm.pyx":209 + /* "cornac/models/efm/recom_efm.pyx":212 * @cython.boundscheck(False) * @cython.wraparound(False) * def _fit_efm(self, int num_threads, # <<<<<<<<<<<<<< * floating[:] A, integral[:] A_uids, integral[:] A_iids, integral[:] A_user_counts, integral[:] A_item_counts, * floating[:] X, integral[:] X_uids, integral[:] X_aids, integral[:] X_user_counts, integral[:] X_aspect_counts, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_19_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_19_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_short, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_short, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_21_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_21_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_int, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_int, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_23_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_23_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_long, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_float_long, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_25_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_25_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_short, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_short, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_27_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_27_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_int, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_int, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_29_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_29_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_long, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_kp_s_double_long, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_7_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_7_fit_efm, 0, __pyx_n_s_EFM__fit_efm, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_5)->__signatures__ = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_fit_efm, __pyx_t_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_fit_efm, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cornac/models/efm/recom_efm.pyx":339 + /* "cornac/models/efm/recom_efm.pyx":342 * print('Optimization finished!') * * def _build_matrices(self, data_set): # <<<<<<<<<<<<<< * sentiment = self.train_set.sentiment * ratings = [] */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_9_build_matrices, 0, __pyx_n_s_EFM__build_matrices, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_9_build_matrices, 0, __pyx_n_s_EFM__build_matrices, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_build_matrices, __pyx_t_6) < 0) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_build_matrices, __pyx_t_6) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":412 + /* "cornac/models/efm/recom_efm.pyx":415 * return A, X, Y * * def _compute_attention_score(self, count): # <<<<<<<<<<<<<< * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_11_compute_attention_score, 0, __pyx_n_s_EFM__compute_attention_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_11_compute_attention_score, 0, __pyx_n_s_EFM__compute_attention_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_compute_attention_score, __pyx_t_6) < 0) __PYX_ERR(0, 412, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_compute_attention_score, __pyx_t_6) < 0) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":415 + /* "cornac/models/efm/recom_efm.pyx":418 * return 1 + (self.rating_scale - 1) * (2 / (1 + np.exp(-count)) - 1) * * def _compute_quality_score(self, sentiment): # <<<<<<<<<<<<<< * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_13_compute_quality_score, 0, __pyx_n_s_EFM__compute_quality_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_13_compute_quality_score, 0, __pyx_n_s_EFM__compute_quality_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_compute_quality_score, __pyx_t_6) < 0) __PYX_ERR(0, 415, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_compute_quality_score, __pyx_t_6) < 0) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":418 + /* "cornac/models/efm/recom_efm.pyx":421 * return 1 + (self.rating_scale - 1) / (1 + np.exp(-sentiment)) * * def score(self, user_idx, item_idx=None): # <<<<<<<<<<<<<< * """Predict the scores/ratings of a user for an item. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_15score, 0, __pyx_n_s_EFM_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_15score, 0, __pyx_n_s_EFM_score, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__54); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_score, __pyx_t_6) < 0) __PYX_ERR(0, 418, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_score, __pyx_t_6) < 0) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cornac/models/efm/recom_efm.pyx":447 + /* "cornac/models/efm/recom_efm.pyx":450 * return item_score * * def rank(self, user_idx, item_indices=None): # <<<<<<<<<<<<<< * """Rank all test items for a given user. * */ - __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_17rank, 0, __pyx_n_s_EFM_rank, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cornac_6models_3efm_9recom_efm_3EFM_17rank, 0, __pyx_n_s_EFM_rank, NULL, __pyx_n_s_cornac_models_efm_recom_efm, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__57); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rank, __pyx_t_6) < 0) __PYX_ERR(0, 447, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rank, __pyx_t_6) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cornac/models/efm/recom_efm.pyx":41 @@ -46598,29 +46535,29 @@ if (!__Pyx_RefNanny) { __pyx_t_7[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); - /* "View.MemoryView":549 + /* "View.MemoryView":545 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); - /* "View.MemoryView":995 + /* "View.MemoryView":991 * return self.from_object * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 991, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); @@ -47050,7 +46987,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -47121,12 +47058,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, + args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, + args, nargs, k, (int)nk, d, (int)nd, closure); #endif @@ -51057,9 +50994,6 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030400a1 0, #endif -#if PY_VERSION_HEX >= 0x030800b1 - 0, -#endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); @@ -51414,9 +51348,6 @@ static PyTypeObject __pyx_FusedFunctionType_type = { #if PY_VERSION_HEX >= 0x030400a1 0, #endif -#if PY_VERSION_HEX >= 0x030800b1 - 0, -#endif }; static int __pyx_FusedFunction_init(void) { __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type); diff --git a/cornac/models/efm/recom_efm.pyx b/cornac/models/efm/recom_efm.pyx index 8440e5954..a3d1edbe5 100644 --- a/cornac/models/efm/recom_efm.pyx +++ b/cornac/models/efm/recom_efm.pyx @@ -75,7 +75,8 @@ class EFM(Recommender): use_item_aspect_popularity: boolean, optional, default: True When False, item aspect frequency is omitted from item aspect quality computation formular.\ - Specifically, :math:`Y_{ij} = 1 + \frac{N - 1}{1 + e^{-s_{ij}}}` if `p_i` is reviewed on feature `F_j` + Specifically, :math:`Y_{ij} = 1 + \\frac{N - 1}{1 + e^{-s_{ij}}}` + if :math:`p_i` is reviewed on feature :math:`F_j` max_iter: int, optional, default: 100 Maximum number of iterations or the number of epochs. @@ -95,7 +96,8 @@ class EFM(Recommender): When True, running logs are displayed. init_params: dictionary, optional, default: {} - List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V', H1':H1, 'H2':H2} + List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V, 'H1':H1, 'H2':H2} + U1: ndarray, shape (n_users, n_explicit_factors) The user explicit factors, optional initialization via init_params. U2: ndarray, shape (n_ratings, n_explicit_factors) @@ -116,6 +118,7 @@ class EFM(Recommender): Explicit factor models for explainable recommendation based on phrase-level sentiment analysis. In Proceedings of the 37th international ACM SIGIR conference on Research & development in information retrieval (SIGIR '14). ACM, New York, NY, USA, 83-92. DOI: https://doi.org/10.1145/2600428.2609579 + """ def __init__(self, name="EFM", diff --git a/cornac/models/mcf/recom_mcf.py b/cornac/models/mcf/recom_mcf.py index 93f8e2974..bdde10377 100644 --- a/cornac/models/mcf/recom_mcf.py +++ b/cornac/models/mcf/recom_mcf.py @@ -49,16 +49,17 @@ class MCF(Recommender): pre-trained (U and V are not None). item-affinity network: See "cornac/examples/mcf_office.py" for an example of how to use \ - cornac's graph modality to load and provide the ``item-affinity network'' for MCF. + cornac's graph modality to load and provide the "item-affinity network" for MCF. verbose: boolean, optional, default: False When True, some running logs are displayed. init_params: dictionary, optional, default: {} - List of initial parameters, e.g., init_params = {'U':U, 'V':V}. \ - U: a csc_matrix of shape (n_users,k), containing the user latent factors. \ - V: a csc_matrix of shape (n_items,k), containing the item latent factors. \ - Z: a csc_matrix of shape (n_items,k), containing the ``Also-Viewed'' item latent factors. + List of initial parameters, e.g., init_params = {'U':U, 'V':V}. + + U: a csc_matrix of shape (n_users,k), containing the user latent factors. + V: a csc_matrix of shape (n_items,k), containing the item latent factors. + Z: a csc_matrix of shape (n_items,k), containing the "Also-Viewed" item latent factors. seed: int, optional, default: None Random seed for parameters initialization. @@ -67,6 +68,7 @@ class MCF(Recommender): ---------- * Park, Chanyoung, Donghyun Kim, Jinoh Oh, and Hwanjo Yu. "Do Also-Viewed Products Help User Rating Prediction?."\ In Proceedings of WWW, pp. 1113-1122. 2017. + """ def __init__(self, k=5, max_iter=100, learning_rate=0.001, gamma=0.9, lamda=0.001, name="MCF", diff --git a/cornac/models/sorec/recom_sorec.py b/cornac/models/sorec/recom_sorec.py index 5e6fbfb6d..3254e47e2 100644 --- a/cornac/models/sorec/recom_sorec.py +++ b/cornac/models/sorec/recom_sorec.py @@ -49,22 +49,27 @@ class SoRec(Recommender): The name of the recommender model. trainable: boolean, optional, default: True - When False, the model is not trained and Cornac assumes that the model already \ + When False, the model is not trained and Cornac assumes that the model already pre-trained (U, V and Z are not None). verbose: boolean, optional, default: False When True, some running logs are displayed. - init_params: dictionary, optional, default: {'U':None,'V':None} - List of initial parameters, e.g., init_params = {'U':U, 'V':V,'Z':Z}. \ - U: a ndarray of shape (n_users,k), containing the user latent factors. \ - V: a ndarray of shape (n_items,k), containing the item latent factors. \ - Z: a ndarray of shape (n_users,k), containing the social network latent factors. \ + init_params: dictionary, optional, default: {'U':None, 'V':None} + List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'Z':Z}. + + U: a ndarray of shape (n_users, k) + Containing the user latent factors. + V: a ndarray of shape (n_items, k) + Containing the item latent factors. + Z: a ndarray of shape (n_users, k) + Containing the social network latent factors. References ---------- * H. Ma, H. Yang, M. R. Lyu, and I. King. SoRec:Social recommendation using probabilistic matrix factorization. \ CIKM ’08, pages 931–940, Napa Valley, USA, 2008. + """ def __init__(self, name="SoRec", k=5, max_iter=100, learning_rate=0.001, lamda_c=10, lamda=0.001, gamma=0.9, diff --git a/cornac/models/vmf/recom_vmf.py b/cornac/models/vmf/recom_vmf.py index 8f20faf7c..7cc939a60 100644 --- a/cornac/models/vmf/recom_vmf.py +++ b/cornac/models/vmf/recom_vmf.py @@ -63,15 +63,16 @@ class VMF(Recommender): When False, the model is not trained and Cornac assumes that the model is already \ pre-trained (The parameters of the model U, V, P, E are not None). - visual_features : See "cornac/examples/vmf_example.py" for an example of how to use \ - cornac's visual modality to load and provide the ``item visual features'' for VMF. + visual_features: See "cornac/examples/vmf_example.py" for an example of how to use \ + cornac's visual modality to load and provide the "item visual features" for VMF. verbose: boolean, optional, default: False When True, some running logs are displayed. init_params: dictionary, optional, default: {} - List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'P': P, 'E': E}. \ - U: numpy array of shape (n_users,k), user latent factors. \ + List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'P': P, 'E': E}. + + U: numpy array of shape (n_users,k), user latent factors. V: numpy array of shape (n_items,k), item latent factors. P: numpy array of shape (n_users,d), user visual latent factors. E: numpy array of shape (d,c), embedding kernel matrix. @@ -83,6 +84,7 @@ class VMF(Recommender): ---------- * Park, Chanyoung, Donghyun Kim, Jinoh Oh, and Hwanjo Yu. "Do Also-Viewed Products Help User Rating Prediction?."\ In Proceedings of WWW, pp. 1113-1122. 2017. + """ def __init__(self, name="VMF", k=10, d=10, n_epochs=100, batch_size=100, learning_rate=0.001, gamma=0.9, diff --git a/cornac/models/wmf/recom_wmf.py b/cornac/models/wmf/recom_wmf.py index 618228e9a..7139337b9 100644 --- a/cornac/models/wmf/recom_wmf.py +++ b/cornac/models/wmf/recom_wmf.py @@ -52,11 +52,12 @@ class WMF(Recommender): The batch size for SGD. trainable: boolean, optional, default: True - When False, the model is not trained and Cornac assumes that the model already + When False, the model is not trained and Cornac assumes that the model already pre-trained (U and V are not None). init_params: dictionary, optional, default: None List of initial parameters, e.g., init_params = {'U':U, 'V':V} + U: ndarray, shape (n_users,k) The user latent factors, optional initialization via init_params. V: ndarray, shape (n_items,k) @@ -67,10 +68,10 @@ class WMF(Recommender): References ---------- - * Hu, Y., Koren, Y., & Volinsky, C. (2008, December). Collaborative filtering for implicit feedback datasets. + * Hu, Y., Koren, Y., & Volinsky, C. (2008, December). Collaborative filtering for implicit feedback datasets. \ In 2008 Eighth IEEE International Conference on Data Mining (pp. 263-272). - * Pan, R., Zhou, Y., Cao, B., Liu, N. N., Lukose, R., Scholz, M., & Yang, Q. (2008, December). + * Pan, R., Zhou, Y., Cao, B., Liu, N. N., Lukose, R., Scholz, M., & Yang, Q. (2008, December). \ One-class collaborative filtering. In 2008 Eighth IEEE International Conference on Data Mining (pp. 502-511). """ diff --git a/docs/source/models.rst b/docs/source/models.rst index f932206f8..ff45d5ae8 100644 --- a/docs/source/models.rst +++ b/docs/source/models.rst @@ -21,7 +21,7 @@ VAE for Collaborative Filtering (VAECF) :members: Collaborative Variational Autoencoder (CVAE) ---------------------------------------- +---------------------------------------------- .. automodule:: cornac.models.cvae.recom_cvae :members: @@ -46,12 +46,12 @@ Multi-Layer Perceptron (MLP) :members: Neural Matrix Factorization (NeuMF) ------------------------------------------ +---------------------------------------------- .. automodule:: cornac.models.ncf.recom_neumf :members: Online Indexable Bayesian Personalized Ranking (OIBPR) -------------------------------------------------------- +----------------------------------------------------------- .. automodule:: cornac.models.online_ibpr.recom_online_ibpr :members: @@ -66,7 +66,7 @@ Collaborative Deep Ranking (CDR) :members: Collaborative Ordinal Embedding (COE) -------------------------------------------------------- +-------------------------------------------- .. automodule:: cornac.models.coe.recom_coe :members: @@ -86,17 +86,17 @@ Visual Bayesian Personalized Ranking (VBPR) :members: Collaborative Deep Learning (CDL) ---------------------------------------- +--------------------------------------------- .. automodule:: cornac.models.cdl.recom_cdl :members: Hierarchical Poisson Factorization (HPF) ----------------------------------------- +-------------------------------------------- .. automodule:: cornac.models.hpf.recom_hpf :members: Explicit Factor Model (EFM) ----------------------------------------- +-------------------------------------------- .. automodule:: cornac.models.efm.recom_efm :members: @@ -106,47 +106,47 @@ Social Bayesian Personalized Ranking (SBPR) :members: Hidden Factors and Hidden Topics (HFT) ------------------------------------------ +--------------------------------------------- .. automodule:: cornac.models.hft.recom_hft :members: Collaborative Topic Modeling (CTR) ---------------------------------------- +------------------------------------------- .. automodule:: cornac.models.ctr.recom_ctr :members: Baseline Only ----------------------------------------- +--------------------------------------------------- .. autoclass:: cornac.models.baseline_only.recom_bo :members: Bayesian Personalized Ranking (BPR) ----------------------------------------- +---------------------------------------------- .. autoclass:: cornac.models.bpr.recom_bpr.BPR :members: Matrix Factorization (MF) ----------------------------------------- +------------------------------------------ .. automodule:: cornac.models.mf.recom_mf :members: Non-negative Matrix Factorization (NMF) ------------------------------------------ +-------------------------------------------- .. automodule:: cornac.models.nmf.recom_nmf :members: Probabilitic Matrix Factorization (PMF) ------------------------------------------ +-------------------------------------------- .. automodule:: cornac.models.pmf.recom_pmf :members: Singular Value Decomposition (SVD) ------------------------------------------ +------------------------------------------- .. automodule:: cornac.models.svd.recom_svd :members: Social Recommendation using PMF (SoRec) ------------------------------------------ +------------------------------------------------ .. automodule:: cornac.models.sorec.recom_sorec :members: