diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index fc6247d..9e41fb5 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -746,6 +746,7 @@ WARN_LOGFILE = doxygen.log INPUT = ../graphlab/graphlab.dox \ ../graphlab/ffi.dox \ ../graphlab/sdk \ + ../graphlab/how_to.dox \ ../graphlab/flexible_type \ ../graphlab/image \ ../graphlab/random \ diff --git a/doxygen/doxygen.log b/doxygen/doxygen.log index 9b085e1..597aa77 100644 --- a/doxygen/doxygen.log +++ b/doxygen/doxygen.log @@ -1,133 +1,133 @@ warning: source doc/images is not a readable file or directory... skipping. -/home/haijieg/graphlab/graphlab-sdk/graphlab/ffi.dox:420: warning: multiple use of section label 'sec_class_publishing' while adding section, (first occurrence: /home/haijieg/graphlab/graphlab-sdk/graphlab/ffi.dox, line 376) -/home/haijieg/graphlab/graphlab-sdk/sdk_example/sgraph_edge_deduplication.cpp:94: warning: reached end of file while inside a code block! +/Users/piotrteterwak/graphlab-sdk/graphlab/ffi.dox:419: warning: multiple use of section label 'sec_class_publishing', (first occurrence: /Users/piotrteterwak/graphlab-sdk/graphlab/ffi.dox, line 375) +/Users/piotrteterwak/graphlab-sdk/sdk_example/sgraph_edge_deduplication.cpp:94: warning: reached end of file while inside a code block! The command that should end the block seems to be missing! -/home/haijieg/graphlab/graphlab-sdk/sdk_example/sgraph_weighted_pagerank.cpp:130: warning: reached end of file while inside a code block! +/Users/piotrteterwak/graphlab-sdk/sdk_example/sgraph_weighted_pagerank.cpp:130: warning: reached end of file while inside a code block! The command that should end the block seems to be missing! -/home/haijieg/graphlab/graphlab-sdk/graphlab/ffi.dox:45: warning: unable to resolve reference to `toolkit_function_macros.hpp' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/serialization/serialize_to_from_string.hpp:65: warning: unable to resolve reference to `serializable' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/serialization/serialize_to_from_string.hpp:40: warning: unable to resolve reference to `serializable' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/serialization/serialization_details.dox:66: warning: unable to resolve reference to `serialize_impl' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/string_escape.hpp:44: warning: The following parameters of graphlab::escape_string(const std::string &val, char escape_char, char quote_char, bool use_quote_char, bool double_quote, std::string &output, size_t &output_len) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/ffi.dox:44: warning: unable to resolve reference to `toolkit_function_macros.hpp' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/serialization/serialize_to_from_string.hpp:65: warning: unable to resolve reference to `serializable' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/serialization/serialize_to_from_string.hpp:40: warning: unable to resolve reference to `serializable' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/serialization/serialization_details.dox:66: warning: unable to resolve reference to `serialize_impl' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/string_escape.hpp:44: warning: The following parameters of graphlab::escape_string(const std::string &val, char escape_char, char quote_char, bool use_quote_char, bool double_quote, std::string &output, size_t &output_len) are not documented: parameter 'output' parameter 'output_len' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: parameter 'directory' -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:202: warning: unable to resolve reference to `flexible_type::apply_visitor(Visitor)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:246: warning: unable to resolve reference to `apply_visitor(Visitor)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:247: warning: unable to resolve reference to `mutating_get()' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:575: warning: unable to resolve reference to `apply_visitor(Visitor)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:634: warning: unable to resolve reference to `apply_visitor(Visitor, const flexible_type&)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:69: warning: argument 'name' of command @param is not found in the argument list of graphlab::flexible_type_registry::get_field_name(field_id_type id) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:69: warning: The following parameters of graphlab::flexible_type_registry::get_field_name(field_id_type id) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:202: warning: unable to resolve reference to `flexible_type::apply_visitor(Visitor)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:246: warning: unable to resolve reference to `apply_visitor(Visitor)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:247: warning: unable to resolve reference to `mutating_get()' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:575: warning: unable to resolve reference to `apply_visitor(Visitor)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type.hpp:634: warning: unable to resolve reference to `apply_visitor(Visitor, const flexible_type&)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:69: warning: argument 'name' of command @param is not found in the argument list of graphlab::flexible_type_registry::get_field_name(field_id_type id) const +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:69: warning: The following parameters of graphlab::flexible_type_registry::get_field_name(field_id_type id) const are not documented: parameter 'id' -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:119: warning: argument 'id' of command @param is not found in the argument list of graphlab::flexible_type_registry::get_field_type(field_id_type name) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:119: warning: The following parameters of graphlab::flexible_type_registry::get_field_type(field_id_type name) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:119: warning: argument 'id' of command @param is not found in the argument list of graphlab::flexible_type_registry::get_field_type(field_id_type name) const +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_registry.hpp:119: warning: The following parameters of graphlab::flexible_type_registry::get_field_type(field_id_type name) const are not documented: parameter 'name' -/home/haijieg/graphlab/graphlab-sdk/graphlab/unity/lib/api/function_closure_info.hpp:49: warning: unexpected command endcode -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1384: warning: argument 'operations' of command @param is not found in the argument list of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1384: warning: The following parameters of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/unity/lib/api/function_closure_info.hpp:49: warning: unexpected command endcode +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1386: warning: argument 'operations' of command @param is not found in the argument list of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1386: warning: The following parameters of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const are not documented: parameter 'operators' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1613: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1613: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1615: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1615: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const are not documented: parameter 'joinkeys' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1697: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1697: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1699: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1699: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const are not documented: parameter 'joinkeys' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:950: warning: argument 'seed' of command @param is not found in the argument list of graphlab::gl_sframe::random_split(double fraction) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:799: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:799: warning: The following parameters of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:952: warning: argument 'seed' of command @param is not found in the argument list of graphlab::gl_sframe::random_split(double fraction) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:801: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:801: warning: The following parameters of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const are not documented: parameter 'path' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2137: warning: unable to resolve reference to `stack(const std::string&, const std::vector&, bool)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: argument 'new_column_name' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2139: warning: unable to resolve reference to `stack(const std::string&, const std::vector&, bool)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: argument 'new_column_name' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const are not documented: parameter 'column_name' parameter 'new_column_names' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2205: warning: unable to resolve reference to `stack(const std::string&, const std::string&, bool)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2200: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2200: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2207: warning: unable to resolve reference to `stack(const std::string&, const std::string&, bool)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2202: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2202: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const are not documented: parameter 'column_name' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2274: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2274: warning: The following parameters of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2276: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2276: warning: The following parameters of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const are not documented: parameter 'columns' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2312: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2312: warning: The following parameters of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2314: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2314: warning: The following parameters of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const are not documented: parameter 'columns' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: parameter 'directory' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1154: warning: argument 'allow_rounding' of command @param is not found in the argument list of graphlab::gl_sarray::pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:537: warning: The following parameters of graphlab::gl_sarray::save(const std::string &directory, const std::string &format="binary") const are not documented: parameter 'directory' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1786: warning: argument 'start' of command @param is not found in the argument list of graphlab::gl_sarray_writer::write(T begin, T end, size_t segmentid) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1786: warning: The following parameters of graphlab::gl_sarray_writer::write(T begin, T end, size_t segmentid) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1786: warning: argument 'start' of command @param is not found in the argument list of graphlab::gl_sarray_writer::write(T begin, T end, size_t segmentid) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sarray.hpp:1786: warning: The following parameters of graphlab::gl_sarray_writer::write(T begin, T end, size_t segmentid) are not documented: parameter 'begin' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1384: warning: argument 'operations' of command @param is not found in the argument list of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1384: warning: The following parameters of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1386: warning: argument 'operations' of command @param is not found in the argument list of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1386: warning: The following parameters of graphlab::gl_sframe::groupby(const std::vector< std::string > &groupkeys, const std::map< std::string, aggregate::groupby_descriptor_type > &operators=std::map< std::string, aggregate::groupby_descriptor_type >()) const are not documented: parameter 'operators' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1613: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1613: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1615: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1615: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::vector< std::string > &joinkeys, const std::string &how="inner") const are not documented: parameter 'joinkeys' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1697: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1697: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1699: warning: argument 'on' of command @param is not found in the argument list of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1699: warning: The following parameters of graphlab::gl_sframe::join(const gl_sframe &right, const std::map< std::string, std::string > &joinkeys, const std::string &how="inner") const are not documented: parameter 'joinkeys' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:950: warning: argument 'seed' of command @param is not found in the argument list of graphlab::gl_sframe::random_split(double fraction) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1317: warning: argument 'names' of command @param is not found in the argument list of graphlab::gl_sframe::rename(const std::map< std::string, std::string > &old_to_new_names) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1317: warning: The following parameters of graphlab::gl_sframe::rename(const std::map< std::string, std::string > &old_to_new_names) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:952: warning: argument 'seed' of command @param is not found in the argument list of graphlab::gl_sframe::random_split(double fraction) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1319: warning: argument 'names' of command @param is not found in the argument list of graphlab::gl_sframe::rename(const std::map< std::string, std::string > &old_to_new_names) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:1319: warning: The following parameters of graphlab::gl_sframe::rename(const std::map< std::string, std::string > &old_to_new_names) are not documented: parameter 'old_to_new_names' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:799: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:799: warning: The following parameters of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:801: warning: argument 'filename' of command @param is not found in the argument list of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:801: warning: The following parameters of graphlab::gl_sframe::save(const std::string &path, const std::string &format="") const are not documented: parameter 'path' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2137: warning: unable to resolve reference to `stack(const std::string&, const std::vector&, bool)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: argument 'new_column_name' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2132: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2139: warning: unable to resolve reference to `stack(const std::string&, const std::vector&, bool)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: argument 'new_column_name' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2134: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::string &new_column_names, bool drop_na=false) const are not documented: parameter 'column_name' parameter 'new_column_names' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2205: warning: unable to resolve reference to `stack(const std::string&, const std::string&, bool)' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2200: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2200: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2207: warning: unable to resolve reference to `stack(const std::string&, const std::string&, bool)' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2202: warning: argument 'column_names' of command @param is not found in the argument list of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2202: warning: The following parameters of graphlab::gl_sframe::stack(const std::string &column_name, const std::vector< std::string > &new_column_names, bool drop_na=false) const are not documented: parameter 'column_name' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2274: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2274: warning: The following parameters of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2276: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2276: warning: The following parameters of graphlab::gl_sframe::unstack(const std::string &columns, const std::string &new_column_name="") const are not documented: parameter 'columns' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2312: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2312: warning: The following parameters of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2314: warning: argument 'column' of command @param is not found in the argument list of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2314: warning: The following parameters of graphlab::gl_sframe::unstack(const std::vector< std::string > &columns, const std::string &new_column_name="") const are not documented: parameter 'columns' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2875: warning: argument 'column_name' of command @param is not found in the argument list of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2875: warning: argument 'type' of command @param is not found in the argument list of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2875: warning: The following parameters of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2877: warning: argument 'column_name' of command @param is not found in the argument list of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2877: warning: argument 'type' of command @param is not found in the argument list of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2877: warning: The following parameters of graphlab::gl_sframe_writer::gl_sframe_writer(const std::vector< std::string > &column_names, const std::vector< flex_type_enum > &column_types, size_t num_segments=(size_t)(-1)) are not documented: parameter 'column_names' parameter 'column_types' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2913: warning: argument 'start' of command @param is not found in the argument list of graphlab::gl_sframe_writer::write(T begin, T end, size_t segmentid) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2913: warning: The following parameters of graphlab::gl_sframe_writer::write(T begin, T end, size_t segmentid) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2915: warning: argument 'start' of command @param is not found in the argument list of graphlab::gl_sframe_writer::write(T begin, T end, size_t segmentid) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:2915: warning: The following parameters of graphlab::gl_sframe_writer::write(T begin, T end, size_t segmentid) are not documented: parameter 'begin' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:48: warning: unable to resolve reference to `gl_sframes' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:144: warning: unable to resolve reference to `Ï' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:145: warning: unexpected command endcode -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1038: warning: argument 'name' of command @param is not found in the argument list of graphlab::gl_sgraph::remove_edge_field(const std::string &field) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1038: warning: The following parameters of graphlab::gl_sgraph::remove_edge_field(const std::string &field) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:48: warning: unable to resolve reference to `gl_sframes' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:144: warning: unable to resolve reference to `Ï' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:145: warning: unexpected command endcode +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1038: warning: argument 'name' of command @param is not found in the argument list of graphlab::gl_sgraph::remove_edge_field(const std::string &field) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1038: warning: The following parameters of graphlab::gl_sgraph::remove_edge_field(const std::string &field) are not documented: parameter 'field' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1000: warning: argument 'name' of command @param is not found in the argument list of graphlab::gl_sgraph::remove_vertex_field(const std::string &field) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1000: warning: The following parameters of graphlab::gl_sgraph::remove_vertex_field(const std::string &field) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1000: warning: argument 'name' of command @param is not found in the argument list of graphlab::gl_sgraph::remove_vertex_field(const std::string &field) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:1000: warning: The following parameters of graphlab::gl_sgraph::remove_vertex_field(const std::string &field) are not documented: parameter 'field' -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:883: warning: unable to resolve reference to `edge_triple' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/serialization/iarchive.hpp:116: warning: unable to resolve reference to `serialization' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/serialization/oarchive.hpp:75: warning: unable to resolve reference to `serialization' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:67: warning: argument 'const' of command @param is not found in the argument list of graphlab::aggregate::make_aggregator(const std::vector< std::string > &group_columns, const Args &...args) -/home/haijieg/graphlab/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:67: warning: The following parameters of graphlab::aggregate::make_aggregator(const std::vector< std::string > &group_columns, const Args &...args) are not documented: +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sgraph.hpp:883: warning: unable to resolve reference to `edge_triple' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/serialization/iarchive.hpp:116: warning: unable to resolve reference to `serialization' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/serialization/oarchive.hpp:75: warning: unable to resolve reference to `serialization' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:67: warning: argument 'const' of command @param is not found in the argument list of graphlab::aggregate::make_aggregator(const std::vector< std::string > &group_columns, const Args &...args) +/Users/piotrteterwak/graphlab-sdk/graphlab/sdk/gl_sframe.hpp:67: warning: The following parameters of graphlab::aggregate::make_aggregator(const std::vector< std::string > &group_columns, const Args &...args) are not documented: parameter 'args' -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:464: warning: Unsupported xml/html tag found -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:505: warning: Unsupported xml/html tag found -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:443: warning: Unsupported xml/html tag found -/home/haijieg/graphlab/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:485: warning: Unsupported xml/html tag found -/home/haijieg/graphlab/graphlab-sdk/graphlab/graphlab.dox:49: warning: unable to resolve reference to `page_user_guide' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/graphlab.dox:148: warning: unable to resolve reference to `section_Examples' for \ref command -/home/haijieg/graphlab/graphlab-sdk/graphlab/graphlab.dox:149: warning: found tag without matching
    +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:464: warning: Unsupported xml/html tag found +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:505: warning: Unsupported xml/html tag found +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:443: warning: Unsupported xml/html tag found +/Users/piotrteterwak/graphlab-sdk/graphlab/flexible_type/flexible_type_converter.hpp:485: warning: Unsupported xml/html tag found +/Users/piotrteterwak/graphlab-sdk/graphlab/graphlab.dox:47: warning: unable to resolve reference to `page_user_guide' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/graphlab.dox:154: warning: unable to resolve reference to `section_Examples' for \ref command +/Users/piotrteterwak/graphlab-sdk/graphlab/graphlab.dox:155: warning: found
