Giter VIP home page Giter VIP logo

hooi_sample's Introduction

Japanese/ English

Comparison between HOSVD and HOOI

Summary

Performs low-rank approximation of a given image. We compare two schemes, the higher order singular value decomposition (HOSVD), and the higher orthogonal iteration of tensors (HOOI).

Usage

$ python hooi_sample.py filename ratio

The 1st argument is input file. The 2nd argument determines how many ranks will be used for approximation. Consider a Image with the size of (w,h). Then the width will be truncated to be int(w*ratio) and the height to be int(h*ratio).

When the value of ratio is not specified, then 0.2 will be used.

Example

$ python hooi_sample.py uma.jpg  
Ratio = 0.2
Performing HOSVD
0.966415890942
Saved as uma_hosvd.jpg
Performing HOOI
1.29997357769
0.977742274282
0.957462600028
0.953166704329
0.95163785607
0.950901319943
0.950467674764
0.950171911725
0.949946487327
0.949759967973
Saved as uma_hooi.jpg

The numbers denotes the residual. Suppose X is the original tensor and XP is the approximated tensor. Then residula r is defined by r = |X - XP|/|X|, where |X| denotes the Frobenius norm of X. The HOOI shows better performance than the HOSVD.

Input image (Original)

uma.jpg

Approximated image (HOSVD, ratio = 0.2, r = 0.966415890942)

uma_hosvd.jpg

Approximated image (HOOI, ratio = 0.2, r = 0.949759967973)

uma_hooi.jpg

hooi_sample's People

Contributors

kaityo256 avatar

Watchers

James Cloos avatar Xiaogang Yang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.