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

Add support for GNU Octave 4.0 #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,37 @@ data_background_small2.mat
To compare with the one-shot classification results in our paper, run 'demo_classification.m' in the 'one-shot-classification' folder to demo a baseline model using Modified Hausdorff Distance.


### GNU OCTAVE 4.0

Changes needed to make MATLAB demos compatible with GNU Octave 4.0:

##### Before running 'demo.m'.:

1. Change classdef Dataset superclass to 'handle'
- Edit 1st line of 'Dataset.m’, and change 'matlab.mixin.copyable' to 'handle'
- (see http://www.mathworks.com/help/matlab/ref/matlab.mixin.copyable-class.html)
- CAUTION: Is this change safe? Does it degrade performance? Will it result in too much memory usage?

2. Move 'randint' function from Dataset.m to a standalone file
- cut the 'randint' function from bottom of Dataset.m
- paste the cut function into new file randint.m


##### Before running 'demo_classification.m' in the 'one-shot-classification' folder:

1. Download packages:
- http://octave.sourceforge.net/io/index.html
- http://octave.sourceforge.net/statistics/index.html

2. install/load from the Octave prompt:
- pkg install {download-directory}\io-2.4.1.tar.gz - pkg install {download-directory}\statistics-1.2.4.tar.gz
- pkg load statistics

##### Octave Bug:
- 'plot_motor_on_image' renders unwanted artifacts
- Workaround: switch to 'plot_image_only' in demo.m


### PYTHON

Python 2.7.*
Expand Down
18 changes: 1 addition & 17 deletions matlab/Dataset.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef Dataset < matlab.mixin.Copyable
classdef Dataset < handle
%DATASET Class that stores structured character data
% This class stores, and provides easy access, to the
% sturctured character data. Using the "get" method,
Expand Down Expand Up @@ -201,20 +201,4 @@

end

end

% Generate a matrix of uniformly distributed random integers.
%
% This replaces the deprecated matlab function by the same name.
%
% Input
% m: number of rows
% n: number of columns
% rg: [1 x 2] uses numbers from [min max] inclusive
%
% Output
% out: [m x n] matrix of random integers
function out = randint(m,n,rg)
assert(numel(rg)==2);
out = randi(rg,m,n);
end
15 changes: 15 additions & 0 deletions matlab/randint.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% Generate a matrix of uniformly distributed random integers.
%
% This replaces the deprecated matlab function by the same name.
%
% Input
% m: number of rows
% n: number of columns
% rg: [1 x 2] uses numbers from [min max] inclusive
%
% Output
% out: [m x n] matrix of random integers
function out = randint(m,n,rg)
assert(numel(rg)==2);
out = randi(rg,m,n);
end