tag without matching
    diff --git a/graphlab/how_to.dox b/graphlab/how_to.dox new file mode 100644 index 0000000..e292497 --- /dev/null +++ b/graphlab/how_to.dox @@ -0,0 +1,330 @@ +namespace graphlab { +/** + +\page how_to How To + +Here we provide a few SDK code snippets to help you get started with the SDK, +illustrating a few interesting use cases. + +\section sec_image_crop Center Cropping Images + +Sometimes, it is desirable to pre-process images in some defined way before using +them. For instance, our Deep Learning functionality requires fixed image sizes +for training. GraphLab Create's resize function simply warps the image to the +pre-defined size, but it may be desireable to crop the image in some specific way. +Here we show an example of how to this with the SDK. Note that this example +requires the opencv library to be installed on your system. + +\code + // file image_crop.cpp + #include + #include + #include + #include + + using namespace graphlab; + + flexible_type square_center_crop(flexible_type& in, int crop_size) { + flex_image src = in.get(); + + // Translating number of channels into opencv image format + int image_format; + if (src.m_channels == 1) { + image_format = CV_8UC1; + } else if (src.m_channels == 3){ + image_format = CV_8UC3; + } else if (src.m_channels == 4) { + image_format = CV_8UC4; + } + + //Decode image + cv::Mat imgbuf(src.m_width,src.m_height, image_format, (unsigned char *)&src.m_image_data[0]); + cv::Mat img = imdecode(imgbuf, CV_LOAD_IMAGE_UNCHANGED); + + //Define crop region + cv::Rect roi; + roi.x = (src.m_width - crop_size)/2; + roi.y = (src.m_height - crop_size)/2; + roi.width = crop_size; + roi.height = crop_size; + + // Perform crop and image encoding + cv::Mat crop = img(roi); + std::vector buff; + std::vector params; + params.push_back(CV_IMWRITE_PNG_COMPRESSION); + params.push_back(3); + imencode(".png", crop, buff, params); + + // Writing out to destination image + flex_image dst; + dst.m_height = crop_size; + dst.m_width = crop_size; + dst.m_channels = src.m_channels; + dst.m_image_data_size = buff.size(); + dst.m_version = IMAGE_TYPE_CURRENT_VERSION; + dst.m_format = Format::PNG; + dst.m_image_data.reset(new char[dst.m_image_data_size]); + memcpy(&dst.m_image_data[0], &buff[0], dst.m_image_data_size); + + return flexible_type(dst); + } + + BEGIN_FUNCTION_REGISTRATION + REGISTER_FUNCTION(center_crop, "src", "crop_size"); + END_FUNCTION_REGISTRATION + + \endcode + + Now, from the python side you can call: + + \code + import graphlab + #import extension + import image_crop + + img_sarray = graphlab.SArray('/your/path/here') + cropped_img_sarray = img_sarray.apply(lambda x : image_crop.square_center_crop(x, 50)) + \endcode + +\section sec_edge_deduplication SGraph Edge De-duplication + +\code +/** + * Copyright (C) 2015 Dato, Inc. + * All rights reserved. + * + * This software may be modified and distributed under the terms + * of the BSD license. See the LICENSE file for details. + */ + +/** + * @author Jay Gu (jgu@dato.com) + * + * @date November 10, 2014 + * + * @brief SGraph SDK Example + * + * This example produces the extension function: edge_deduplication + * + * To run this example, make a shared library and import into python. + * + * ### Compilation + * To compile, run + * \code + * cd graphlab-sdk + * make + * \endcode + * + * ### Usage + * + * In python or ipython, first import graphlab, then import the extension + * so file. Now you have access to the two extension functions in the + * sgraph_example module as regular python function. + * + * Example: + * \code{.py} + * import graphlab + * from sdk_example.sgraph_edge_deduplication import edge_deduplication + * + * # The higgs-twitter graph is from Stanford SNAP project. (http//snap.stanford.edu) + * url = 'http://snap.stanford.edu/data/higgs-reply_network.edgelist.gz' + * g = graphlab.load_sgraph(url, format='snap', delimiter=' ') + * + * # Manually duplicate some edges + * g2 = g.add_edges(g.edges.sample(0.1)) + * print g2.summary() + * g3 = sgraph_example.edge_deduplication(g2) + * print g3.summary() + * \endcode + * + * Produces output + * \code{.txt} + * + * Summary of g2 + * SGraph({'num_edges': 33316, 'num_vertices': 37366}) + * Vertex Fields:['__id', 'pagerank'] + * Edge Fields:['X3', '__dst_id', '__src_id'] + * + * Summary of g3 + * SGraph({'num_edges': 30836, 'num_vertices': 37366}) + * Vertex Fields:['__id', 'pagerank'] + * Edge Fields:['X3', '__dst_id', '__src_id'] +\endcode + +C++ extension: + +\code +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace graphlab; + +/** + * Return a new graph with no duplicate edges. + * + * \param g The input graph + */ +gl_sgraph edge_deduplication(const gl_sgraph& g) { + std::vector edge_fields = g.get_edge_fields(); + + std::map groupby_operators; + for (const auto& f: edge_fields) { + if (f != "__src_id" && f != "__dst_id") { + groupby_operators[f] = aggregate::SELECT_ONE(f); + } + } + gl_sframe edge_dedup = g.get_edges().groupby( {"__src_id", "__dst_id"}, groupby_operators ); + return gl_sgraph(g.get_vertices(), edge_dedup); +} + +BEGIN_FUNCTION_REGISTRATION +REGISTER_FUNCTION(edge_deduplication, "graph"); +END_FUNCTION_REGISTRATION +\endcode + +\section sec_weighted_pagerank Weighted Pagerank + +\code +/** + * Copyright (C) 2015 Dato, Inc. + * All rights reserved. + * + * This software may be modified and distributed under the terms + * of the BSD license. See the LICENSE file for details. + */ + +/** + * @author Jay Gu (jgu@dato.com) + * + * @date November 10, 2014 + * + * @brief SGraph SDK Example + * + * This example produces the extension function: weighted_pagerank + * + * To run this example, make a shared library and import into python. + * + * ### Compilation + * To compile, run + * \code + * cd graphlab-sdk + * make + * \endcode + * + * ### Usage + * + * In python or ipython, first import graphlab, then import the extension + * so file. Now you have access to the two extension functions in the + * sgraph_example module as regular python function. + * + * Example: + * \code{.py} + * import graphlab + * from sdk_example.sgraph_weighted_pagerank import weighted_pagerank + * + * # The higgs-twitter graph is from Stanford SNAP project. (http//snap.stanford.edu) + * url = 'http://snap.stanford.edu/data/higgs-reply_network.edgelist.gz' + * g = graphlab.load_sgraph(url, format='snap', delimiter=' ') + * + * g2 = weighted_pagerank(g, num_iterations=10, weight_field='X3') + * print g2.vertices.sort('pagerank', ascending=False) + * + * \endcode + * + * Produces output + * \code{.txt} + * + * Top 10 vertices with highest weighted pagrank in g + * +--------+---------------+ + * | __id | pagerank | + * +--------+---------------+ + * | 45848 | 326.808929483 | + * | 28423 | 138.143053733 | + * | 53134 | 67.5302627568 | + * | 56576 | 58.2142161056 | + * | 77095 | 49.0152734282 | + * | 421960 | 49.0152734282 | + * | 203739 | 49.0152734282 | + * | 344282 | 49.0152734282 | + * | 48053 | 49.0152734282 | + * | 56437 | 49.0152734282 | + * | ... | ... | + * +--------+---------------+ +\endcode + +C++ extension: + +\code +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace graphlab; + +/** + * Compute weighted pagerank of the given graph. + * + * Return a new graph with "pagerank" field on each vertex. + * + * \param g The input graph + * \param iters Number of iterations + * \param weighted_field The edge field which contains the weight value. + */ +gl_sgraph weighted_pagerank(const gl_sgraph& g, size_t iters, const std::string& weight_field) { + const double RESET_PROB=0.15; + + // Get rid of unused fields. + gl_sgraph g_min = g.select_fields({weight_field}); + + // Count the total out going weight of each vertex into an SFrame. + gl_sframe outgoing_weight = g_min.get_edges().groupby({"__src_id"}, {{"total_weight", aggregate::SUM(weight_field)}}); + + // Add the total_weight to the graph as vertex atrribute. + // We can update the vertex data by adding the same vertex. + gl_sgraph g2 = g_min.add_vertices(outgoing_weight, "__src_id"); + + // Lambda function for triple_apply + auto pr_update = [&weight_field](edge_triple& triple)->void { + double weight = triple.edge[weight_field]; + triple.target["pagerank"] += triple.source["pagerank_prev"] * weight / triple.source["total_weight"]; + }; + + // Initialize pagerank value + g2.vertices()["pagerank_prev"] = 1.0; + + // Iteratively run triple_apply with the update function + for (size_t i = 0; i < iters; ++i) { + + g2.vertices()["pagerank"] = 0.0; + + logprogress_stream << "Iteration " << (i+1) << std::endl; + g2 = g2.triple_apply(pr_update, {"pagerank"}); + + g2.vertices()["pagerank"] = RESET_PROB + (1-RESET_PROB) * g2.vertices()["pagerank"]; + g2.vertices()["pagerank_prev"] = g2.vertices()["pagerank"]; + } + + g2.vertices().remove_column("pagerank_prev"); + g2.vertices().remove_column("total_weight"); + return g2; +} + +BEGIN_FUNCTION_REGISTRATION +REGISTER_FUNCTION(weighted_pagerank, "graph", "num_iterations", "weight_field"); +END_FUNCTION_REGISTRATION +\endcode + +*/ +} diff --git a/graphlab/sdk/sframe.dox b/graphlab/sdk/sframe.dox index a1bc424..2811ba7 100644 --- a/graphlab/sdk/sframe.dox +++ b/graphlab/sdk/sframe.dox @@ -210,6 +210,85 @@ namespace graphlab { END_FUNCTION_REGISTRATION \endcode + You can also define a transformation function as an extension, and then pass + it to a python SArray apply. For instance, here we define a square center + crop of an image as an extension. Note that using this example requires the + opencv library to be installed on your system. + + \code + // file image_crop.cpp + #include + #include + #include + #include + + using namespace graphlab; + + flexible_type square_center_crop(flexible_type& in, int crop_size) { + flex_image src = in.get(); + + // Translating number of channels into opencv image format + int image_format; + if (src.m_channels == 1) { + image_format = CV_8UC1; + } else if (src.m_channels == 3){ + image_format = CV_8UC3; + } else if (src.m_channels == 4) { + image_format = CV_8UC4; + } + + //Decode image + cv::Mat imgbuf(src.m_width,src.m_height, image_format, (unsigned char *)&src.m_image_data[0]); + cv::Mat img = imdecode(imgbuf, CV_LOAD_IMAGE_UNCHANGED); + + //Define crop region + cv::Rect roi; + roi.x = (src.m_width - crop_size)/2; + roi.y = (src.m_height - crop_size)/2; + roi.width = crop_size; + roi.height = crop_size; + + // Perform crop and image encoding + cv::Mat crop = img(roi); + std::vector buff; + std::vector params; + params.push_back(CV_IMWRITE_PNG_COMPRESSION); + params.push_back(3); + imencode(".png", crop, buff, params); + + // Writing out to destination image + flex_image dst; + dst.m_height = crop_size; + dst.m_width = crop_size; + dst.m_channels = src.m_channels; + dst.m_image_data_size = buff.size(); + dst.m_version = IMAGE_TYPE_CURRENT_VERSION; + dst.m_format = Format::PNG; + dst.m_image_data.reset(new char[dst.m_image_data_size]); + memcpy(&dst.m_image_data[0], &buff[0], dst.m_image_data_size); + + return flexible_type(dst); + } + + BEGIN_FUNCTION_REGISTRATION + REGISTER_FUNCTION(center_crop, "src", "crop_size"); + END_FUNCTION_REGISTRATION + + \endcode + + Now, from the python side you can call: + + \code + import graphlab + #import extension + import image_crop + + img_sarray = graphlab.SArray('/your/path/here') + cropped_img_sarray = img_sarray.apply(lambda x : image_crop.square_center_crop(x, 50)) + \endcode + + + \section sec_sframe_intro SFrame SFrame (\ref gl_sframe) is a tabular,