openopt / chop Goto Github PK
View Code? Open in Web Editor NEWCHOP: An optimization library based on PyTorch, with applications to adversarial examples and structured neural network training.
Home Page: http://openo.pt/chop
License: Other
CHOP: An optimization library based on PyTorch, with applications to adversarial examples and structured neural network training.
Home Page: http://openo.pt/chop
License: Other
installed constopt-pytorch via git clone and pip install -e .
the following lines fail:
import constopt
constopt.stochastic.PGD
module 'constopt' has no attribute 'stochastic'
these ones work
import constopt
import constopt.stochastic
constopt.stochastic.PGD
... to specify which dimensions are batch dims, and which are data dims.
When running !python -m pip install git+https://github.com/openopt/chop
on a Google colab, I get the following error:
<ipython-input-2-f345500ab750> in <module>()
----> 1 import chop
1 frames
/usr/local/lib/python3.7/dist-packages/chop/stochastic.py in <module>()
14 import torch
15 from torch.optim import Optimizer
---> 16 from chop import utils
17 import numpy as np
18
ImportError: cannot import name 'utils' from 'chop' (/usr/local/lib/python3.7/dist-packages/chop/__init__.py)
@fabianp any clue why this could happen?
Related to curriculum training: make examples easier at first by minimizing over input space. Try to do so especially for hard examples.
Implement the accelerated version of PGD.
Similar to the Carlini & Wagner attack, we'd like the alpha to be defined datapoint wise in the penalty constraints.
Ideally, given a datapoint we should be able to perform binary search to find the smallest alpha which swings a label for a given adversary.
@chop.utils.closure
is used to batch problems for deterministic optimizers and is not required for stochastic optimizers, but it would be useful to output a warning if @chop.utils.closure
is accidentally used with one.
Revolution cones defined by u\in R^d, |u| = 1:
K = {v / <v, u> >= alpha * |v|}
Code for prox and LMO operators on these convex sets.
I'm getting the following error on examples/adversarial_robustness/plot_visualizing_adversarial_attacks.py :
Files already downloaded and verified
L2 norm constraint.
GroupL1 constraint.
Traceback (most recent call last):
File "plot_visualizing_adversarial_attacks.py", line 94, in <module>
_, delta_group = adversary_group.perturb(data, target, model, criterion,
File "/home/pedregosa/dev/chop/chop/adversary.py", line 93, in perturb
sol = self.method(loss, delta0, step=step, max_iter=max_iter,
File "/home/pedregosa/dev/chop/chop/optim.py", line 394, in minimize_frank_wolfe
raise ValueError("step must be a float or 'sublinear'.")
ValueError: step must be a float or 'sublinear'.
create sphinx project
use sphinx-gallery to run and display the examples
upload to openo.pt/chop
Should be around 90%, currently its 67%
Cf examples/adversarial_robustness/attack_benchmark.py
.
Need to write tests for operator splitting (optim.minimize_three_split
)
Parallelization of models / algorithms across several GPUs.
Stochastic version of PR #52
We'd like to have a tensor LMO for tensor nuclear norm constraints. Therefore, an implementation of https://hal.archives-ouvertes.fr/hal-01385538/file/SeROAP_final.pdf (or some other rank 1 tensor decomposition algorithm) would be nice.
Our NuclearNormBall.lmo should do this by default for tensor inputs of shape (batch_size, *shape)
.
Working backtracking line search for different algorithms.
Math isn't well rendered in the documentation. For instance: http://openo.pt/chop/generated/chop.constraints.html#module-chop.constraints.
It has been shown that various improvements on textbook optimization methods allow for notable gains in attack performance. This should be implemented either in the Attacker
class or directly in the optimize_method
functions.
optimize_method
.use_best
option for all methodsSee project proposal here.
Add sampling methods
with applications to adversarial example generation.
We should be able to compute operators such as prox and LMO for only a subset of the batch.
For example, when performing back-tracking line-search, we only want to update certain datapoints in the batch within the backtracking loop. For now the computation is redundantly done for all datapoints, then masked.
Replace
Example: filter based models where
I'd like a method similar to https://github.com/fra31/auto-attack/blob/67cdc76f0d5dd18af71958a739e10f90c0d1e787/autoattack/autoattack.py#L72
Things to pay attention to:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.