Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autopoint #256

Merged
merged 20 commits into from
Mar 6, 2024
Merged

Autopoint #256

merged 20 commits into from
Mar 6, 2024

Conversation

zhanggiene
Copy link
Contributor

  1. added Autopoint class which is slimiar to point, but with functionality of calculating the gradient automatically. This PR is an updated version of this PR(Examples of using various automatic differentiation libraries.  #243 ). More details can be found here

Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am OK with merging in general. The only real issue is the difficulty to build and run the examples with autodiff. Could you please provide more detailed instructions in the README? Ideally autodiff should be fetched in the correct place by the cmake of volesti just like eigen. Is it possible to do this?

@@ -30,7 +30,7 @@ Polytope generate_cube(const unsigned int& dim, const bool& Vpoly) {
A.resize(2 * dim, dim);
b.resize(2 * dim);
for (unsigned int i = 0; i < dim; ++i) {
b(i) = 1.0;
b(i) = scale;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you assign scale which is of type const unsigned int to b(i) which is of type Polytope::NT, I think scale should be of that type too.

examples/Autopoint/README.md Outdated Show resolved Hide resolved
TARGET_LINK_LIBRARIES(Gaussian_mixture_autopoint ${LP_SOLVE} ${BLAS} autodiff::autodiff "-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl")


add_executable (MultidimensionalGaussian_mixture_autopoint MultidimensionalGaussian_mixture_autopoint.cpp readData.cpp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to eliminate whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok



### Background information
Autopoint is implemented using AUtodiff Library , after experiments of comparing various automatic differentiating libraries.Read [here](https://gist.github.com/zhanggiene/8471601fa25ba9db90303661b0e2237b) to find out more!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalization issue

@@ -0,0 +1,15 @@
import math
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you have 1 file instead of two files for generating gaussian mixture data?
Also, can you please add flags to the generation script so that the user can define them from the command line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason for the two separate files is because of the visualization part. I have taken out the visualization for generated data.

}
return result;

}
Copy link
Collaborator

@papachristoumarios papachristoumarios Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the files are missing newlines at the end of the file.

@@ -392,4 +398,105 @@ struct HessianFunctor {

};


struct AutoDiffFunctor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style should be fixed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about the code format or software best practice to write elegant and readable code?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both, but primarily the former.

@zhanggiene
Copy link
Contributor Author

Autodiff library is automatically downloaded in a similar fashion as Boost and Eigen.

@codecov
Copy link

codecov bot commented Feb 4, 2023

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 53.94%. Comparing base (e767f46) to head (aec4fb1).
Report is 9 commits behind head on develop.

❗ Current head aec4fb1 differs from pull request most recent head 0ebb07b. Consider uploading reports for the commit 0ebb07b to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #256      +/-   ##
===========================================
- Coverage    55.31%   53.94%   -1.38%     
===========================================
  Files          108      105       -3     
  Lines         6539     6166     -373     
  Branches      3026     2878     -148     
===========================================
- Hits          3617     3326     -291     
- Misses         948      964      +16     
+ Partials      1974     1876      -98     
Files Coverage Δ
include/generators/known_polytope_generators.h 78.23% <100.00%> (ø)
include/ode_solvers/oracle_functors.hpp 28.57% <ø> (ø)
include/diagnostics/print_diagnostics.hpp 0.00% <0.00%> (ø)

... and 27 files with indirect coverage changes

@@ -26,6 +26,7 @@ endif()

option(DISABLE_NLP_ORACLES "Disable non-linear oracles (used in collocation)" ON)
option(BUILTIN_EIGEN "Use eigen from ../external" OFF)
option(BUILTIN_AUTODIFF "Use eigen from ../external" ON)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo here

typename NT>
struct FunctionFunctor_internal
{
typedef autopoint<NT> Autopoint;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can go with using instead of typedef

examples/Autopoint/CMakeLists.txt Outdated Show resolved Hide resolved
include/cartesian_geom/autopoint.h Outdated Show resolved Hide resolved
@vfisikop
Copy link
Contributor

vfisikop commented Mar 6, 2024

Since this is ready to merge as a feature, I will merge it now and fix possible issues in a future PR.

@vfisikop vfisikop merged commit b2b5c06 into GeomScale:develop Mar 6, 2024
3 of 27 checks passed
TolisChal pushed a commit that referenced this pull request Jul 7, 2024
TolisChal pushed a commit that referenced this pull request Jul 7, 2024
TolisChal pushed a commit to TolisChal/volume_approximation that referenced this pull request Jul 7, 2024
TolisChal pushed a commit to TolisChal/volume_approximation that referenced this pull request Jul 7, 2024
TolisChal pushed a commit to TolisChal/volume_approximation that referenced this pull request Jul 8, 2024
TolisChal pushed a commit to TolisChal/volume_approximation that referenced this pull request Jul 8, 2024
TolisChal pushed a commit to TolisChal/volume_approximation that referenced this pull request Jul 8, 2024
TolisChal pushed a commit that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants