This is an automated email from the ASF dual-hosted git repository.
baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/main by this push:
new a83a17acbf [MINOR] Python set log4j
a83a17acbf is described below
commit a83a17acbfd44d7c5ba4de1a318e2a50f7d7628d
Author: Sebastian Baunsgaard <[email protected]>
AuthorDate: Fri Jan 5 18:16:32 2024 +0100
[MINOR] Python set log4j
---
.github/workflows/python.yml | 2 ++
.../python/systemds/operator/algorithm/__init__.py | 6 +++++
.../systemds/operator/algorithm/builtin/auc.py | 2 +-
.../builtin/{auc.py => img_rotate_linearized.py} | 27 +++++++++++---------
.../{auc.py => img_sample_pairing_linearized.py} | 25 ++++++++++---------
.../builtin/{auc.py => img_shear_linearized.py} | 29 +++++++++++++---------
6 files changed, 54 insertions(+), 37 deletions(-)
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 8b345cf79d..6e56dc812e 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -112,6 +112,7 @@ jobs:
export SYSTEMDS_ROOT=$(pwd)
export PATH=$SYSTEMDS_ROOT/bin:$PATH
export SYSDS_QUIET=1
+ export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
cd src/main/python
unittest-parallel -t . -s tests
# python -m unittest discover -s tests -p 'test_*.py'
@@ -119,6 +120,7 @@ jobs:
- name: Run all python tests no environment
run: |
+ export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
cd src/main/python
unittest-parallel -t . -s tests
# python -m unittest discover -s tests -p 'test_*.py'
diff --git a/src/main/python/systemds/operator/algorithm/__init__.py
b/src/main/python/systemds/operator/algorithm/__init__.py
index 52c470d201..690bfe07e8 100644
--- a/src/main/python/systemds/operator/algorithm/__init__.py
+++ b/src/main/python/systemds/operator/algorithm/__init__.py
@@ -90,8 +90,11 @@ from .builtin.img_mirror_linearized import
img_mirror_linearized
from .builtin.img_posterize import img_posterize
from .builtin.img_posterize_linearized import img_posterize_linearized
from .builtin.img_rotate import img_rotate
+from .builtin.img_rotate_linearized import img_rotate_linearized
from .builtin.img_sample_pairing import img_sample_pairing
+from .builtin.img_sample_pairing_linearized import
img_sample_pairing_linearized
from .builtin.img_shear import img_shear
+from .builtin.img_shear_linearized import img_shear_linearized
from .builtin.img_transform import img_transform
from .builtin.img_transform_linearized import img_transform_linearized
from .builtin.img_translate import img_translate
@@ -263,8 +266,11 @@ __all__ = ['WoE',
'img_posterize',
'img_posterize_linearized',
'img_rotate',
+ 'img_rotate_linearized',
'img_sample_pairing',
+ 'img_sample_pairing_linearized',
'img_shear',
+ 'img_shear_linearized',
'img_transform',
'img_transform_linearized',
'img_translate',
diff --git a/src/main/python/systemds/operator/algorithm/builtin/auc.py
b/src/main/python/systemds/operator/algorithm/builtin/auc.py
index 8df6835311..b5b3b67e7d 100644
--- a/src/main/python/systemds/operator/algorithm/builtin/auc.py
+++ b/src/main/python/systemds/operator/algorithm/builtin/auc.py
@@ -32,7 +32,7 @@ from systemds.utils.consts import VALID_INPUT_TYPES
def auc(Y: Matrix,
P: Matrix):
"""
- This builting function computes the area under the ROC curve (AUC)
+ This builtin function computes the area under the ROC curve (AUC)
for binary classifiers.
diff --git a/src/main/python/systemds/operator/algorithm/builtin/auc.py
b/src/main/python/systemds/operator/algorithm/builtin/img_rotate_linearized.py
similarity index 58%
copy from src/main/python/systemds/operator/algorithm/builtin/auc.py
copy to
src/main/python/systemds/operator/algorithm/builtin/img_rotate_linearized.py
index 8df6835311..f3698c93dd 100644
--- a/src/main/python/systemds/operator/algorithm/builtin/auc.py
+++
b/src/main/python/systemds/operator/algorithm/builtin/img_rotate_linearized.py
@@ -20,7 +20,7 @@
# -------------------------------------------------------------
# Autogenerated By : src/main/python/generator/generator.py
-# Autogenerated From : scripts/builtin/auc.dml
+# Autogenerated From : scripts/builtin/img_rotate_linearized.dml
from typing import Dict, Iterable
@@ -29,21 +29,24 @@ from systemds.script_building.dag import OutputType
from systemds.utils.consts import VALID_INPUT_TYPES
-def auc(Y: Matrix,
- P: Matrix):
+def img_rotate_linearized(img_in: Matrix,
+ radians: float,
+ fill_value: float,
+ s_cols: int,
+ s_rows: int):
"""
- This builting function computes the area under the ROC curve (AUC)
- for binary classifiers.
+ The Linearized Image Rotate function rotates the linearized input images
counter-clockwise around the center.
+ Uses nearest neighbor sampling.
- :param Y: Binary response vector (shape: n x 1), in -1/+1 or 0/1 encoding
- :param P: Prediction scores (predictor such as estimated probabilities)
- for true class (shape: n x 1), assumed in [0,1]
- :return: Area under the ROC curve (AUC)
+ :param img_in: Linearized input images as 2D matrix with top left corner
at [1, 1]
+ :param radians: The value by which to rotate in radian.
+ :param fill_value: The background color revealed by the rotation
+ :return: Output images in linearized form as 2D matrix with top left
corner at [1, 1]
"""
- params_dict = {'Y': Y, 'P': P}
- return Matrix(Y.sds_context,
- 'auc',
+ params_dict = {'img_in': img_in, 'radians': radians, 'fill_value':
fill_value, 's_cols': s_cols, 's_rows': s_rows}
+ return Matrix(img_in.sds_context,
+ 'img_rotate_linearized',
named_input_nodes=params_dict)
diff --git a/src/main/python/systemds/operator/algorithm/builtin/auc.py
b/src/main/python/systemds/operator/algorithm/builtin/img_sample_pairing_linearized.py
similarity index 62%
copy from src/main/python/systemds/operator/algorithm/builtin/auc.py
copy to
src/main/python/systemds/operator/algorithm/builtin/img_sample_pairing_linearized.py
index 8df6835311..218e548048 100644
--- a/src/main/python/systemds/operator/algorithm/builtin/auc.py
+++
b/src/main/python/systemds/operator/algorithm/builtin/img_sample_pairing_linearized.py
@@ -20,7 +20,7 @@
# -------------------------------------------------------------
# Autogenerated By : src/main/python/generator/generator.py
-# Autogenerated From : scripts/builtin/auc.dml
+# Autogenerated From : scripts/builtin/img_sample_pairing_linearized.dml
from typing import Dict, Iterable
@@ -29,21 +29,22 @@ from systemds.script_building.dag import OutputType
from systemds.utils.consts import VALID_INPUT_TYPES
-def auc(Y: Matrix,
- P: Matrix):
+def img_sample_pairing_linearized(img_in1: Matrix,
+ img_in2: Matrix,
+ weight: float):
"""
- This builting function computes the area under the ROC curve (AUC)
- for binary classifiers.
+ The image sample pairing function blends two images together.
- :param Y: Binary response vector (shape: n x 1), in -1/+1 or 0/1 encoding
- :param P: Prediction scores (predictor such as estimated probabilities)
- for true class (shape: n x 1), assumed in [0,1]
- :return: Area under the ROC curve (AUC)
+ :param img_in1: input matrix/image (every row is a linearized image)
+ :param img_in2: Second input image (one image represented as a single row
linearized matrix)
+ :param weight: The weight given to the second image.
+ 0 means only img_in1, 1 means only img_in2 will be visible
+ :return: Output image
"""
- params_dict = {'Y': Y, 'P': P}
- return Matrix(Y.sds_context,
- 'auc',
+ params_dict = {'img_in1': img_in1, 'img_in2': img_in2, 'weight': weight}
+ return Matrix(img_in1.sds_context,
+ 'img_sample_pairing_linearized',
named_input_nodes=params_dict)
diff --git a/src/main/python/systemds/operator/algorithm/builtin/auc.py
b/src/main/python/systemds/operator/algorithm/builtin/img_shear_linearized.py
similarity index 56%
copy from src/main/python/systemds/operator/algorithm/builtin/auc.py
copy to
src/main/python/systemds/operator/algorithm/builtin/img_shear_linearized.py
index 8df6835311..94cc010384 100644
--- a/src/main/python/systemds/operator/algorithm/builtin/auc.py
+++
b/src/main/python/systemds/operator/algorithm/builtin/img_shear_linearized.py
@@ -20,7 +20,7 @@
# -------------------------------------------------------------
# Autogenerated By : src/main/python/generator/generator.py
-# Autogenerated From : scripts/builtin/auc.dml
+# Autogenerated From : scripts/builtin/img_shear_linearized.dml
from typing import Dict, Iterable
@@ -29,21 +29,26 @@ from systemds.script_building.dag import OutputType
from systemds.utils.consts import VALID_INPUT_TYPES
-def auc(Y: Matrix,
- P: Matrix):
+def img_shear_linearized(img_in: Matrix,
+ shear_x: float,
+ shear_y: float,
+ fill_value: float,
+ s_cols: int,
+ s_rows: int):
"""
- This builting function computes the area under the ROC curve (AUC)
- for binary classifiers.
+ This function applies a shearing transformation to linearized images.
+ Uses nearest neighbor sampling.
- :param Y: Binary response vector (shape: n x 1), in -1/+1 or 0/1 encoding
- :param P: Prediction scores (predictor such as estimated probabilities)
- for true class (shape: n x 1), assumed in [0,1]
- :return: Area under the ROC curve (AUC)
+ :param img_in: Linearized input images as 2D matrix with top left corner
at [1, 1]
+ :param shear_x: Shearing factor for horizontal shearing
+ :param shear_y: Shearing factor for vertical shearing
+ :param fill_value: The background color revealed by the shearing
+ :return: Output images in linearized form as 2D matrix with top left
corner at [1, 1]
"""
- params_dict = {'Y': Y, 'P': P}
- return Matrix(Y.sds_context,
- 'auc',
+ params_dict = {'img_in': img_in, 'shear_x': shear_x, 'shear_y': shear_y,
'fill_value': fill_value, 's_cols': s_cols, 's_rows': s_rows}
+ return Matrix(img_in.sds_context,
+ 'img_shear_linearized',
named_input_nodes=params_dict)