Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
JaxUtils
provides utility functions for the JaxGaussianProcesses
ecosystem.
jaxutils.PyTree
is a mixin class for registering a python class as a JAX PyTree. You would define your Python class as follows.
class MyClass(jaxutils.PyTree):
...
import jaxutils
from jaxtyping import Float, Array
class Line(jaxutils.PyTree):
def __init__(self, gradient: Float[Array, "1"], intercept: Float[Array, "1"]) -> None
self.gradient = gradient
self.intercept = intercept
def y(self, x: Float[Array, "N"]) -> Float[Array, "N"]
return x * self.gradient + self.intercept
jaxutils.Dataset
is a datset abstraction. In future, we wish to extend this to a heterotopic and isotopic data abstraction.
import jaxutils
import jax.numpy as jnp
# Inputs
X = jnp.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
# Outputs
y = jnp.array([[7.0], [8.0], [9.0]])
# Datset
D = jaxutils.Dataset(X=X, y=y)
print(f'The number of datapoints is {D.n}')
print(f'The input dimension is {D.in_dim}')
print(f'The output dimension is {D.out_dim}')
print(f'The input data is {D.X}')
print(f'The output data is {D.y}')
print(f'The data is supervised {D.is_supervised()}')
print(f'The data is unsupervised {D.is_unsupervised()}')
The number of datapoints is 3
The input dimension is 2
The output dimension is 1
The input data is [[1. 2.]
[3. 4.]
[5. 6.]]
The output data is [[7.]
[8.]
[9.]]
The data is supervised True
The data is unsupervised False
You can also add dataset together to concatenate them.
# New inputs
X_new = jnp.array([[1.5, 2.5], [3.5, 4.5], [5.5, 6.5]])
# New outputs
y_new = jnp.array([[7.0], [8.0], [9.0]])
# New dataset
D_new = jaxutils.Dataset(X=X_new, y=y_new)
# Concatenate the two datasets
D = D + D_new
print(f'The number of datapoints is {D.n}')
print(f'The input dimension is {D.in_dim}')
print(f'The output dimension is {D.out_dim}')
print(f'The input data is {D.X}')
print(f'The output data is {D.y}')
print(f'The data is supervised {D.is_supervised()}')
print(f'The data is unsupervised {D.is_unsupervised()}')
The number of datapoints is 6
The input dimension is 2
The output dimension is 1
The input data is [[1. 2. ]
[3. 4. ]
[5. 6. ]
[1.5 2.5]
[3.5 4.5]
[5.5 6.5]]
The output data is [[7.]
[8.]
[9.]
[7.]
[8.]
[9.]]
The data is supervised True
The data is unsupervised False
FAQs
Utility functions for JaxGaussianProcesses
We found that jaxutils-nightly demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.