plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | NeuroInfoPrimer/primer-master | f1dim.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/f1dim.m | 280 | utf_8 | d34aa9e52f8841e546acac1b9c33eb71 | % Move pcom (x units in xicom direction), and then evaluate the function there.
function [f] = f1dim(x, stim, resp, order)
% Must accompany linmin.
global pcom; % Defned in linmin.
global xicom;
global nrfunc;
f = feval(nrfunc, pcom + x.*xicom, stim, resp, order);
|
github | sanjitsbatra/Minimal-Complexity-Machine-Hyperspectral-Band-Selection-master | auc.m | .m | Minimal-Complexity-Machine-Hyperspectral-Band-Selection-master/Indian_Pines/auc.m | 1,139 | utf_8 | 4d20c857e7b3755f9d0c3cbfd41f2f87 | function auc = auc(category,posterior)
% auc = scoreAUC(category,posterior)
%
% Calculates the area under the ROC for a given set
% of posterior predictions and labels. Currently limited to two classes.
%
% posterior: n*1 matrix of posterior probabilities for class 1
% category: n*1 matrix of categories {0,1}
% auc: A... |
github | sanjitsbatra/Minimal-Complexity-Machine-Hyperspectral-Band-Selection-master | mcc.m | .m | Minimal-Complexity-Machine-Hyperspectral-Band-Selection-master/Indian_Pines/mcc.m | 1,018 | utf_8 | f5631817d0f7461207cb15fdebeeb62b | % R = matthewscorr(true_label, predicted_label)
%
% computes the 'Matthews correlation coefficient' as described on Wikipedia
% (http://en.wikipedia.org/wiki/Matthews_correlation_coefficient)
%
% It's supposedly a special correlation coefficient for binary data (e.g.
% in binary classification) and computes the correla... |
github | nilsolav/ARISreader-master | motion_correction.m | .m | ARISreader-master/motion_correction.m | 851 | utf_8 | 205cece50450ce7be3fb615ec36b2d18 | %Motion Correction for DIDSON
function framenew=motion_correction(data,velocity)
[n,m]=size(data.frame); %Find out if 48 or 96 wide
framenew=uint8(zeros(n,m));
time=2*data.maxrange/1500; %roundtrip time for sound to go maxrange and back
deltarange=(data.maxrange - data.minrange)/512; %Size of range bin.
dista... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part4.m | .m | Computer-Vision-using-MATLAB-master/part4.m | 3,058 | utf_8 | 2b5aa5038335ccd95c683299154e9b54 |
%% Function where our program starts
function asg1_part_4()
%----------------------------------------------------------------
% USAGE: asg1_part_4
% Output: Adds and removes noise from the image
%----------------------------------------------------------------
% Given the Image filename/path
pic1_name ... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part7.m | .m | Computer-Vision-using-MATLAB-master/part7.m | 2,150 | utf_8 | e8bd7c8e8475f3adf81187a5b104e766 |
%% Function where our program starts
function part3()
%----------------------------------------------------------------
% USAGE: asg22_part_1
% Output: Applying various rotation operations
%----------------------------------------------------------------
% Given the Image filename/path
pic1_name = 'len... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part6.m | .m | Computer-Vision-using-MATLAB-master/part6.m | 2,616 | utf_8 | 1efa2d8f94315e8cc176fe511737bc21 |
%% Function where our program starts
function asg22_part_1()
%----------------------------------------------------------------
% USAGE: asg22_part_1
% Output: Applying various edge detection operations
%----------------------------------------------------------------
% Given the Image filename/path
pic... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part5.m | .m | Computer-Vision-using-MATLAB-master/part5.m | 4,053 | utf_8 | dea8fb085af87dabacbf79a7048ecb01 |
%% Function where our program starts
function part1()
%----------------------------------------------------------------
% USAGE: asg22_part_1
% Output: Applying various edge detection operations
%----------------------------------------------------------------
% Given the Image filename/path
pic1_name ... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part1.m | .m | Computer-Vision-using-MATLAB-master/part1.m | 2,457 | utf_8 | 9d7353776d9b4118794dbcaa0505a6c7 | %Read and display RGB and gray image (.pgm)
%Filename: asg1_part_1.m
%Updated 13-JUN-2016
%% Function where our program starts
function asg1_part_1()
%----------------------------------------------------------------
% USAGE: asg1_part_1
% Output: Displays the RGB and Grayscale images
%------------------------... |
github | jayavardhanravi/Computer-Vision-using-MATLAB-master | part2.m | .m | Computer-Vision-using-MATLAB-master/part2.m | 3,676 | utf_8 | 39f5590b86658cd3982d3c42d92f5840 |
%% Function where our program starts
function asg1_part_2()
%----------------------------------------------------------------
% USAGE: asg1_part_2
% Output: Displays the enhanced image by linear stretching
%----------------------------------------------------------------
% Given the Image filename/path
... |
github | SNLC/ISI-master | splitPatchesX.m | .m | ISI-master/splitPatchesX.m | 11,471 | utf_8 | 0deef20b12c4e6d2d3d742829cd3cf38 | function im = splitPatchesX(im,kmap_hor,kmap_vert,kmap_rad,pixpermm)
figTag = 0; % if you'd like to see figures along the way
xsize = size(kmap_hor,2)/pixpermm; %Size of ROI mm
ysize = size(kmap_hor,1)/pixpermm;
xdum = linspace(0,xsize,size(kmap_hor,2)); ydum = linspace(0,ysize,size(kmap_hor,1));
[xdom ydom... |
github | SNLC/ISI-master | getMouseAreasX.m | .m | ISI-master/getMouseAreasX.m | 9,763 | utf_8 | a978ab66003737a2adf02f46ddb298a6 | function im = getMouseAreasX(kmap_hor,kmap_vert,pixpermm)
%% INPUTS
%kmap_hor - Map of horizontal retinotopic location
%kmap_vert - Map of vertical retinotopic location
%pixpermm = mm/pix of the retinotopy images
% The images in Garrett et al '14 were collected at 39 pixels/mm. It is
% recommended that kmap_ho... |
github | SNLC/ISI-master | fusePatchesX.m | .m | ISI-master/fusePatchesX.m | 8,580 | utf_8 | 92e754280e0aa8f0741b4d81d74e4b20 | function [im fuseflag] = fusePatchesX(im,kmap_hor,kmap_vert,pixpermm)
%Fuse patches if they are adjacent, the same sign, and unique regions of visual space
xsize = size(kmap_hor,2)/pixpermm; %Size of ROI mm
ysize = size(kmap_hor,1)/pixpermm;
xdum = linspace(0,xsize,size(kmap_hor,2)); ydum = linspace(0,ysize,s... |
github | SNLC/ISI-master | freezeColors.m | .m | ISI-master/Utilities/freezeColors.m | 9,815 | utf_8 | 2068d7a4f7a74d251e2519c4c5c1c171 | function freezeColors(varargin)
% freezeColors Lock colors of plot, enabling multiple colormaps per figure. (v2.3)
%
% Problem: There is only one colormap per figure. This function provides
% an easy solution when plots using different colomaps are desired
% in the same figure.
%
% freezeColors freeze... |
github | SNLC/ISI-master | regImages.m | .m | ISI-master/regImages/regImages.m | 6,927 | utf_8 | 29b7fa7b4f0fb56a833c54f00657fc30 | function varargout = regImages(varargin)
% REGIMAGES M-file for regImages.fig
% REGIMAGES, by itself, creates a new REGIMAGES or raises the existing
% singleton*.
%
% H = REGIMAGES returns the handle to a new REGIMAGES or the handle to
% the existing singleton*.
%
% REGIMAGES('CALLBACK',hObject... |
github | SNLC/ISI-master | Gplotsfmap.m | .m | ISI-master/ISIAnGUI/F0/Gplotsfmap.m | 4,572 | utf_8 | ed48bdb0a56e30e221812f2624611c5d | function Gplotsfmap(mag,sf)
global fh
mag = mag-min(mag(:));
mag = mag/max(mag(:));
set(gcf,'Color',[1 1 1]);
imagesc(mag)
imagesc(sf,'AlphaData',mag)
colorbar
axis image;
fh = gcf;
datacursormode on;
dcm_obj = datacursormode(fh);
set(dcm_obj,'DisplayStyle','window','SnapToDataVertex','on','Update... |
github | SNLC/ISI-master | plotpixel_cb.m | .m | ISI-master/ISIAnGUI/F0/plotpixel_cb.m | 4,402 | utf_8 | 90819d51530cbd24d8fa6ac75a877e33 | function plotpixel_cb
fh = gcf;
%colorbar('YTick',[1 16:16:64],'YTickLabel',{'0','45','90','135','180'})
datacursormode on;
dcm_obj = datacursormode(fh);
set(dcm_obj,'DisplayStyle','window','SnapToDataVertex','on','UpdateFcn',@myupdatefcn);
function txt = myupdatefcn(empt,event_obj)
%Matlab doesn't lik... |
github | SNLC/ISI-master | processEpi.m | .m | ISI-master/ISIAnGUI/F0/processEpi.m | 37,401 | utf_8 | 09f6eb044d564deb9a3487630bdbe9be | function varargout = processEpi(varargin)
% PROCESSEPI M-file for processEpi.fig
% PROCESSEPI, by itself, creates a new PROCESSEPI or raises the existing
% singleton*.
%
% H = PROCESSEPI returns the handle to a new PROCESSEPI or the handle to
% the existing singleton*.
%
% PROCESSEPI('C... |
github | SNLC/ISI-master | Gplotcolormap.m | .m | ISI-master/ISIAnGUI/F0/Gplotcolormap.m | 4,216 | utf_8 | a3047877ce984491c0a9cceb48806dea | function Gplotcolormap(mag,ang)
global fh
mag = mag-min(mag(:));
mag = mag/max(mag(:));
set(gcf,'Color',[1 1 1]);
x = image(1:length(ang(:,1)),1:length(ang(1,:)),ang*64/(180),'CDataMapping','direct','AlphaData',mag,'AlphaDataMapping','none');
axis image;
colormap hsv;
fh = gcf;
colorbar('YTick',[1 16... |
github | SNLC/ISI-master | processF0.m | .m | ISI-master/ISIAnGUI/F0/processF0.m | 43,327 | utf_8 | abbbda300c522dc2849bbad1d5c4093a | function varargout = processF0(varargin)
% PROCESSF0 M-file for processF0.fig
% PROCESSF0, by itself, creates a new PROCESSF0 or raises the existing
% singleton*.
%
% H = PROCESSF0 returns the handle to a new PROCESSF0 or the handle to
% the existing singleton*.
%
% PROCESSF0('CALLBACK'... |
github | SNLC/ISI-master | NewF0.m | .m | ISI-master/ISIAnGUI/F0/New/NewF0.m | 36,014 | utf_8 | fc5a519b91d32851eb479ae238819b28 | function varargout = processF0(varargin)
% PROCESSF0 M-file for processF0.fig
% PROCESSF0, by itself, creates a new PROCESSF0 or raises the existing
% singleton*.
%
% H = PROCESSF0 returns the handle to a new PROCESSF0 or the handle to
% the existing singleton*.
%
% PROCESSF0('CALLBACK'... |
github | SNLC/ISI-master | plotpixel_cb_old.m | .m | ISI-master/ISIAnGUI/archive/plotpixel_cb_old.m | 3,488 | utf_8 | 14ec18c514056e2bef5d2fe088b7ed1a | function plotpixel_cb
fh = gcf;
%colorbar('YTick',[1 16:16:64],'YTickLabel',{'0','45','90','135','180'})
datacursormode on;
dcm_obj = datacursormode(fh);
set(dcm_obj,'DisplayStyle','window','SnapToDataVertex','on','UpdateFcn',@myupdatefcn);
function txt = myupdatefcn(empt,event_obj)
%Matlab doesn't lik... |
github | SNLC/ISI-master | OverlayGuide.m | .m | ISI-master/ISIAnGUI/F1/OverlayGuide.m | 10,802 | utf_8 | df9b178fe085f0d65633dd30ca193d53 | function varargout = OverlayGuide(varargin)
% OVERLAYGUIDE M-file for OverlayGuide.fig
% OVERLAYGUIDE, by itself, creates a new OVERLAYGUIDE or raises the existing
% singleton*.
%
% H = OVERLAYGUIDE returns the handle to a new OVERLAYGUIDE or the handle to
% the existing singleton*.
%
% OVERLAY... |
github | SNLC/ISI-master | GrabContOverlay.m | .m | ISI-master/ISIAnGUI/F1/GrabContOverlay.m | 1,348 | utf_8 | 6961feda56f4800a595272e186f1e511 | function GrabContOverlay(varargin)
global ROIcrop IMGSIZE imstate parport imagerhandles
h = imagerhandles;
h.mildig.set('GrabFrameEndEvent',0,'GrabEndEvent',...
0,'GrabStartEvent',0);
grayid = gray;
hsvid = jet;
aw = 1-imstate.intRatio; %anatomy weight of image (scalar)
fw = imstate.intRa... |
github | SNLC/ISI-master | processF1.m | .m | ISI-master/ISIAnGUI/F1/processF1.m | 28,971 | utf_8 | 0ad12142ad88d76f8fdca80518a9051a | function varargout = processF1(varargin)
%PROCESSF1 M-file for processF1.fig
% PROCESSF1, by itself, creates a new PROCESSF1 or raises the existing
% singleton*.
%
% H = PROCESSF1 returns the handle to a new PROCESSF1 or the handle to
% the existing singleton*.
%
% PROCESSF1('Property','Value',... |
github | SNLC/ISI-master | Groi_scatter.m | .m | ISI-master/ISIAnGUI/F1/Groi_scatter.m | 1,838 | utf_8 | e32ff4c30ba21d7d09b74dd58a65223b | function [R dimv] = Groi_scatter(im1,im2,bw,angflag,oriflag)
%Make scatter plot and return corr coef for chosen region of interest.
%angflag set to 1 computes for angular variables.
%oriflag set to 1 assumes the values are in orientation domain (0:180),
%(0:360 otherwise).
bwv = reshape(bw,prod(size(bw)),1);
u... |
github | SNLC/ISI-master | Gf1meanimage.m | .m | ISI-master/ISIAnGUI/F1/Gf1meanimage.m | 1,117 | utf_8 | b7bc9d9ed932434ac6287500552dacdd | function [f1m signals] = Gf1meanimage(varargin)
global Analyzer f1
% Compute mean f1 across all conditions and repeats
nc = length(Analyzer.loops.conds);
f1 = cell(1,nc);
sig1 = cell(1,nc);
for c=1:nc
[f1{c} sig1{c}] = Gf1image(c,varargin);
end
% Now average all the repeats
if length(varargi... |
github | MatthewPeterKelly/TwoPhaseOptimalGait-master | save2pdf.m | .m | TwoPhaseOptimalGait-master/shared/save2pdf.m | 2,184 | utf_8 | 28056d1c6584d93469211eb0e05bdd6a | %SAVE2PDF Saves a figure as a properly cropped pdf
%
% save2pdf(pdfFileName,handle,dpi)
%
% - pdfFileName: Destination to write the pdf to.
% - handle: (optional) Handle of the figure to write to a pdf. If
% omitted, the current figure is used. Note that handles
% are typically... |
github | MatthewPeterKelly/TwoPhaseOptimalGait-master | stitchData.m | .m | TwoPhaseOptimalGait-master/shared/stitchData.m | 1,763 | utf_8 | 98609a390f42028ebf96eddeb318e081 | function [D, Jumps, JumpIdx] = stitchData(Data)
%This function goes through and stitches all of the data together into a
%single time series for plotting.
%Get the size of things
N = length(Data); %Number of phases
Jumps = zeros(N+1,1);
JumpIdx = zeros(N+1,1);
Jumps(1) = Data(1).time(1);
JumpIdx(1) = 1;
D... |
github | MatthewPeterKelly/TwoPhaseOptimalGait-master | plotSolution.m | .m | TwoPhaseOptimalGait-master/shared/plotSolution.m | 12,443 | utf_8 | cf7fd33d005c33e02c8804165bfb41db | function plotSolution(plotInfo)
figNum = 1000; %Start counting here
%stitch together the data for faster plotting
[D, Jumps, JumpIdx] = stitchData(plotInfo.data);
Color_One = 'r';
Color_Two = 'b';
Color_Hip = 'm';
Color_A = [0.5,0.8,0.1];
Color_B = [0.1,0.6,0.6];
Color_Ground = [0.3,0.22,0.1];
Font... |
github | MatthewPeterKelly/TwoPhaseOptimalGait-master | animation.m | .m | TwoPhaseOptimalGait-master/shared/animation.m | 6,248 | utf_8 | 21e3503f25ded07bf0182ba45f524625 | function animation(plotInfo,figNum)
if nargin==2
figH = figure(figNum);
else
figH = figure(100);
end
set(figH,'Name','Animation','NumberTitle','off')
P = plotInfo.parameters;
Data = plotInfo.data;
timeRate = P.animation.timeRate; %1 = Real time, 0.5 = slow motion, 2.0 = fast forward
%Check i... |
github | hunter-packages/eos-master | convert_bfm2009_to_json.m | .m | eos-master/share/convert_bfm2009_to_json.m | 4,047 | utf_8 | 5a9f9ca1d271ff141ac5678ec64ef14d | % Converts the 2009 Basel Face Model (BFM, [1]) to a json file that can be
% read by the eos cereal importer. The json-to-cereal-binary app can
% subsequently be used to generate a small eos .bin file.
%
% [1]: A 3D Face Model for Pose and Illumination Invariant Face
% Recognition, P. Paysan, R. Knothe, B. Amberg, S. R... |
github | jermwatt/machine_learning_refined-main | squared_margin_Newton_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_8/squared_margin_Newton_demo_hw.m | 1,784 | utf_8 | fac4803b40802224a4a89cd2af74796a | function squared_margin_Newton_demo_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
%%% load data %%%
[X,y] = load_data();
w0 = randn(3,1); % initial point
w = squared_margin_newton(X... |
github | jermwatt/machine_learning_refined-main | squared_margin_grad_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_7/squared_margin_grad_demo_hw.m | 1,879 | utf_8 | 7fdeed8f885747047c910ad347a47025 | function squared_margin_grad_demo_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
%%% load data %%%
[X,y] = load_data();
w0 = randn(3,1); % initial point
alpha = 1/(norm(X)^2); % fi... |
github | jermwatt/machine_learning_refined-main | one_versus_all_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_14/one_versus_all_demo_hw.m | 8,193 | utf_8 | e5b0a21446ee6cb9e3bc5f4afba75f0d | function one_versus_all_demo_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data
red = [ 1 0 .4];
blue = [ 0 .4 1];
green = [0 1 0.5];
cyan = [1 0.7 0.5];
grey = [.7 .6 .5];
colors = [red;bl... |
github | jermwatt/machine_learning_refined-main | softmax_Newton_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_4/softmax_Newton_demo_hw.m | 3,525 | utf_8 | a709b6f202bf5578d5c96a9bd4390285 | function softmax_Newton_demo_hw()
% softmax_Newton_demo_hw is a simple linear classification demo with softmax-loss
% on simulated data, with tanh surface (logistic regression interpretation)
% plotted
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by... |
github | jermwatt/machine_learning_refined-main | softmax_grad_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_3/softmax_grad_demo_hw.m | 2,252 | utf_8 | d1f3bde693ace844bc6cddcf9525f945 | function softmax_grad_demo_hw()
% softmax_grad_demo_hw runs the softmax model on a separable two
% class dataset consisting of two dimensional data features.
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Kats... |
github | jermwatt/machine_learning_refined-main | softmax_multiclass_grad_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_15/softmax_multiclass_grad_hw.m | 4,716 | utf_8 | c21cd2d83508a7a38e0e8bc84d845fda | function softmax_multiclass_grad_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load in data
[X,y] = load_data();
% initializations
N = size(X,2);
C = length(unique(y));
X = [ones(size(X,1),1), X... |
github | jermwatt/machine_learning_refined-main | exp_vs_log_demo_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_4/Exercise_4_11/exp_vs_log_demo_hw.m | 2,385 | utf_8 | cc4b9ac957ea7c5be48740a6cd3b535c | function exp_vs_log_demo_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
%%% load data %%%
[X,y] = load_data();
X_tilde = [ones(size(X,1),1) X]'; % use compact notation
w0 = randn(3,1);... |
github | jermwatt/machine_learning_refined-main | nonconvex_newt_demo.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_2/Exercise_2_16/nonconvex_newt_demo.m | 6,370 | utf_8 | bb2db7b0d43b9f6c9c64d5b7c590b1b1 | function nonconvex_newt_demo()
% nonconvex_newt_demo.m is a toy wrapper to illustrate the path
% taken by Hessian descent (or Newton's method). The steps are evaluated
% at the objective, and then plotted. For the first 5 iterations the
% quadratic surrogate used to transition from point to point is also plotted.
% ... |
github | jermwatt/machine_learning_refined-main | convex_newt_demo.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_2/Exercise_2_16/convex_newt_demo.m | 6,029 | utf_8 | c0b0ebe951aadc28c442bcb349e9135b | function convex_newt_demo()
% convex_newt_demo.m is a toy wrapper to illustrate the path
% taken by Hessian descent (or Newton's method). The steps are evaluated
% at the objective, and then plotted. For the first 5 iterations the
% quadratic surrogate used to transition from point to point is also plotted.
% The pl... |
github | jermwatt/machine_learning_refined-main | two_d_grad_wrapper_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_2/Exercise_2_13/two_d_grad_wrapper_hw.m | 3,378 | utf_8 | 03976a5ee2177e71976c0dca7f107101 | function two_d_grad_wrapper_hw()
% two_d_grad_wrapper.m is a toy wrapper to illustrate the path
% taken by gradient descent depending on the learning rate (alpha) chosen.
% Here alpha is kept fixed and chosen by the use. The corresponding
% gradient steps, evaluated at the objective, are then plotted. The plotted poin... |
github | jermwatt/machine_learning_refined-main | nonconvex_grad_surrogate.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_2/Exercise_2_12/nonconvex_grad_surrogate.m | 6,149 | utf_8 | 1e1b59248e06b0eb331cfb6e5ef87bdf | function nonconvex_grad_surrogate()
% nonconvex_grad_surrogate.m is a toy wrapper to illustrate the path
% taken by gradient descent. The steps are evaluated
% at the objective, and then plotted. For the first 5 iterations the
% linear surrogate used to transition from point to point is also plotted.
% The plotted p... |
github | jermwatt/machine_learning_refined-main | convex_grad_surrogate.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_2/Exercise_2_12/convex_grad_surrogate.m | 6,358 | utf_8 | 7aa09832a2e5cb96a6a71559a07bb96f | function convex_grad_surrogate()
% convex_grad_surrogate.m is a toy wrapper to illustrate the path
% taken by gradient descent. The steps are evaluated
% at the objective, and then plotted. For the first 5 iterations the
% linear surrogate used to transition from point to point is also plotted.
% The plotted points ... |
github | jermwatt/machine_learning_refined-main | single_layer_classification_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_6/Exercise_6_5/single_layer_classification_hw.m | 3,641 | utf_8 | 59bb41743d47e82ef1700c3528b2f493 | function single_layer_classification_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
minx = -1;
maxx = 1;
% load/make function to approximate
num_its = 1;
[X,y] = load_data(num_its);
M = 4; % nu... |
github | jermwatt/machine_learning_refined-main | poly_classification_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_6/Exercise_6_3/poly_classification_hw.m | 4,386 | utf_8 | c431f8a7a23eba64acc1584f32f6c81e | function poly_classification_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
xmin = 0; % viewing area minimum
xmax = 1; % viewing area maximum
% parameters to play with
poly_degs = 1:8; % ra... |
github | jermwatt/machine_learning_refined-main | ova_fixed_basis.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_6/Exercise_6_7/ova_fixed_basis.m | 6,385 | utf_8 | 304f90d4b2578e07f3cab6e35f645388 | function ova_fixed_basis()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
red = [ 1 0 .4];
blue = [ 0 .4 1];
green = [0 1 0.5];
cyan = [1 0.7 0.5];
grey = [.7 .6 .5];
blah = [0.7 0.2 0.7];
colors = [red... |
github | jermwatt/machine_learning_refined-main | compare_maps_regression_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_5/Exercise_5_13/compare_maps_regression_hw.m | 5,899 | utf_8 | af7a80966cb08985ae57fa0a41785058 | function compare_maps_regression_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load in data
data = csvread('noisy_sin_samples.csv');
x = data(:,1);
y = data(:,2);
% true underlying data-generatin... |
github | jermwatt/machine_learning_refined-main | tanh_regression_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_5/Exercise_5_9/tanh_regression_hw.m | 3,787 | utf_8 | db911ba87867fe3acf367396024d72ea | function tanh_regression_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data
[x,y] = load_data();
% plot data
subplot(1,2,1)
plot_data(x,y)
%%% Main: perform gradient descent to fit tanh b... |
github | jermwatt/machine_learning_refined-main | fourier_regression_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_5/Exercise_5_8/fourier_regression_hw.m | 2,396 | utf_8 | 335dde33d6f957cbb48d30c69be2ccb4 | function fourier_regression_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data
[x,y] = load_data();
deg = [1,3,5,7,9,15]; % 2 times number of fourier basis elements to try
... |
github | jermwatt/machine_learning_refined-main | poly_regression_hw.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_5/Exercise_5_7/poly_regression_hw.m | 2,331 | utf_8 | d0a562af7498f51539117aa0d4a62fd3 | function poly_regression_hw()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data
[x,y] = load_data();
deg = [1,3,5,7,15,20]; % degree polys to try
% plot data
plot_data(x,... |
github | jermwatt/machine_learning_refined-main | nonconvex_logistic_growth.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_3/Exercise_3_11/nonconvex_logistic_growth.m | 3,971 | utf_8 | 9912feb598590754fafc1342e1b32f02 | function nonconvex_logistic_growth()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data, plot data and surfaces
[X,y] = load_data();
[s,t,non_obj] = plot_surface(X,y);
plot_pts(X,y);
%%% run grad... |
github | jermwatt/machine_learning_refined-main | l2reg_nonconvex_logistic_growth.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_3/Exercise_3_13/l2reg_nonconvex_logistic_growth.m | 4,868 | utf_8 | ebc8020649d14a6664cd1e84f611b7fc | function l2reg_nonconvex_logistic_growth()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data, plot data and surfaces
[X,y] = load_data();
%%% run grad descent with 2 starting points and... |
github | jermwatt/machine_learning_refined-main | PCA_demo.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_9/Exercise_9_2/PCA_demo.m | 1,316 | utf_8 | e0e9464f716fdf1ac431b13f983bb2c8 | function PCA_demo()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load in data
X = csvread('PCA_demo_data.csv');
n = size(X,1);
means = repmat(mean(X),n,1);
X = X - means; % center the data
X = X';
K... |
github | jermwatt/machine_learning_refined-main | recommender_demo.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_9/Exercise_9_4/recommender_demo.m | 1,516 | utf_8 | 803e3336c81a09c8975308d4a853f1dc | function recommender_demo()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load in data
X = csvread('recommender_demo_data_true_matrix.csv');
X_corrupt = csvread('recommender_demo_data_dissolved_matrix.... |
github | jermwatt/machine_learning_refined-main | K_means_demo.m | .m | machine_learning_refined-main/exercises/ed_1/MATLAB/Chapter_9/Exercise_9_1/K_means_demo.m | 1,760 | utf_8 | 12cbdd169683255b31a3cc0dde4f4291 | function K_means_demo()
% This file is associated with the book
% "Machine Learning Refined", Cambridge University Press, 2016.
% by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos.
% load data
X = csvread('kmeans_demo_data.csv');
C0 = [0,0;-.5,.5]; % initial centroid locations
% run K-means
K = ... |
github | Littlehhh/Physical-Optics-master | Common_Functions.m | .m | Physical-Optics-master/HM3/Common_Functions.m | 6,198 | utf_8 | a2b95dc4e80d5f918834e7d90f42f2e6 | function varargout = Common_Functions(varargin)
% COMMON_FUNCTIONS MATLAB code for Common_Functions.fig
% COMMON_FUNCTIONS, by itself, creates a new COMMON_FUNCTIONS or raises the existing
% singleton*.
%
% H = COMMON_FUNCTIONS returns the handle to a new COMMON_FUNCTIONS or the handle to
% the exis... |
github | lanha/SupResPALM-master | SupResPALM.m | .m | SupResPALM-master/SupResPALM.m | 5,481 | utf_8 | 9214dfe4d9d3c0c770c3758a3640df9f | % Code (c) Charis Lanaras, ETH Zurich, Oct 28 2015 (see LICENSE)
% charis.lanaras@geod.baug.ethz.ch
function [E,A] = SupResPALM(hyper, multi, truth, srf, p, h )
% SupResPALM - Perform hyperspectral super-resolution by spectral unmixing
% Usage
% [E,A] = SupResPALM(hyper, multi, truth, srf, p, h )
%
% Inputs
% hy... |
github | NASA-Planetary-Science/HiMAT-master | AOP_Rrs.m | .m | HiMAT-master/Projects/GLAM_BioLithRT/AOP_Rrs.m | 11,200 | utf_8 | b742ad3b4f24fbccb3a860e22bff5ed3 | %--------------------------------------------------------------------------
% Mr. Enrico Schiassi - PhD Student, SIE, University of Arizona
%--------------------------------------------------------------------------
% AOP_Rrs simulates the remote sensing reflectance given the wavelengts,
% the water component concentr... |
github | NASA-Planetary-Science/HiMAT-master | InvModeBioLithRT.m | .m | HiMAT-master/Projects/GLAM_BioLithRT/InvModeBioLithRT.m | 11,237 | utf_8 | 2e41335ffa1cfa73e1322e80cd3fd04d | %--------------------------------------------------------------------------
% Mr. Enrico Schiassi - PhD Student, SIE, University of Arizona
%--------------------------------------------------------------------------
% InvModeBioLithRT computes the objectvie function for the optimization
% problem to retrieve the water... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | readIm.m | .m | Stacked-Autoencoders-for-Denoising-master/readIm.m | 878 | utf_8 | 9424fb977d280287fe47fe6cac712670 | function patches = readIm()
srcFiles = dir('C:\Users\Gautam Sridhar\Documents\MATLAB\train_data\*.jpg'); % the folder in which ur images exists
for i = 1 : 20000
filename = strcat('C:\Users\Gautam Sridhar\Documents\MATLAB\train_data\',srcFiles(i).name);
I = imread(filename);
I = im2double(I);
fea... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | checkNumericalGradient.m | .m | Stacked-Autoencoders-for-Denoising-master/checkNumericalGradient.m | 1,982 | utf_8 | 689a352eb2927b0838af5dc508f6374d | function [] = checkNumericalGradient()
% This code can be used to check your numerical gradient implementation
% in computeNumericalGradient.m
% It analytically evaluates the gradient of a very simple function called
% simpleQuadraticFunction (see below) and compares the result with your numerical
% solution. Your num... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | finetune.m | .m | Stacked-Autoencoders-for-Denoising-master/finetune.m | 2,121 | utf_8 | c2805b30be4442ca28ee00dc9cc2bc30 | function [cost,grad] = finetune(theta,visibleSize,hiddenSizeL1,hiddenSizeL2,...
lambda,data_clean,data_noise)
q = (hiddenSizeL1*hiddenSizeL2)+(hiddenSizeL1*visibleSize);
q1 = (hiddenSizeL2*visibleSize);
W1 = reshape(theta(1:hiddenSizeL1*visibleSize), hiddenSizeL1, visibleSize)... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | sparseAutoencoderCost.m | .m | Stacked-Autoencoders-for-Denoising-master/sparseAutoencoderCost.m | 4,841 | utf_8 | 44eff1bdcc51773f82bfb258c06ec98c | function [cost,grad] = sparseAutoencoderCost(theta, visibleSize, hiddenSize, ...
lambda, sparsityParam, beta, data_clean,data_noise)
% visibleSize: the number of input units (probably 64)
% hiddenSize: the number of hidden units (probably 25)
% lambda: weight decay parame... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | sampleIMAGES.m | .m | Stacked-Autoencoders-for-Denoising-master/sampleIMAGES.m | 2,267 | utf_8 | d6f0a0556800da4b60ec82b3ef2e34d5 | function [patches,patches_rain] = sampleIMAGES()
% sampleIMAGES
% Returns 10000 patches for training
load sample_images; % load images from disk
load sample_images_noise;
patchsize = 21; % we'll use 8x8 patches
numpatches = 25000;
% Initialize patches with zeros. Your code will fill in this matrix--one
% colu... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | feedForwardAutoencoder.m | .m | Stacked-Autoencoders-for-Denoising-master/feedForwardAutoencoder.m | 1,307 | utf_8 | 973991c8ee5b6e23642b3f4ae14701a0 | function [activation,W,b] = feedForwardAutoencoder(theta, hiddenSize, visibleSize, data)
% theta: trained weights from the autoencoder
% visibleSize: the number of input units (probably 64)
% hiddenSize: the number of hidden units (probably 25)
% data: Our matrix containing the training data as columns. So, data(:,... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | predict.m | .m | Stacked-Autoencoders-for-Denoising-master/predict.m | 1,073 | utf_8 | e470f8e7babdfa1e87e1064f3c46faf0 | function [activation] = predict(theta, hiddenSizeL1,hiddenSizeL2, visibleSize, data)
q = (hiddenSizeL1*hiddenSizeL2)+(hiddenSizeL1*visibleSize);
q1 = (hiddenSizeL2*visibleSize);
W1 = reshape(theta(1:hiddenSizeL1*visibleSize), hiddenSizeL1, visibleSize);
W2 = reshape(theta(hiddenSizeL1*visibleSize+1:q), hiddenSiz... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | myOctaveVersion.m | .m | Stacked-Autoencoders-for-Denoising-master/SGD_Files/util/myOctaveVersion.m | 169 | utf_8 | d4603482a968c496b66a4ed4e7c72471 | % return OCTAVE_VERSION or 'undefined' as a string
function result = myOctaveVersion()
if isOctave()
result = OCTAVE_VERSION;
else
result = 'undefined';
end
|
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | isOctave.m | .m | Stacked-Autoencoders-for-Denoising-master/SGD_Files/util/isOctave.m | 108 | utf_8 | 4695e8d7c4478e1e67733cca9903f9ef | %detects if we're running Octave
function result = isOctave()
result = exist('OCTAVE_VERSION') ~= 0;
end |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | makeLMfilters.m | .m | Stacked-Autoencoders-for-Denoising-master/SGD_Files/util/makeLMfilters.m | 1,895 | utf_8 | 21950924882d8a0c49ab03ef0681b618 | function F=makeLMfilters
% Returns the LML filter bank of size 49x49x48 in F. To convolve an
% image I with the filter bank you can either use the matlab function
% conv2, i.e. responses(:,:,i)=conv2(I,F(:,:,i),'valid'), or use the
% Fourier transform.
SUP=49; % Support of the largest filter (must be... |
github | Niharika-SD/Stacked-Autoencoders-for-Denoising-master | normalizeData_t.m | .m | Stacked-Autoencoders-for-Denoising-master/SGD_Files/tests/normalizeData_t.m | 479 | utf_8 | ef9fcd1d42abd9fdfab2ebfc5e6560e1 |
function [patches, mean_p] = normalizeData_t(patches)
% Squash data to [0.1, 0.9] since we use sigmoid as the activation
% function in the output layer
mean_p(:,:) = mean(patches);
% Remove DC (mean of images).
patches = bsxfun(@minus, patches, mean(patches));
% Truncate to +/-3 standard deviations and scale to -1 ... |
github | old-NWTC/AeroDyn-master | PlotClCdCmCurves_DT.m | .m | AeroDyn-master/CertTest/PlotClCdCmCurves_DT.m | 2,715 | utf_8 | bea073e257b28bbfa3ef69c2d6b35494 |
function PlotClCdCmCurves_DT(Index, baseName, baseFolder )
if (nargin < 2)
Index = 2; % Valid values are 1, 2, 3
end
if (nargin < 2)
%baseName = 'AOC';
baseName = 'NRELOffshrBsline5MW_Onshore';
end
if (nargin < 3)
baseFolder = '.\NREL_Results';
%baseFolder = '.\Results';
end
LineColors... |
github | old-NWTC/AeroDyn-master | PlotResults.m | .m | AeroDyn-master/CertTest/PlotResults.m | 13,523 | utf_8 | e921ed7f84db7bb19a9fe28b3bcd3217 | function PlotResults(azimuth)
WTP_Results_File = 'C:\Dev\NREL_SVN\WT_Perf\branches\v4.x\CertTest\ccBlade_UAE.WTP.out';
% Setup data which both files have in common
%r = [0.5680,0.8801,1.2321,1.5087,1.7099,1.9278,2.1457,2.3469,2.5480,2.7660,2.9840,3.1850,3.3862,3.6041,3.8220,4.0232,4.2244,4.4004,4.5764,4.7776,4.953... |
github | old-NWTC/AeroDyn-master | PlotClCdCmCurves_Hz.m | .m | AeroDyn-master/CertTest/PlotClCdCmCurves_Hz.m | 3,602 | utf_8 | 8fca2d1a539cb903b730f6633584e757 |
function PlotClCdCmCurves_Hz(Index, baseName, baseFolder)
if (nargin < 2)
Index = 2; % Valid values are 1, 2, 3
end
if (nargin < 2)
baseName = 'AOC';
%baseName = 'NRELOffshrBsline5MW_Onshore';
end
if (nargin < 3)
baseFolder = '.\NREL_Results';
%baseFolder = '.\Results';
end
LineColors ... |
github | old-NWTC/AeroDyn-master | Compare_2D_Results.m | .m | AeroDyn-master/CertTest/UA_Tests/Compare_2D_Results.m | 6,119 | utf_8 | 3290995315bbc59c1863ad9be215cf94 | function Compare_2D_Results(localFolder, NRELFolder, ExpFolder, legendStr)
% Compare NREL's UnsteadyAero Models with experimental data for the:
% NACA, LS417, and S809 airfoils. See the following reference for
% details:
%
% Rick Damiani, Greg Hayman, and Jason M. Jonkman.
% "Development and Validation of a... |
github | old-NWTC/AeroDyn-master | get_data2.m | .m | AeroDyn-master/CertTest/BEMT Validation/data/analysis/get_data2.m | 5,159 | utf_8 | 84e467cc231c7210f968c4d50ee8b269 | % [data] = engload_new(filnam, nchan, nsamp)
clear; close all;
function [az_vec, th_vec_all, tq_vec_all] = get_uae_azimuth_data(wind_speed, yaw)
hd_file = '';
eng_file = '';
% setup file names
filenum = ['H', num2str(wind_speed, '%02d'), ...
num2str(yaw, '%04d'), '0'];
hd_file = ... |
github | old-NWTC/AeroDyn-master | PlotResults2.m | .m | AeroDyn-master/CertTest/BEMT Validation/data/analysis/PlotResults2.m | 70,808 | utf_8 | f4aef702cc127a6047c366a25f72bd3f | function PlotResults2(plotMask, azimuth)
AD_v15dir = '..\AD_v15';
ADv15_skew_root = 'skewWakeCorr';
ADv15_noskew_root = 'noSkewWakeCorr';
WTP_wSkew = '..\WT_Perf\skewWakeCorr.out';
WTP_woutSkew = '..\WT_Perf\noSkewWakeCorr.out';
WTP_coupledSkew = '..\WT_Perf\coupledCorr.out';
FASTdir = '..\FAST8\';
... |
github | old-NWTC/AeroDyn-master | engload_new.m | .m | AeroDyn-master/CertTest/BEMT Validation/data/analysis/engload_new.m | 1,965 | utf_8 | 102e56da6d8ff0edbb069ce6b54e7eb5 | %engload_new.m
%This program reads the UAE *.eng files directly.
function [data] = engload_new(filnam, nchan, nsamp)
%================================================================
% %clear everything before starting
% clear all;
%
% %enter the file names from the keyboard
% filnam = input('Enter ... |
github | old-NWTC/AeroDyn-master | PlotResults.m | .m | AeroDyn-master/CertTest/BEMT Validation/data/analysis/PlotResults.m | 66,521 | utf_8 | 3b4aa58f127ad78e1c92cf572f4f6e74 | function PlotResults(plotMask, azimuth)
WTP_wSkew = '..\WT_Perf\skewWakeCorr.out';
WTP_woutSkew = '..\WT_Perf\noSkewWakeCorr.out';
FASTdir = '..\FAST8\';
UAEdir = '..\UAE\';
% Setup data which both files have in common
%r = [0.5680,0.8801,1.2321,1.5087,1.7099,1.9278,2.1457,2.3469,2.5480,2.7660... |
github | yunjunz/GeodMod-master | add_shade2Data.m | .m | GeodMod-master/PlotDatalib/add_shade2Data.m | 2,761 | utf_8 | 1285fbf46e56aef54512d2ce365df6bb |
function [igram]=add_shade2Data(Igram,ShadeFile,lopt)
%Prepare dem and save it in the igram structure
%
% Igram = igram structure
% ShadeFile = DEM (.jpg only)
%
% Noel Gourmelen October 2005
% Falk Amelung 15 November
% Now allows lopt
% putting shade int... |
github | yunjunz/GeodMod-master | maxmin.m | .m | GeodMod-master/PlotDatalib/maxmin.m | 157 | utf_8 | 255c63cbb96f3e23b89c3ab4a58267c6 | %Max value of array p1:
function [Maxf,minf]= maxmin (file);
maxp1=max(file); %by columns
Maxf=max(maxp1);
minp1=min(file); %by columns
minf=min(minp1); |
github | yunjunz/GeodMod-master | plot_NaNbackground.m | .m | GeodMod-master/PlotDatalib/plot_NaNbackground.m | 1,119 | utf_8 | 3ce3459b137e14f6433277799743666b |
function plot_NaNbackground(data,opt)
%
% Plot data containg NaNs. Only data will be used to scale the colorscale
%
% data : data!
%
% opt:
%
% cmap : Colormap
% background_color : Example -> [0] for white (default)
%
%
% Noel Gourmelen - March 2009
%
defaultopt=struct( ... |
github | yunjunz/GeodMod-master | beachball.m | .m | GeodMod-master/PlotDatalib/beachball.m | 8,414 | utf_8 | 5011d1c1ca3f37b8393c7c29f59146d2 | function handle = beachball(strike,dip,rake,x0,y0,radius,color,handle)
% Usage: handle = beachball(strike,dip,rake,x0,y0,radius,color,handle)
%
% Plot a lower-hemisphere focal mechanism centered at x0,y0
% with radius radius.
% handle is an optional argument. If specified, and if handle
% points to an existing be... |
github | yunjunz/GeodMod-master | anneal_parfortry.m | .m | GeodMod-master/inver/anneal_parfortry.m | 8,042 | utf_8 | 240767d298ea2ccd0c03678e3f12c089 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'FU... |
github | yunjunz/GeodMod-master | plot_gridsearch.m | .m | GeodMod-master/inver/plot_gridsearch.m | 5,771 | utf_8 | 787f96937f9a52c0ef2a0dbe61a8700a | function [momin,ppd1d,ppd2d]=plot_gridsearch(models,energy,bounds,gibbsopt,inverseopt,objfuncopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS plots 1-D and 2-D marginal probability distributions
%
% usage: [momin,ppd1d,ppd2d]=plot_gibbs(models,energy,bounds,gibbsopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS(MODELS,ENERGY,BOUNDS,OP... |
github | yunjunz/GeodMod-master | anneal.m | .m | GeodMod-master/inver/anneal.m | 8,321 | utf_8 | f2dc367f2eaa118977033f119180ff3a | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | yunjunz/GeodMod-master | pg.m | .m | GeodMod-master/inver/gibbslib/pg.m | 7,841 | utf_8 | ebb087b38be71a278c2ccf24e0389e17 | function [momin,ppd1d,ppd2d]=plot_gibbs(models,energy,bounds,gibbsopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS plots 1-D and 2-D marginal probability distributions
%
% usage: [momin,ppd1d,ppd2d]=plot_gibbs(models,energy,bounds,gibbsopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS(MODELS,ENERGY,BOUNDS,OPT) ca... |
github | yunjunz/GeodMod-master | plot_gibbs.m | .m | GeodMod-master/inver/gibbslib/plot_gibbs.m | 11,026 | utf_8 | c26d519bacd4187643d82afd78dcfdb0 | function [momin,ppd1d,ppd2d]=plot_gibbs(models,energy,bounds,gibbsopt,inverseopt,objfuncopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS plots 1-D and 2-D marginal probability distributions
%
% usage: [momin,ppd1d,ppd2d]=plot_gibbs(models,energy,bounds,gibbsopt,momin,ppd1d,ppd2d)
%
% PLOT_GIBBS(MODELS,ENERGY,BOUNDS,OPT) ... |
github | yunjunz/GeodMod-master | gibbs.m | .m | GeodMod-master/inver/gibbslib/gibbs.m | 8,861 | utf_8 | d6463ed66f8327e5b86a12b84bbff0f3 | function [mhat,models,energy]=gibbs(FUN,bounds,gibbsopt,varargin)
% gibbs sampling by Falk Amelung - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%... |
github | yunjunz/GeodMod-master | StackRandFalk.m | .m | GeodMod-master/preparelib/StackRandFalk.m | 11,933 | utf_8 | fa018626dfec942e3de73ce9ece9c6c5 | function [Stacks]=StackRandFalk(igram,varargin);
%StackRandFalk - random stacks (modified from Noel's Stacks)
%
% usage: [Stacks]=Stack(igram,'NbStck',10,'rating',9999,'repeatNb',1,'LowTmpThresh',0,'HighTmpThresh',9999,'CSpaceLim',[100 200 100 200])
% plot_igram(igram(2:3))
%
% Input: igr... |
github | yunjunz/GeodMod-master | intgrV.m | .m | GeodMod-master/legacy/magma_sources/penny/intgrV.m | 621 | utf_8 | a1d9e3cfc6c1878f0300aa46e09313cb | %function [V,Vs]=intgrV(fi,psi,h,Wt,t)
function [V]=intgrV(fi,h,Wt,t)
% V,Vs - volume of crack, volume of surface uplift
% fi,psi: basis functions
% t: interval of integration
%large=1e10;
V = sum(Wt.*fi.*t);
%Vs = sum(Wt.*fi.*(t-h*(h-t)./(h^2+t.^2)));
%V1 = sum(Wt.*(fi.*Q(0,t,0,41)));
%V2 = sum(Wt.*(fi.*Q(0,t,large,41... |
github | yunjunz/GeodMod-master | fpkernel.m | .m | GeodMod-master/legacy/magma_sources/penny/fpkernel.m | 1,020 | utf_8 | 34db1a95baafa67be73b2e36d10f0cc8 | function [K]=fpkernel(h,t,r,n)
% Kernels calculation
p=4*h^2;
K=[];
%[dumb,nr]=size(r);
%[dumb,nt]=size(t);
switch n
case 1 %KN
K=p*h*(KG(t-r,p)-KG(t+r,p));
case 2 %KN1
Dlt=1e-6;
a=t+r;
b=t-r;
y=a.^2;
z=b.^2;
g=2*p*h*(p^2+6*p*(t.^2+r.^2)+5*(a.*b).^2);
s=((p+z).*(p+y)).^2;
s=g./s;
trbl=-4*h/(p+t.^2)*ones(si... |
github | yunjunz/GeodMod-master | fred.m | .m | GeodMod-master/legacy/magma_sources/penny/fred.m | 1,218 | utf_8 | 3f8d821d21a1dc0a806aed26bd8921b8 | function [fi,psi,t,Wt]=fred(h,m,er)
% fi,psi: basis functions
% t: interval of integration
% m: size(t)
%er=1e-7;
lamda=2/pi;
RtWt;
NumLegendreTerms=length(Rt);
for k=1:m
for i=1:NumLegendreTerms
d1=1/m;
t1=d1*(k-1);
r1:=d1*k;
j=NumLegendreTerms*(k-1)+i;
t(j)=Rt(j)*(r1-t1)*0.5+(r1+t1)*0.5;
end
end
%[t,Wt]=S... |
github | yunjunz/GeodMod-master | displotmulti.m | .m | GeodMod-master/modellib/displotmulti.m | 3,949 | utf_8 | 6af5a892a3e40bff73154ec91af677b3 | function [] = displotmulti(param,objfunc,modelopt,x_unit)
% displotmulti - plots one or more dislocations using displot
% usage: [] = displotmulti(param);
%
% FA, last modified 30 Nov 2003
% Yunjun, 2015-12-05: add circle()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PlotType = '2D... |
github | yunjunz/GeodMod-master | imcapture.m | .m | GeodMod-master/mimiclib/imcapture.m | 17,050 | utf_8 | faaad167f7d796f7293ad1521120e17e | function img = imcapture( h, opt, dpi, opt2, opt3)
% IMCAPTURE do screen captures at controllable resolution using the undocumented "hardcopy" built-in function.
%
% USAGE:
% IMG = IMCAPTURE(H) gets a screen capture from object H, where H is a handle to a figure, axis or an image
% When H is an... |
github | yunjunz/GeodMod-master | unitsratio.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/unitsratio.m | 9,235 | utf_8 | 1bde505713b24cfa1596c75bc07817b2 | function ratio = unitsratio(to, from)
%UNITSRATIO Unit conversion factors
%
% RATIO = UNITSRATIO(TO, FROM) returns the number of TO units per one
% FROM unit. For example, UNITSRATIO('cm', 'm') returns 100 because
% there are 100 centimeters per meter. UNITSRATIO makes it easy to
% convert from one system of ... |
github | yunjunz/GeodMod-master | medfilt2.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/medfilt2.m | 4,311 | utf_8 | b0cb0d7f735abab6f17ff2e91c8ce90a | function b = medfilt2(varargin)
%MEDFILT2 2-D median filtering.
% B = MEDFILT2(A,[M N]) performs median filtering of the matrix
% A in two dimensions. Each output pixel contains the median
% value in the M-by-N neighborhood around the corresponding
% pixel in the input image. MEDFILT2 pads the image with zeros
... |
github | yunjunz/GeodMod-master | padarray.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/padarray.m | 7,400 | utf_8 | c6fe9a958653dbf82356a6efe4082591 | function b = padarray(varargin)
%PADARRAY Pad array.
% B = PADARRAY(A,PADSIZE) pads array A with PADSIZE(k) number of zeros
% along the k-th dimension of A. PADSIZE should be a vector of
% positive integers.
%
% B = PADARRAY(A,PADSIZE,PADVAL) pads array A with PADVAL (a scalar)
% instead of with zeros.
%
% ... |
github | yunjunz/GeodMod-master | demcmap.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/demcmap.m | 14,848 | utf_8 | 1f21d2f93a7494c5566dcdad13655b5d | function [cmap,clim] = demcmap(varargin)
%DEMCMAP Colormaps appropriate to terrain elevation data
%
% DEMCMAP(map) creates and assigns a colormap appropriate for elevation data.
% The colormap has the number of land and sea colors in proportion to
% the maximum elevations and depths in the matrix map. With no output... |
github | yunjunz/GeodMod-master | bwareaopen.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/bwareaopen.m | 2,780 | utf_8 | 8b54d8714f1fc9be142de230a2b8a24b | function bw2 = bwareaopen(varargin)
%BWAREAOPEN Morphologically open binary image (remove small objects).
% BW2 = BWAREAOPEN(BW,P) removes from a binary image all connected
% components (objects) that have fewer than P pixels, producing another
% binary image BW2. The default connectivity is 8 for two dimensions... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.