purem 2.1.3__py3-none-any.whl → 2.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
purem/core.py CHANGED
@@ -109,15 +109,27 @@ class Purem:
109
109
  self._set_binary()
110
110
 
111
111
  def softmax(self, array: ndarray) -> ndarray:
112
- array_size = len(array)
113
- array = array.astype(np.float32, copy=False)
114
- shifted_arr = np.empty(array_size, dtype=np.float32)
112
+ shifted_arr = np.empty(array.size, dtype=np.float32)
115
113
  _compute_shifted_jit(array, shifted_arr)
116
114
  ptr = shifted_arr.ctypes.data_as(ctypes.POINTER(ctypes.c_float))
117
- self._lib.purem(ptr, array_size)
115
+ self._lib.purem(ptr, array.size)
118
116
  return shifted_arr
119
117
 
120
- def clean_softmax(self, arr: [np.float32], size) -> List[any]:
118
+ def softmax_pure(self, arr, size) -> List[any]:
119
+ """
120
+ Compute the softmax of an array using a pure implementation.
121
+
122
+ The softmax function is used to normalize an input array into a probability
123
+ distribution. It is often used in machine learning for classification tasks
124
+ where the output represents probabilities of different classes. This method
125
+ employs a pure implementation by calling a pre-defined library function.
126
+
127
+ :param arr: The input array containing numeric values to be transformed
128
+ into a probability distribution.
129
+ :param size: The size of the input array `arr`.
130
+ :return: A list representing the normalized probability distribution obtained
131
+ by applying the softmax function.
132
+ """
121
133
  return self._lib.purem(arr, size)
122
134
 
123
135
  def _build_url(self, config: dict) -> Optional[str]:
@@ -1,19 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: purem
3
- Version: 2.1.3
4
- Summary: High-performance mapping function for mixed-type arrays
3
+ Version: 2.1.5
4
+ Summary: The official high-performance mapping function for mixed-type arrays powered by Work TIF Ltd.
5
5
  Author-email: Raman Marozau <raman@worktif.com>
6
6
  License-Expression: BUSL-1.1
7
7
  Project-URL: Homepage, https://github.com/worktif/purem
8
8
  Project-URL: Documentation, https://worktif.com/docs/basic-usage
9
9
  Keywords: mapping,performance,numpy,arrays
10
- Classifier: Programming Language :: Python
11
- Classifier: Programming Language :: Python :: 3
10
+ Classifier: Typing :: Typed
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
12
15
  Classifier: Programming Language :: Python :: 3.11
13
16
  Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Operating System :: OS Independent
14
19
  Classifier: Operating System :: MacOS
15
20
  Classifier: Operating System :: Unix
16
21
  Classifier: Operating System :: POSIX
22
+ Classifier: Operating System :: POSIX :: Linux
23
+ Classifier: Operating System :: Microsoft :: Windows
17
24
  Requires-Python: >=3.11
18
25
  Description-Content-Type: text/x-rst
19
26
  License-File: LICENSE
@@ -42,6 +49,10 @@ Purem - High-Performance Mapping Operations
42
49
  :target: https://pypi.org/project/purem/
43
50
  :alt: PyPI version
44
51
 
52
+ .. image:: https://img.shields.io/badge/architecture-x86--64-blue.svg
53
+ :target: https://refspecs.linuxfoundation.org/elf/x86_64-abi-0.99.pdf
54
+ :alt: Architecture Processor
55
+
45
56
  .. image:: https://img.shields.io/badge/license-BUSL--1.1-blue.svg
46
57
  :target: https://worktif.com/documents/terms-of-service
47
58
  :alt: License: BUSL-1.1
@@ -1,12 +1,12 @@
1
1
  purem/__init__.py,sha256=zF_hOKYn8X3jeoBxQ9X1irDi6HCPQ-HRcMP5fcocaNw,141
2
- purem/core.py,sha256=53S0D8TfzVl0TTm1Elf_zQRYFyTbZ3VlhdrpnVVNxEs,10036
2
+ purem/core.py,sha256=urg3JSdg2A-iVjYHJYPLnvNDPwUP5PElECAtSK1HRQY,10677
3
3
  purem/env_config.py,sha256=q1zOaiQLgqACfpU9d21kh004RSLjomORC8ZIvqFdnZE,2667
4
4
  purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
5
5
  purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
6
6
  purem/logger.py,sha256=bs7jtx1cHmyuM6Irdcq60gTMURCai2pi5MIUB3TQcSQ,1243
7
7
  purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
8
- purem-2.1.3.dist-info/licenses/LICENSE,sha256=btmdQkvGxH-SryIGO_D4TpIzD7dZ8Y6z9M33WxCb1rI,1633
9
- purem-2.1.3.dist-info/METADATA,sha256=qHlAZtUvaMITKV0aAAhOlkivjcKxRu1sR5OecsYpo64,5116
10
- purem-2.1.3.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
11
- purem-2.1.3.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
12
- purem-2.1.3.dist-info/RECORD,,
8
+ purem-2.1.5.dist-info/licenses/LICENSE,sha256=5WFXHK6Xc_wj2EtvzVtd9TIC4cWEZJS8ECNTuvutsiE,1636
9
+ purem-2.1.5.dist-info/METADATA,sha256=S_9-OUO4v3KMZ3dAl8hIK_v3Hwl-t2iz6hjfEB8cUvY,5672
10
+ purem-2.1.5.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
11
+ purem-2.1.5.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
12
+ purem-2.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Parameters
4
4
  Licensor: Raman Marozau, sa.marozau@gmail.com
5
- Licensed Work: React Serverless <react-serverless>
5
+ Licensed Work: Purem by Work TIF Ltd <purem-work-tif>
6
6
  Change Date: Never
7
7
  Change License: Proprietary License
8
8
  Additional Use Grant: Free for personal and non-commercial research use only.