Friday, June 02, 2017

Today's Paper: Learning to Generate Long-term Future via Hierarchical Prediction

Great demonstrations of powerful combination of recent deep neural networks applications - stacked hourglass networks for human pose estimation [Newell 2016] and visual analogy learning [Reed 2015], enabled amazing results in future video prediction.

Learning to Generate Long-term Future via Hierarchical Prediction, ICML 2017 (to appear) [Arxiv]

Great demo videos are available online.

Abstract:
We propose a hierarchical approach for making long-term predictions of future frames. To avoid inherent compounding errors in recursive pixel-level prediction, we propose to first estimate high-level structure in the input frames, then predict how that structure evolves in the future, and finally by observing a single frame from the past and the predicted high-level structure, we construct the future frames without having to observe any of the pixel-level predictions. Long-term video prediction is difficult to perform by recurrently observing the predicted frames because the small errors in pixel space exponentially amplify as predictions are made deeper into the future. Our approach prevents pixel-level error propagation from happening by removing the need to observe the predicted frames. Our model is built with a combination of LSTM and analogy based encoder-decoder convolutional neural networks, which independently predict the video structure and generate the future frames, respectively. In experiments, our model is evaluated on the Human3.6M and Penn Action datasets on the task of long-term pixel-level video prediction of humans performing actions and demonstrate significantly better results than the state-of-the-art.
A one shot illustration of their approach can be:

(A picture in the paper, with my annotation of leveraged existing work references.)

Thursday, April 27, 2017

ROS Subscriber may be immediately unsubscribed

A caveat for programming in C++ for ROS (Robot Operating System).  The core ROS architecture is of the pub-sub messaging framework, where you can publish on a topic to send messages and subscribe on a topic to receive messages, among ROS nodes.

Both publishing:
ros::NodeHandle nh;
ros::Publisher pub = nh.advertise("some_topic", ..);pub.publish(message);
and subscribing:
ros::Subscriber sub = nh.subscribe("some_topic", .., callback);
are fairly simple to write.  (The callback can be either a function or method, to handle the message received.)

You must hold the returned subscriber object till the end of running your application.  It is a pitfall you can simply ignore it as follows:
nh.subscribe("some_topic", .., callback);
This might result in the deletion of the subscriber object, calling its destructor to unsubscribe from the topic...  You won't have any callback, then.  ;-<

Tuesday, April 11, 2017

Set up ROS Kinetic in macOS

Installation

The official wiki] gives you an extensive (it shouldn't be ideally, though) explanation in installing ROS Kinetic in macOS (f.a.k.a. MacOS X).  Its Trouble Shooting section is mandatory (but not sufficient) to read through.

One of the largest pitfalls in the process is with Qt5 and its python plugin.  Qt is a popular cross-platform UI development framework, on which many applications depend.  Installing `qt` with Homebrew provides Qt4 but we need Qt5 for ROS, which may conflict with Qt4 at least in the Homebrew level.

In my environment to have `Desktop-Full Install` (`Desktop Install (recommended)` might be a lot simpler), at least following was necessary to be set up:
$ brew install --force qt5
$ brew link --force qt5
$ brew install pyqt5 --with-python
$ ln -s /usr/local/Cellar/qt/5.8.0_2/mkspecs /usr/local/mkspecs
$ ln -s /usr/local/Cellar/qt/5.8.0_2/plugins /usr/local/plugins
$ ln -s /usr/local/share/sip/Qt5 /usr/local/share/sip/PyQt5
as well as:
$ brew tap homebrew/science
$ brew install python ; brew linkapps python
$ brew install --force opencv3 --with-contrib ...
$ echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth
$ brew install cmake sip poco eigen qhull pcl libogg theora gazebo8
See the Trouble Shooting section and an issue raised in Homebrew GitHub for more details.  Once prepared these prerequisites, you may go with the `rosdep` step in the wiki but with a `--skip-keys` option:
$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y \
        --skip-keys "libqt5-core libqt5-gui libqt5-opengl libqt5-opengl-dev libqt5-widgets qt5-qmake qtbase5-dev pyqt5"
to allow the installer to skip checking them as you are sure they are there.  See a Q&A entry for more details.

You need to avoid the `string.h` issue in the system, by specifying `-DCMAKE_FIND_FRAMEWORK=LAST` for `catkin_make_isolated` to use it from the standard library.  See an issue in the `ros/rosdistro` GibHub for the solution.  Also, according to a workaround for Homebrew Python Segfault issues] it might be better to specify PYTHON_INCLUDE_DIR and PYTHON_LIBRARY variables to point to Homebrew's.
$ ./src/catkin/bin/catkin_make_isolated --install \
    -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_BUILD_TYPE=Release \
    -DPYTHON_INCLUDE_DIR="/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Headers" \
    -DPYTHON_LIBRARY="/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib"
