diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d42c6c..d8cd09a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,27 +11,27 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.8.0 hooks: - id: black name: "Black: The uncompromising Python code formatter" - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: "Sort Imports" args: [ "--profile black" ] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: @@ -41,13 +41,13 @@ repos: - "*.bib,*.ipynb" - repo: https://github.com/asottile/pyupgrade - rev: v3.13.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [ --py36-plus ] - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.7.10 hooks: - id: bandit language_version: python3 @@ -67,7 +67,7 @@ repos: - repo: https://github.com/kynan/nbstripout - rev: 0.6.1 + rev: 0.7.1 hooks: - id: nbstripout args: diff --git a/examples/nbs/02-TextClassification.ipynb b/examples/nbs/02-TextClassification.ipynb index f80b4fa..a8f06c1 100644 --- a/examples/nbs/02-TextClassification.ipynb +++ b/examples/nbs/02-TextClassification.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "52697382", + "id": "0", "metadata": { "id": "52697382" }, @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e130bd40", + "id": "1", "metadata": { "id": "e130bd40" }, @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "592802fe", + "id": "2", "metadata": { "id": "592802fe" }, @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "uTrRNUfn5wg4", + "id": "3", "metadata": { "id": "uTrRNUfn5wg4" }, @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf38e2b8", + "id": "4", "metadata": { "id": "bf38e2b8" }, @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fc8603f", + "id": "5", "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "pXjv4W2hSs20", + "id": "6", "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f5d0474", + "id": "7", "metadata": { "id": "9f5d0474", "pycharm": { @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a9c19a3", + "id": "8", "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0b96bd0-3949-4dd5-b6d9-4fa6ac213e30", + "id": "9", "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -536,7 +536,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a95bc01-4291-49a8-bea7-c76ba64bf42a", + "id": "10", "metadata": { "colab": { "base_uri": "https://localhost:8080/", diff --git a/examples/nbs/04-RayDataset.ipynb b/examples/nbs/04-RayDataset.ipynb index 4e9714b..b6564c1 100644 --- a/examples/nbs/04-RayDataset.ipynb +++ b/examples/nbs/04-RayDataset.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9a226830", + "id": "0", "metadata": { "pycharm": { "name": "#%% md\n" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fffc779", + "id": "1", "metadata": { "pycharm": { "name": "#%%\n" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b94e30dd", + "id": "2", "metadata": { "pycharm": { "name": "#%%\n" @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3822e6bb", + "id": "3", "metadata": { "pycharm": { "name": "#%%\n" @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c53a4e2f", + "id": "4", "metadata": { "pycharm": { "name": "#%%\n" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31ac27eb", + "id": "5", "metadata": { "pycharm": { "name": "#%%\n" diff --git a/examples/nbs/05-model_fit.ipynb b/examples/nbs/05-model_fit.ipynb index ef32702..465968e 100644 --- a/examples/nbs/05-model_fit.ipynb +++ b/examples/nbs/05-model_fit.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "eb3a591f", + "id": "0", "metadata": {}, "source": [ "\"Open" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62f766aa", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5794bc62", + "id": "2", "metadata": {}, "outputs": [ { @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa61d539", + "id": "3", "metadata": {}, "outputs": [ { @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4be173e", + "id": "4", "metadata": {}, "outputs": [ { diff --git a/examples/nbs/06-AutoModel_fit.ipynb b/examples/nbs/06-AutoModel_fit.ipynb index 7244c37..8ce77f8 100644 --- a/examples/nbs/06-AutoModel_fit.ipynb +++ b/examples/nbs/06-AutoModel_fit.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6f5e7c30", + "id": "0", "metadata": {}, "source": [ "\"Open" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "29409c2e", + "id": "1", "metadata": {}, "source": [ "This example shows how to search hyperparameters for a model with Tuner module." @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "babe34df", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b61db9fd", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52430b02", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "067473d3", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c46e0094", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "dd8d5d58", + "id": "7", "metadata": {}, "source": [ "## Registering hyperparameters\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f16828b3", + "id": "8", "metadata": {}, "outputs": [ { @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b4af23b", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef6926ed", + "id": "10", "metadata": {}, "outputs": [ { @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "85178f72", + "id": "11", "metadata": {}, "source": [ "### The second way to register hyperparameters is to use Tuner module." @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad2f4f8f", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -388,7 +388,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b1f7c70", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3dccb5e", + "id": "14", "metadata": {}, "outputs": [ { diff --git a/gradsflow/data/common.py b/gradsflow/data/common.py index 0d281a0..477cc25 100644 --- a/gradsflow/data/common.py +++ b/gradsflow/data/common.py @@ -1,4 +1,5 @@ """Provide some common functionalities/utilities for Datasets""" + # Copyright (c) 2021 GradsFlow. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/gradsflow/data/image.py b/gradsflow/data/image.py index d19ea69..19df7d4 100644 --- a/gradsflow/data/image.py +++ b/gradsflow/data/image.py @@ -1,4 +1,5 @@ """Data loader for image dataset""" + # Copyright (c) 2021 GradsFlow. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/gradsflow/models/base.py b/gradsflow/models/base.py index 1022f0c..de988e3 100644 --- a/gradsflow/models/base.py +++ b/gradsflow/models/base.py @@ -92,16 +92,13 @@ def forward(self, x): return self.learner(x) # skipcp: PTC-W0049 - def backward(self, loss): - ... + def backward(self, loss): ... # skipcp: PTC-W0049 - def eval(self): - ... + def eval(self): ... # skipcp: PTC-W0049 - def train(self): - ... + def train(self): ... class BaseModel(Base):