-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions
committed
Jul 15, 2024
1 parent
8fbcd94
commit 58526c7
Showing
515 changed files
with
110,502 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nebula.enriquetomasmb.com | ||
nebula.enriquetomasmb.com |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
API Reference | ||
============= | ||
|
||
This page contains auto-generated API reference documentation [#f1]_. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
|
||
.. [#f1] Created by `Enrique Tomás Martínez Beltrán <https://www.enriquetomasmb.com/>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
:py:mod:`nebula.addons.attacks.attacks` | ||
======================================= | ||
|
||
.. py:module:: nebula.addons.attacks.attacks | ||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.attacks.attacks.Attack | ||
nebula.addons.attacks.attacks.GLLNeuronInversionAttack | ||
nebula.addons.attacks.attacks.NoiseInjectionAttack | ||
nebula.addons.attacks.attacks.SwappingWeightsAttack | ||
nebula.addons.attacks.attacks.DelayerAttack | ||
|
||
|
||
|
||
Functions | ||
~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.attacks.attacks.create_attack | ||
|
||
|
||
|
||
.. py:function:: create_attack(attack_name) | ||
Function to create an attack object from its name. | ||
|
||
|
||
.. py:class:: Attack | ||
.. py:method:: attack(received_weights) | ||
:abstractmethod: | ||
|
||
Function to perform the attack on the received weights. It should return the | ||
attacked weights. | ||
|
||
|
||
|
||
.. py:class:: GLLNeuronInversionAttack(strength=5.0, perc=1.0) | ||
Bases: :py:obj:`Attack` | ||
|
||
Function to perform neuron inversion attack on the received weights. | ||
|
||
.. py:method:: attack(received_weights) | ||
Function to perform the attack on the received weights. It should return the | ||
attacked weights. | ||
|
||
|
||
|
||
.. py:class:: NoiseInjectionAttack(strength=10000, perc=1.0) | ||
Bases: :py:obj:`Attack` | ||
|
||
Function to perform noise injection attack on the received weights. | ||
|
||
.. py:method:: attack(received_weights) | ||
Function to perform the attack on the received weights. It should return the | ||
attacked weights. | ||
|
||
|
||
|
||
.. py:class:: SwappingWeightsAttack(layer_idx=0) | ||
Bases: :py:obj:`Attack` | ||
|
||
Function to perform swapping weights attack on the received weights. Note that this | ||
attack performance is not consistent due to its stochasticity. | ||
|
||
Warning: depending on the layer the code may not work (due to reshaping in between), | ||
or it may be slow (scales quadratically with the layer size). | ||
Do not apply to last layer, as it would make the attack detectable (high loss | ||
on malicious node). | ||
|
||
.. py:method:: attack(received_weights) | ||
Function to perform the attack on the received weights. It should return the | ||
attacked weights. | ||
|
||
|
||
|
||
.. py:class:: DelayerAttack | ||
Bases: :py:obj:`Attack` | ||
|
||
Function to perform delayer attack on the received weights. It delays the | ||
weights for an indefinite number of rounds. | ||
|
||
.. py:method:: attack(received_weights) | ||
Function to perform the attack on the received weights. It should return the | ||
attacked weights. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:py:mod:`nebula.addons.attacks` | ||
=============================== | ||
|
||
.. py:module:: nebula.addons.attacks | ||
Subpackages | ||
----------- | ||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 3 | ||
|
||
poisoning/index.rst | ||
|
||
|
||
Submodules | ||
---------- | ||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 1 | ||
|
||
attacks/index.rst | ||
|
||
|
36 changes: 36 additions & 0 deletions
36
_sources/api/nebula/addons/attacks/poisoning/datapoison/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:py:mod:`nebula.addons.attacks.poisoning.datapoison` | ||
==================================================== | ||
|
||
.. py:module:: nebula.addons.attacks.poisoning.datapoison | ||
Module Contents | ||
--------------- | ||
|
||
|
||
Functions | ||
~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.attacks.poisoning.datapoison.datapoison | ||
nebula.addons.attacks.poisoning.datapoison.add_x_to_image | ||
nebula.addons.attacks.poisoning.datapoison.poison_to_nlp_rawdata | ||
|
||
|
||
|
||
.. py:function:: datapoison(dataset, indices, poisoned_persent, poisoned_ratio, targeted=False, target_label=3, noise_type='salt') | ||
Function to add random noise of various types to the dataset. | ||
|
||
|
||
.. py:function:: add_x_to_image(img) | ||
Add a 10*10 pixels X at the top-left of an image | ||
|
||
|
||
.. py:function:: poison_to_nlp_rawdata(text_data, poisoned_ratio) | ||
for NLP data, change the word vector to 0 with p=poisoned_ratio | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:py:mod:`nebula.addons.attacks.poisoning` | ||
========================================= | ||
|
||
.. py:module:: nebula.addons.attacks.poisoning | ||
Submodules | ||
---------- | ||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 1 | ||
|
||
datapoison/index.rst | ||
labelflipping/index.rst | ||
modelpoison/index.rst | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
_sources/api/nebula/addons/attacks/poisoning/labelflipping/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
:py:mod:`nebula.addons.attacks.poisoning.labelflipping` | ||
======================================================= | ||
|
||
.. py:module:: nebula.addons.attacks.poisoning.labelflipping | ||
Module Contents | ||
--------------- | ||
|
||
|
||
Functions | ||
~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.attacks.poisoning.labelflipping.labelFlipping | ||
|
||
|
||
|
||
.. py:function:: labelFlipping(dataset, indices, poisoned_persent=0, targeted=False, target_label=4, target_changed_label=7) | ||
select flipping_persent of labels, and change them to random values. | ||
:param dataset: the dataset of training data, torch.util.data.dataset like. | ||
:param indices: Indices of subsets, list like. | ||
:param flipping_persent: The ratio of labels want to change, float like. | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
_sources/api/nebula/addons/attacks/poisoning/modelpoison/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:py:mod:`nebula.addons.attacks.poisoning.modelpoison` | ||
===================================================== | ||
|
||
.. py:module:: nebula.addons.attacks.poisoning.modelpoison | ||
Module Contents | ||
--------------- | ||
|
||
|
||
Functions | ||
~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.attacks.poisoning.modelpoison.modelpoison | ||
|
||
|
||
|
||
.. py:function:: modelpoison(model, poisoned_ratio, noise_type='gaussian') | ||
Function to add random noise of various types to the model parameter. | ||
|
||
|
42 changes: 42 additions & 0 deletions
42
_sources/api/nebula/addons/blockchain/blockchain_deployer/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
:py:mod:`nebula.addons.blockchain.blockchain_deployer` | ||
====================================================== | ||
|
||
.. py:module:: nebula.addons.blockchain.blockchain_deployer | ||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.blockchain.blockchain_deployer.BlockchainDeployer | ||
|
||
|
||
|
||
|
||
Attributes | ||
~~~~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
nebula.addons.blockchain.blockchain_deployer.w3 | ||
nebula.addons.blockchain.blockchain_deployer.b | ||
|
||
|
||
.. py:data:: w3 | ||
.. py:class:: BlockchainDeployer(n_validator=3, config_dir='.', input_dir='.') | ||
Creates files (docker-compose.yaml and genesis.json) for deploying blockchain network | ||
|
||
|
||
.. py:data:: b | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:py:mod:`nebula.addons.blockchain.chaincode` | ||
============================================ | ||
|
||
.. py:module:: nebula.addons.blockchain.chaincode | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:py:mod:`nebula.addons.blockchain.geth` | ||
======================================= | ||
|
||
.. py:module:: nebula.addons.blockchain.geth | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
:py:mod:`nebula.addons.blockchain` | ||
================================== | ||
|
||
.. py:module:: nebula.addons.blockchain | ||
Subpackages | ||
----------- | ||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 3 | ||
|
||
chaincode/index.rst | ||
geth/index.rst | ||
oracle/index.rst | ||
|
||
|
||
Submodules | ||
---------- | ||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 1 | ||
|
||
blockchain_deployer/index.rst | ||
|
||
|
Oops, something went wrong.