File f_models.py changed (mode: 100644) (index dc3be53..a3b1857) |
... |
... |
class SNorm: |
128 |
128 |
pdfs_R = stats.norm.pdf(sample_R) |
pdfs_R = stats.norm.pdf(sample_R) |
129 |
129 |
pdf_R = np.prod(pdfs_R, axis=1).reshape(-1, 1) |
pdf_R = np.prod(pdfs_R, axis=1).reshape(-1, 1) |
130 |
130 |
f_copy._data = np.hstack((sample_R, sample_P, pdf_R)) |
f_copy._data = np.hstack((sample_R, sample_P, pdf_R)) |
|
131 |
|
else: |
|
132 |
|
f_copy._data = np.empty((0, f_copy._data.shape[1]), dtype=float) |
131 |
133 |
return f_copy |
return f_copy |
132 |
134 |
|
|
133 |
135 |
def __len__(f): |
def __len__(f): |
|
... |
... |
class SNorm: |
228 |
230 |
|
|
229 |
231 |
# drobná pomucka |
# drobná pomucka |
230 |
232 |
def new_sample(f, sample=None, space='R'): |
def new_sample(f, sample=None, space='R'): |
231 |
|
f_copy = copy.copy(f) |
|
|
233 |
|
f_copy = f() |
232 |
234 |
if sample is not None: |
if sample is not None: |
233 |
235 |
f_copy.add_sample(sample, space) |
f_copy.add_sample(sample, space) |
234 |
236 |
return f_copy |
return f_copy |
File whitebox.py changed (mode: 100644) (index c9f8f89..f62c675) |
... |
... |
class HyperPlane(WhiteBox): # куда ж без него... |
256 |
256 |
self.gm = g_models.Linear_nD(betas) |
self.gm = g_models.Linear_nD(betas) |
257 |
257 |
self.f = f_models.SNorm(len(betas)-1) |
self.f = f_models.SNorm(len(betas)-1) |
258 |
258 |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
259 |
|
self.sample_box = SampleBox(self.f, gm_signature=self.gm_signature) |
|
|
259 |
|
self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature) |
260 |
260 |
|
|
261 |
261 |
# tady už je to ta, "náše" beta ) |
# tady už je to ta, "náše" beta ) |
262 |
262 |
# beta = c/np.sqrt(a**2 + b**2) |
# beta = c/np.sqrt(a**2 + b**2) |
|
... |
... |
class Weibull_Z_min(WhiteBox): |
310 |
310 |
|
|
311 |
311 |
self.gm = g_models.Z_min(self.const) |
self.gm = g_models.Z_min(self.const) |
312 |
312 |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
313 |
|
self.sample_box = SampleBox(self.f, gm_signature=self.gm_signature) |
|
|
313 |
|
self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature) |
314 |
314 |
|
|
315 |
315 |
def __str__(self): |
def __str__(self): |
316 |
316 |
return 'Weibull_Z_min%sD'%(len(self.wb_scales)) |
return 'Weibull_Z_min%sD'%(len(self.wb_scales)) |
|
... |
... |
class Gaussian_Z_sumexp(WhiteBox): |
359 |
359 |
self.const = self.C |
self.const = self.C |
360 |
360 |
self.gm = g_models.Z_sumexp(self.const) |
self.gm = g_models.Z_sumexp(self.const) |
361 |
361 |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
362 |
|
self.sample_box = SampleBox(self.f, gm_signature=self.gm_signature) |
|
|
362 |
|
self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature) |
363 |
363 |
|
|
364 |
364 |
def __str__(self): |
def __str__(self): |
365 |
365 |
return 'Gaussian_Z_sumexp%sD'%(self.nvar) |
return 'Gaussian_Z_sumexp%sD'%(self.nvar) |
|
... |
... |
class SNorm_Z_sumsq(WhiteBox): |
404 |
404 |
self.const = self.C |
self.const = self.C |
405 |
405 |
self.gm = g_models.Z_sumsq(self.C) |
self.gm = g_models.Z_sumsq(self.C) |
406 |
406 |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
407 |
|
self.sample_box = SampleBox(self.f, gm_signature=self.gm_signature) |
|
|
407 |
|
self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature) |
408 |
408 |
|
|
409 |
409 |
def __str__(self): |
def __str__(self): |
410 |
410 |
return 'SNorm_Z_sumsq%sD'%(self.nvar) |
return 'SNorm_Z_sumsq%sD'%(self.nvar) |
|
... |
... |
class SNorm_S_ball(WhiteBox): |
461 |
461 |
self.r = r |
self.r = r |
462 |
462 |
self.gm = g_models.S_ball(r) |
self.gm = g_models.S_ball(r) |
463 |
463 |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
# na začatku nemáme vzorky - pouze rozdělení a podpís |
464 |
|
self.sample_box = SampleBox(self.f, gm_signature=self.gm_signature) |
|
|
464 |
|
self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature) |
465 |
465 |
|
|
466 |
466 |
def __str__(self): |
def __str__(self): |
467 |
467 |
return 'SNorm_S_ball%sD'%(self.nvar) |
return 'SNorm_S_ball%sD'%(self.nvar) |