机器学习和生物信息学实验室联盟

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2056|回复: 0
打印 上一主题 下一主题

如何整理自己工作的代码

[复制链接]
跳转到指定楼层
楼主
发表于 2016-11-22 14:05:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
学术研究最基本的要求是工作的可重复性,因此我们会将自己的数据和代码整理好挂到个人主页,以供大家对比和使用,现把注意事项列举如下:
1 readme文件  主要展示copyright信息 文章信息以及代码介绍等;
2 demo文件    通过demo文件可运行整个代码  使得使用者清晰明了的使用代码;
3 每个m文件需要进行代码注释, 在function下面解释函数的主要作用  input以及output的含义,同时解释参数如何设置。

下面给出一个简单的例子:
1 readme
% ========================================================================
% Coupled Dictionary Learning, Version 1.0
% Copyright(c) 2016 P. Zhu etl.
% All Rights Reserved.
%
% ----------------------------------------------------------------------
% Permission to use, copy, or modify this software and its documentation
% for educational and research purposes only and without fee is here
% granted, provided that this copyright notice and the original authors'
% names appear on all copies and supporting documentation. This program
% shall not be used, rewritten, or adapted as the basis of a commercial
% software or hardware product without first obtaining permission of the
% authors. The authors make no representations about the suitability of
% this software for any purpose. It is provided "as is" without express
% or implied warranty.
% ----------------------------------------------------------------------  
%
% Please refer to the following paper
Zhu P, Hu Q, Zhang C, et al. Coupled Dictionary Learning for Unsupervised
Feature Selection[C]//Thirtieth AAAI Conference on Artificial Intelligence. 2016.
%
% bibtex
@inproceedings{zhu2016coupled,
  title={Coupled Dictionary Learning for Unsupervised Feature Selection},
  author={Zhu, Pengfei and Hu, Qinghua and Zhang, Changqing and Zuo, Wangmeng},
  booktitle={Thirtieth AAAI Conference on Artificial Intelligence},
  year={2016}
}
%   
%
%
% Contact: {zhupengfei}@tju.edu.cn
% ----------------------------------------------------------------------

3 m文件
function  [V,U]=CDLFS(X,mu,tau,DictSize,p)

%%
% The function is to sove the following optimization problem
% min_{U,V} ||X-UV'X||_F^2+tau*||V||_{2,p}
% Input:
%X  feature matrix  d*n  d is feature dimension  n is sample number
%mu parameter  default value 1
%tau parameter
%DictSize  dictionary size default value 10
%p   L2p-norm regularization  default value {0.4,0.6,0.8,1.0}

% Output:
%V analysis dictionary    d*k
%U synthetic dictionary   d*k


% reference:
% [1]Zhu P, Hu Q, Zhang C, et al. Coupled Dictionary Learning for Unsupervised Feature Selection[C]//Thirtieth AAAI Conference on Artificial Intelligence. 2016.

%%
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 转播转播 分享分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

机器学习和生物信息学实验室联盟  

GMT+8, 2024-4-29 16:58 , Processed in 0.067929 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表