diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 94df8e5..f954564 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,13 +1,16 @@ name: Docs on: [push, pull_request, workflow_dispatch] permissions: - contents: write + contents: write + jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + with: + python-version: '3.8' # Use Python 3.8 - name: Install dependencies run: | pip install -r requirements.txt @@ -20,4 +23,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: personal_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build/html \ No newline at end of file + publish_dir: ./docs/_build/html diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index ae66bcf..c0f11f5 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -10,24 +10,13 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.8 # Set Python version to 3.8 or 3.9 uses: actions/setup-python@v3 with: - python-version: '3.10' - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH + python-version: '3.8' # Change to a version compatible with TensorFlow - name: Install dependencies run: | pip install -r requirements.txt - - name: Lint with flake8 - run: | - conda install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | python setup.py install diff --git a/README.md b/README.md index bd4b3d4..780f85f 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ pip install -r requirements.txt To train a new **MNIST classifier** model from scratch, run the following command: ```bash -python main.py --iterations 50 --particles 100 --save_dir "analysis_results" +python taint_MNIST.py --iterations 50 --particles 100 --save_dir "analysis_results" ``` This command will: @@ -90,7 +90,7 @@ This command will: If you already have a pre-trained model, you can load it by providing the `--model_path` argument: ```bash -python main.py --model_path "path_to_model/mnist_model.keras" --iterations 50 --particles 100 --save_dir "analysis_results" +python taint_MNIST.py --model_path "path_to_model/mnist_model.keras" --iterations 50 --particles 100 --save_dir "analysis_results" ``` This will load the provided pre-trained model, evaluate it on the test dataset, and then perform the adversarial attack. diff --git a/docs/Swarm_Observer.rst b/docs/Swarm_Observer.rst deleted file mode 100644 index 33a8341..0000000 --- a/docs/Swarm_Observer.rst +++ /dev/null @@ -1,29 +0,0 @@ -Swarm\_Observer package -======================= - -Submodules ----------- - -Swarm\_Observer.BirdParticle module ------------------------------------ - -.. automodule:: Swarm_Observer.BirdParticle - :members: - :undoc-members: - :show-inheritance: - -Swarm\_Observer.Swarm module ----------------------------- - -.. automodule:: Swarm_Observer.Swarm - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: Swarm_Observer - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index b3bd5a4..e516162 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,12 +13,10 @@ import os import sys sys.path.insert(0, os.path.abspath('../Adversarial_Observation')) -sys.path.insert(1, os.path.abspath('../Swarm_Observer')) sys.path.insert(2, os.path.abspath('../')) from Adversarial_Observation.Attacks import * from Adversarial_Observation.utils import * from Adversarial_Observation.visualize import * -import Swarm_Observer # -- Project information ----------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index eea57d7..53e18e1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,7 +11,6 @@ Welcome to Adversarial_Observation's documentation! :caption: Contents: Adversarial_Observation - Swarm_Observer examples diff --git a/docs/modules.rst b/docs/modules.rst index 75bd135..b626808 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -5,5 +5,4 @@ Adversarial_Observation :maxdepth: 4 Adversarial_Observation - Swarm_Observer setup diff --git a/requirements.txt b/requirements.txt index 8cac8c5..86d8c43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ torch torchvision sphinx_rtd_theme tensorflow -imageio[pyav] \ No newline at end of file +imageio[pyav] +pytest