Some fix was needed for me.  For `src/image_pipeline/image_view/CMakeLists.txt`:
#find_package(OpenCV REQUIRED)
find_package(OpenCV HINTS /usr/local/Cellar/opencv3/3.2.0/ REQUIRED)
Maybe optional but for `src/class_loader/CMakeLists.txt`:
#find_package(Poco REQUIRED COMPONENTS Foundation)
find_package(Poco HINTS /usr/local/Cellar/poco/1.7.8_1 REQUIRED COMPONENTS Foundation)
Do not forget to purge components under `*_isolated/` if you have accidentally failed to build.

To have it consistent with the Ubuntu convention, instead:
$ ./src/catkin/bin/catkin_make_isolated --install \
    --install-space /opt/ros/kinetic \
    ...

Fix rviz with a workaround

With Qt5, rviz causes Segmentation Fault due to an improper parameter passed to Ogre's createRenderWindow().  This is due to rviz's dependency on `QT_MAC_USE_COCOA`, used to be defined in Qt4, but no more in Qt5 probably because Qt5 only works with Cocoa but not with Carbon.  A workaround can be found in an issue raised in rviz.

Edit `src/rviz/src/rviz/ogre_helpers/render_system.cpp` to have:
// This is required for QT_MAC_USE_COCOA to be set
#include
// workaround as Qt5 doesn't set it properly
#define QT_MAC_USE_COCOA
Then rebuild rviz:
$ rm -rf devel_isolated/rviz build_isolated/rviz
$ ./src/catkin/bin/catkin_make_isolated --install --from-pkg rviz -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST
***

Tips in Trial and Errors


To resume from intermediate, where you failed to build and fixed (such as installing dependencies):

$ ./src/catkin/bin/catkin_make_isolated --install \
    --from-pkg

Other References


http://stackoverflow.com/questions/21064128/cant-get-opencv-to-work-on-osx-using-cmake
http://answers.ros.org/question/95056/building-rosconsole-osx-109/

# Running roscore and rviz

    $ pip install defusedxml
    $ brew install ogre1.9

First thing is to run `roscore`, which is a collection of nodes and programs that are pre-requisites of a ROS-based system.

    $ source /opt/ros/kinetic/setup.bash
    $ export ROS_HOSTNAME=localhost
    $ export ROS_MASTER_URI=http://localhost:11311
    $ roscore

For setting up networks, see an official Wiki.
You may see something like following:

    $ roscore
    ... logging to /Users/mich/.ros/log/c1234e21-1eb7-11e7-a096-c4b301ccf3ff/roslaunch-mich-mbp2.local-62976.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
 
    started roslaunch server http://localhost:55042/
    ros_comm version 1.12.7
 
 
    SUMMARY
    ========
 
    PARAMETERS
     * /rosdistro: kinetic
     * /rosversion: 1.12.7
 
    NODES
 
    auto-starting new master
    process[master]: started with pid [62983]
    ROS_MASTER_URI=http://localhost:11311/
 
    setting /run_id to c1234e21-1eb7-11e7-a096-c4b301ccf3ff
    process[rosout-1]: started with pid [62986]
    started core service [/rosout]

In another Terminal shell (tab/window),

    $ source /opt/ros/kinetic/setup.bash
    $ rviz rviz

