Skip to content

Commit b43dd3e

Browse files
youdongguoyoudongguo
andauthored
update docstring to readme (#9)
* update docstring to readme * Update Project.toml --------- Co-authored-by: youdongguo <[email protected]>
1 parent 853bf0e commit b43dd3e

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

README.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,31 @@ Here are the new components:
6464

6565
## Functions
6666

67-
W, H = **gsvdnmf**(X::AbstractMatrix, ncomponents::Pair{Int,Int}; tol_final=1e-4, tol_intermediate=1e-4, kwargs...)
67+
W, H = **gsvdnmf**(X::AbstractMatrix, ncomponents::Pair{Int,Int};
68+
tol_final=1e-4,
69+
tol_intermediate=1e-4,
70+
kwargs...)
6871

69-
This function performs "GSVD-NMF" on 2D data matrix ``X``.
72+
Perform "GSVD-NMF" on the data matrix `X`.
7073

7174
Arguments:
7275

73-
``X``: non-nagetive 2D data matrix
76+
- `X`: non-negative data matrix
7477

75-
``ncomponents::Pair{Int,Int}``: in the form of ``n1 => n2``, augments from ``n1`` components to ``n2``components, where ``n1`` is the number of components for initial NMF (under-complete NMF), and ``n2`` is the number of components for final NMF.
78+
- `ncomponents`: in the form of `n1 => n2`, augments from `n1` components to `n2`components,
79+
where `n1` is the number of components for initial NMF (under-complete NMF), and `n2` is the number of
80+
components for final NMF.
7681

77-
Alternatively, ``ncomponents`` can be an integer denoting the number of components for final NMF.
78-
In this case, ``gsvdnmf`` defaults to augment components on initial NMF solution by 1.
82+
Alternatively, `ncomponents` can be an integer denoting the number of components for final NMF.
83+
In this case, `gsvdnmf` defaults to augment components on initial NMF solution by 1.
7984

8085
Keyword arguments:
8186

82-
``tol_final`` The tolerence of final NMF, default:``10^{-4}``
87+
- `tol_final`: The tolerence of final NMF, default:`10^{-4}`
8388

84-
``tol_intermediate``: The tolerence of initial NMF (under-complete NMF), default: $\mathrm{tol\\_final}$
89+
- `tol_intermediate`: The tolerence of initial NMF (under-complete NMF), default: tol_final
8590

86-
Other keyword arguments are passed to ``NMF.nnmf``.
91+
Other keyword arguments are passed to `NMF.nnmf`.
8792

8893
-----
8994

@@ -92,51 +97,49 @@ W, H = **gsvdnmf**(X::AbstractMatrix, W::AbstractMatrix, H::AbstractMatrix, f;
9297
tol_nmf=1e-4,
9398
kwargs...)
9499

95-
This funtion augments components for ``W`` and ``H``, and subsequently polishs new ``W`` and ``H`` by NMF.
100+
Augment `W` and `H` to have `n2` components, subsequently polished by NMF.
96101

97102
Arguments:
98103

99-
``X``: non-nagetive 2D data matrix
100-
101-
``W``: initialization of initial NMF
104+
- `X`: non-negative data matrix
102105

103-
``H``: initialization of initial NMF
106+
- `W` and `H`: initial NMF factorization
104107

105-
``n2``: the number of components in augmented matrix
108+
- `n2`: the number of components in augmented factorization
106109

107-
``f``: SVD (or Truncated SVD) of ``X``, ``f`` needs to be explicitly writen in ``Tuple`` form.
110+
- `f`: SVD (or Truncated SVD) of `X`
108111

109-
Keyword arguments
112+
Keyword arguments:
110113

111-
``tol_nmf``: the tolerance of NMF polishing step, default: $10^{-4}$
114+
- `tol_nmf`: the tolerance of NMF polishing step, default: 1e-4
112115

113-
Other keyword arguments are passed to ``NMF.nnmf``.
116+
Other keyword arguments are passed to `NMF.nnmf`.
114117

115118
-----
116119

117120
Wadd, Hadd, S = **gsvdrecover**(X, W0, H0, kadd, f)
118121

119-
This funtion augments components for ``W`` and ``H`` without polishing NMF step.
122+
Augment components for `W` and `H` without polishing by NMF.
120123

121124
Outputs:
122125

123-
``Wadd``: augmented NMF solution
126+
`Wadd`: augmented NMF solution
124127

125-
``Hadd``: augmented NMF solution
128+
`Hadd`: augmented NMF solution
126129

127-
``S``: related generalized singular value
130+
`S`: generalized singular values for the `kadd` augmented components
128131

129132
Arguments:
130133

131-
``X``: non-nagetive 2D data matrix
134+
`X`: non-nagetive 2D data matrix
132135

133-
``W0``: NMF solution
136+
`W0`: NMF solution
134137

135-
``H0``: NMF solution
138+
`H0`: NMF solution
136139

137-
``kadd``: number of new components
140+
`kadd`: number of new components
138141

139-
``f``: SVD (or Truncated SVD) of ``X``, ``f`` needs to be indexable.
142+
`f`: SVD (or Truncated SVD) of `X`
140143

141144
-----
142145

0 commit comments

Comments
 (0)