Skip to content

Commit

Permalink
Merge branch 'main' into 522-add-fnn-functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
sibre28 authored Jan 18, 2024
2 parents a1dc77e + 96d8ecc commit 3b9f634
Show file tree
Hide file tree
Showing 176 changed files with 1,873 additions and 1,380 deletions.
14 changes: 14 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [0.17.1](https://github.com/Safe-DS/Library/compare/v0.17.0...v0.17.1) (2024-01-11)


### Bug Fixes

* update `torch` ([#527](https://github.com/Safe-DS/Library/issues/527)) ([6934d1d](https://github.com/Safe-DS/Library/commit/6934d1d1820e9e0d1b8877cafdffc449595dca29))

## [0.17.0](https://github.com/Safe-DS/Library/compare/v0.16.0...v0.17.0) (2024-01-11)


### Features

* change image class to use PyTorch tensors and methods ([#506](https://github.com/Safe-DS/Library/issues/506)) ([efa2b61](https://github.com/Safe-DS/Library/commit/efa2b61c4c1d3a54f8b94ddb2cb62792a03c1b85)), closes [#505](https://github.com/Safe-DS/Library/issues/505)

## [0.16.0](https://github.com/Safe-DS/Library/compare/v0.15.0...v0.16.0) (2023-11-22)


Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/image_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"source": [
"from safeds.data.image.containers import Image\n",
"\n",
"plane = Image.from_png_file(\"data/plane.png\")\n",
"plane = Image.from_file(\"data/plane.png\")\n",
"plane"
]
},
Expand Down Expand Up @@ -175,7 +175,7 @@
"execution_count": null,
"outputs": [],
"source": [
"plane.adjust_color_balance(0.5)"
"# plane.adjust_color_balance(0.5)"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -280,7 +280,7 @@
"execution_count": null,
"outputs": [],
"source": [
"plane.find_edges()\n"
"# plane.find_edges()\n"
],
"metadata": {
"collapsed": false
Expand All @@ -289,7 +289,7 @@
{
"cell_type": "markdown",
"source": [
"13. Add gaussian noise to the `Image`. A higher `standard_deviation` will result in a noisier `Image`:\n"
"13. Add noise to the `Image`. A higher `standard_deviation` will result in a noisier `Image`:\n"
],
"metadata": {
"collapsed": false
Expand All @@ -300,7 +300,7 @@
"execution_count": null,
"outputs": [],
"source": [
"plane.add_gaussian_noise(standard_deviation=0.1)\n"
"plane.add_noise(standard_deviation=0.1)\n"
],
"metadata": {
"collapsed": false
Expand Down
1,797 changes: 1,007 additions & 790 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "safe-ds"
version = "0.16.0"
version = "0.17.1"
description = "A user-friendly library for Data Science in Python."
authors = ["Lars Reimann <[email protected]>"]
license = "MIT"
Expand All @@ -23,6 +23,8 @@ pillow = ">=9.5,<11.0"
scikit-image = ">=0.21,<0.23"
scikit-learn = "^1.2.0"
seaborn = "^0.13.0"
torch = {version = "^2.1.2", source = "torch_cuda118"}
torchvision = {version = "^0.16.2", source = "torch_cuda118"}

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.1"
Expand All @@ -43,11 +45,17 @@ mkdocs-literate-nav = "^0.6.0"
mkdocs-material = "^9.1.2"
mkdocs-section-index = "^0.3.5"

[[tool.poetry.source]]
name = "torch_cuda118"
url = "https://download.pytorch.org/whl/cu118"
priority = "explicit"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
addopts = "--snapshot-warn-unused"
filterwarnings = [
"ignore:Deprecated call to `pkg_resources.declare_namespace",
"ignore:Jupyter is migrating its paths to use standard platformdirs"
Expand Down
7 changes: 7 additions & 0 deletions src/safeds/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Configuration for Safe-DS."""

from ._device import _get_device

__all__ = [
"_get_device",
]
6 changes: 6 additions & 0 deletions src/safeds/config/_device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import torch
from torch.types import Device


def _get_device() -> Device:
return torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
Loading

0 comments on commit 3b9f634

Please sign in to comment.