![Screen Capture of rviz running](https://github.ibm.com/cognitive-robot-innovation-lab/cril_visionaries/raw/master/images/ros_kinetic_osx/rviz.png)

It was supposed to be:

    $ rosrun rviz rviz

but `rosrun` won't work for now.

See an official Wiki page for more details.

Monday, September 01, 2014

Set up OpenCV for Python in MacOS X

Install/update Xcode from App Store and launch it to pass through terms agreement prompts.

Install Xcode Command Line Tools for easing later processes.
xcode-select --install
c.f. Stack Overflow thread

Install OpenCV.
$ brew install gcc
$ brew install opencv3
Now install python modules for OpenCV.
$ pip install cv2

You have to provide a shared library for it.  This is the key step. 
$ pushed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
$ ln -s /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cv2.so
$ popd
Test if it works.
$ python
>>> import cv2
>>>  
It should finish without showing any error.

If this is for your virtualenv, do similarly in your venv directory.

Friday, June 08, 2012

Linked Data Basic Profile Distilled

Here are key practices we need to follow according to the Linked Data Basic Profile 1.0.

Use standard HTTP methods for touching resources.
As well as SPARQL, a resource server should provide HTTP methods of POST or PUT, DELETE, PUT or PATCH, and GET for creating, deleting, updating, and fetching resources. For update-collision tolerance, clients should use HTTP If-Match and ETags for updating resources (with PUT or PATCH).

Use RDF/XML for representing any resource indicated by and requested through a URI.

To be continued.

Tuesday, April 17, 2012

Essence of Linked Data Basic Profile

In April, the "Linked Data Basic Profile 1.0" was published as a W3C member submission, lead by IBM Rational but involving other vendors such as Oracle and RedHat as well as SemanticWeb.com. It specifies practical rules that clarify or extend Tim Berners-Lee's basic rules (Use URIs as names for things, provided with info in RDF* or through SPARQL accessible through HTTP for the URIs. Also, these info should include other URIs to discover more.)

The specification try to answer the rest of things practically inevitable to provide better Linked Data. The questions answered are:
  • How do we create a resource, or what do we POST to?
  • Where can we get the list of existing resources?
  • Which vocabulary and media types do we use?
  • How do we split the information into pages when it gets big?
  • How do we specify ordering?
For that, the set of rules focus on the following concepts:
  • Basic Profile Resources (BPR) - HTTP and RDF techniques to use to read/write liked data
  • Basic Profile Containers (BPC) - a BPR for POST to create new things and GET to find existing
  • Paging - a mechanism to get the content of a BPC in chunks
  • Ordering - a mechanism to specify the order of a sorted BPC

For more information, a developerWorks article and a paper and its presentation at WWW 2012 workshop on Linked Data on the Web (LDOW 2012) help to understand the motivation behind the spec. Also, there is a collection of use cases and requirements on which the spec was built.

Wednesday, December 07, 2011

Today's Paper: WSLA for Crowds

A promising insight for crowds (crowdsourcing) as a service, which should/will have a standardized interface for service requests among various crowds platform providers in the near future.

  • Khazankin, et al., QoS-Based Task Scheduling in Crowdsourcing Environments, ICSOC 2011. [EE]

Abstract:
Crowdsourcing has emerged as an important paradigm in human-problem solving techniques on the Web. One application of crowdsourcing is to outsource certain tasks to the crowd that are difficult to implement as solutions based on software services only. Another benefit of crowdsourcing is the on-demand allocation of a flexible workforce. Businesses may outsource certain tasks to the crowd based on workload variations. The paper addresses the monitoring of crowd members’ characteristics and the effective use of monitored data to improve the quality of work. Here we propose the extensions of standards such as Web Service Level Agreement (WSLA) to settle quality guarantees between crowd consumers and the crowdsourcing platform. Based on negotiated agreements, we provide a skill-based crowd scheduling algorithm. We evaluate our approach through simulations.

Saturday, March 20, 2010

Friday, February 26, 2010

Today's Paper: Multiple Dispatch Study

A paper in OOPSLA 2008, "Multiple Dispatch in Practice" has a very good introductory on multiple-dispatching, method implementation selection based on the runtime types of not only the first argument (this) but all the arguments.

  • Muschevich, et al., Multiple Dispatch in Practice, OOPSLA 2008 [EE]

In addition to an empirical study of the use of multiple dispatch in practice, the paper starts from a brief history and overview of multiple dispatch, which is brilliant.

Friday, August 28, 2009

PHP Pitfalls: An array's pointer is reset when copied

Array's pointers are reset when the original array is logically copied and thus has 2+ reference counts internally. This doesn't happen if it is not logically copied.

$a = array("one", "two");
next($a);
var_dump(current($a)); //=> "two"
$b = $a;
var_dump(current($a)); // => "one"
?>

Tuesday, January 06, 2009

Today's Book: The Art of Multiprocessor Programming

The Art of Multiprocessor Programming is a new FIRST-READ book for concurrency study.

This book comprehensively presents the principles and tools available for programming multiprocessor machines. It is of immediate use to programmers working with the new architectures. The authors are the leaders in this research community. Sample programs are written in Java.

Wednesday, October 29, 2008

XHR Caching Test Catch-up

I examined recent Web Browser implementation with XMLHttpRequest Caching Test, which was posted by mnot, 2 years ago.
The set of browsers I examined includes the latest stable Windows versions of Mozilla Firefox, Microsoft Internet Explorer, Opera, Apple Safari, and Google Chrome.

Tuesday, October 28, 2008

Today's Paper: MapJAX: Data Structure Abstractions for Ajax (USENIX 2007)

A model paper for discussing based on Ajax-like technologies. I have just found a PDF file of this paper in many icons on my desktop...

Title:
MapJAX: Data Structure Abstractions for Asynchronous Web Applications

Authors:
Daniel S. Myers, Jennifer N. Carlisle, James A. Cowling, and Barbara H. Liskov, MIT CSAIL

EE:
http://www.usenix.org/events/usenix07/tech/myers.html

Abstract:

The current approach to developing rich, interactive web applications relies on asynchronous RPCs (Remote Procedure Calls) to fetch new data to be displayed by the client. We argue that for the majority of web applications, this RPC-based model is not the correct abstraction: it forces programmers to use an awkward continuation-passing style of programming and to expend too much effort manually transferring data. We propose a new programming model, MapJAX, to remedy these problems. MapJAX provides the abstraction of data structures shared between the browser and the server, based on the familiar primitives of objects, locks, and threads. MapJAX also provides additional features (parallel for loops and prefetching) that help developers minimize response times in their applications. MapJAX thus allows developers to focus on what they do best-writing compelling applications-rather than worrying about systems issues of data transfer and callback management.

We describe the design and implementation of the MapJAX framework and show its use in three prototypical web applications: a mapping application, an email client, and a search-autocomplete application. We evaluate the performance of these applications under realistic Internet latency and bandwidth constraints and find that the unoptimized MapJAX versions perform comparably to the standard AJAX versions, while MapJAX performance optimizations can dramatically improve performance, by close to a factor of 2 relative to non-MapJAX code in some cases.

Monday, October 13, 2008

Today's Person: Mr. Software Rejuvenation Never Aging

Software rejuvenation is a proactive fault management technique for preventing the occurrence of severe crash failures in the future by cleaning up the state of a system. As bug-zero software is almost impossible, it is a practical solution to provide a robust system.

Prof. Kishor Trivedi and his group has contributed a lot to this area. Their webpage presents very useful information for studying the cutting-edge of this research, including Prof. Trivedi's keynote speeches, many conference/journal papers, and whitepapers.


Friday, September 12, 2008

The Best Introduction to InvokeDynamic (JSR 292)

Charles Nutter, the JRuby development lead, posted an extensive introductory article on the road towards JSR 292 Supporting Dynamically Typed Languages on the Java Platform (a.k.a. invokedynamic). According to his experience with prototyping of JRoby using InvokeDynamic, he has explained how we can leverage the coming feature of JVM. He also mentions things that are not covered in the current draft of the specification (EDR), such as AnonymousClassLoader, which are critical to support dynamic languages on top of the Java platform.

Charles Nutter, First taste of InvokeDynamic:

Tuesday, September 02, 2008

Google Chrome Explained in a Comic Book

The brilliant design of Google Chrome Web browser is explained in a comic style, including its per-tab process, hidden-class optimization in the V8 JavaScript engine, user interfaces, and so far.
It is a model technology show case displaying fairly deep technologies in attractive words of brevity and clarity.

Saturday, July 19, 2008

Today's Paper: Follow-ups for Google's MapReduce

Ralf Lämmel: Google's MapReduce programming model - Revisited. Sci. Comput. Program. 70(1): 1-30 (2008)
http://dx.doi.org/10.1016/j.scico.2007.07.001

Abstract:
Google’s MapReduce programming model serves for processing large data sets in a massively parallel manner. We deliver the first rigorous description of the model including its advancement as Google’s domain-specific language Sawzall. To this end, we reverse-engineer the seminal papers on MapReduce and Sawzall, and we capture our findings as an executable specification. We also identify and resolve some obscurities in the informal presentation given in the seminal papers. We use typed functional programming (specifically Haskell) as a tool for design recovery and executable specification. Our development comprises three components: (i) the basic program skeleton that underlies MapReduce computations; (ii) the opportunities for parallelism in executing MapReduce computations; (iii) the fundamental characteristics of Sawzall’s aggregators as an advancement of the MapReduce approach. Our development does not formalize the more implementational aspects of an actual, distributed execution of MapReduce computations.

Jeffrey's MapReduce papers and Talk:
  • Jeffrey Dean, Sanjay Ghemawat: MapReduce: simplified data processing on large clusters. Commun. ACM 51(1): 107-113 (2008)
    http://doi.acm.org/10.1145/1327452.1327492
  • Jeffrey Dean: MapReduce and Other Building Blocks for Large-Scale Distributed Systems at Google. Invited Talk at USENIX Annual Technical Conference 2007
    http://www.usenix.org/media/events/usenix07/tech/mp3/dean.mp3

Friday, May 30, 2008

Today's Paper: Groovy O/R Mapping in ACM Queue

Chris Richardson has an ACM Queue article on O/R Mapping frameworks for dynamic languages, referring GORM (Groovy O/R Mapping). He successfully introduces GORM by highlighting its difference from Java's solution, Hybernate.

ORM in Dynamic Languages

Volume 6 , Issue 3 (May/June 2008)
Object-Relational Mapping
FEATURE: Q focus: Object-Relational Mapping
Pages 28-37
Year of Publication: 2008
ISSN:1542-7730


Author:
Chris Richardson

Abstract:
A major component of most enterprise applications is the code that transfers objects in and out of a relational database. The easiest solution is often to use an ORM (object-relational mapping) framework, which allows the developer to declaratively define the mapping between the object model and database schema and express database-access operations in terms of objects. This high-level approach significantly reduces the amount of database-access code that needs to be written and boosts developer productivity.

Tuesday, May 13, 2008

Best Twitter Architecture Introductory

Alex Iskold posted an excellent article on the architecture of the Twitter platform. It clearly explains what are problems and how they are solved in terms of relational DB and Computing Clouds.

Tuesday, April 22, 2008

Today's Paper: Internet Monetization Papers in WWW 2008

This year's WWW conference accepted a lot of papers related to business method issues in world-wide web and had 3 sessions named "monetization". :-)

Internet Monetization: Online advertising
  • Arpita Ghosh, Mohammad Mahdian: Externalities in online advertising. pp.161-168
  • Uriel Feige, Nicole Immorlica, Vahab S. Mirrokni, Hamid Nazerzadeh: A combinatorial allocation mechanism with penalties for banner advertising. pp.169-178
  • Hamid Nazerzadeh, Amin Saberi, Rakesh Vohra: Dynamic cost-per-action mechanisms and applications to online advertising. pp.179-188
Internet Monetization: Recommendation and security
  • Jason D. Hartline, Vahab S. Mirrokni, Mukund Sundararajan: Optimal marketing strategies over social networks. pp.189-198
  • Reid Andersen, Christian Borgs, Jennifer T. Chayes, Uriel Feige, Abraham D. Flaxman, Adam Kalai, Vahab S. Mirrokni, Moshe Tennenholtz: Trust-based recommendation systems: an axiomatic approach. pp.199-208
  • Jens Grossklags, Nicolas Christin, John Chuang: Secure or insure?: a game-theoretic analysis of information security games. pp.209-218
Internet Monetization: Sponsored Search
  • Anindya Ghose, Sha Yang: Analyzing search engine advertising: firm behavior and cross-selling in electronic markets. pp.219-226
  • Massimiliano Ciaramita, Vanessa Murdock, Vassilis Plachouras: Online learning from click data for sponsored search. pp227-236