seqbuild 0.0.73__tar.gz → 0.0.74__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {seqbuild-0.0.73/seqbuild.egg-info → seqbuild-0.0.74}/PKG-INFO +1 -1
- {seqbuild-0.0.73 → seqbuild-0.0.74}/pyproject.toml +1 -1
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/approximators.py +3 -1
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/cy_metric.py +4 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/differentials.py +4 -1
- seqbuild-0.0.74/seqbuild/face/chained_prng_cmp.py +100 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/easy_gen_struct.py +36 -9
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/prng_bool_cmp.py +3 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/prng_stats.py +116 -7
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/n2m_index.py +5 -2
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/afs_gen.py +18 -2
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/cs_gen.py +8 -2
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/gg_gen.py +3 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/mdr_gen.py +0 -2
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/rch_gen.py +21 -8
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/udls_gen.py +14 -4
- {seqbuild-0.0.73 → seqbuild-0.0.74/seqbuild.egg-info}/PKG-INFO +1 -1
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild.egg-info/SOURCES.txt +1 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/setup.py +1 -1
- {seqbuild-0.0.73 → seqbuild-0.0.74}/LICENSE.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/README.md +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/fraction.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/multi_metric.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/not_equals.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/nvec_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/prng_dec_delta.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/desi/seqcov_perm.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/cl_guide_parser.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/cmd_proc.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/comm_lang.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/make_cmd.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commlang_guide.md +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_11.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_12error.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_13.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_14.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_15.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_16.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_17.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_18.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_19.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_20.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_21.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_22.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_23.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_24.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_25.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_26.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_27.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_28.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_29.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_30.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_31.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_32.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_33.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_34.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_41.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_42.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_afs.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_cshft.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_eight.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_fit22.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_five.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_four.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_gg.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_lcg_cmp.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_lcg_cmp2.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_lps.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_n2m.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_nine.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_one.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_pm.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_seven.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_six.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_ten.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_three.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commond_udls.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/commondeth.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/dummy_obj.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/example_command.md +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_base_screen.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_help_cmd.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_help_make.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_help_screen.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_load_c9.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_realtime_command.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_show_numbers.png +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/tmp_file_that_no_one_should_use__HIOTRNGINRE.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sb_ui.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/extraneous.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/idectree.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/idt_proc.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/intfactor.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/lcg_v2.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/lcg_v3.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/mdr_v2.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/mod_prng.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/modulo_ops.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/n2mvf_autogen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/pof_autogen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/poly_output_fitter_.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/prng_pw_op.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/process_seq.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/seq_struct.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/intigers/tvec.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/affine_fit_search.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/affine_io_fit.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/affine_ops.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/ag_ext.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/csrch.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/iseq.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/matfactor_eval.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/minmax_freq.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/n2m.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/n2m_function.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/ngram.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/ngram_ext.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/nsfr.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/puc.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/mini_dm/sp_op.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/__init__.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/fit22_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/idt_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/lps_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/n2mv_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/optri_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/pmulti_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/sb_crypt.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/shadow_gen.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/ssi_load.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/seqgen/ssi_netop.py +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild.egg-info/dependency_links.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild.egg-info/requires.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild.egg-info/top_level.txt +0 -0
- {seqbuild-0.0.73 → seqbuild-0.0.74}/setup.cfg +0 -0
|
@@ -186,8 +186,10 @@ class LPSValueOutputter(GenericIntSeqOp):
|
|
|
186
186
|
return
|
|
187
187
|
|
|
188
188
|
def update_points(self):
|
|
189
|
+
# NOTE: add ranged moduli over PRNG to ensure timely Lagrange Polynomial solve.
|
|
190
|
+
q = wrap_ranged_modulo_over_generator(self.px,[-100-2/3,100+1/3])
|
|
191
|
+
self.q = LPSValueOutputter.new_pointset(q,self.l_out)
|
|
189
192
|
|
|
190
|
-
self.q = LPSValueOutputter.new_pointset(self.px,self.l_out)
|
|
191
193
|
|
|
192
194
|
# assumes q is a proper set of points for
|
|
193
195
|
# fitting via <LagrangePolySolver>
|
|
@@ -76,10 +76,13 @@ class CycleMetric:
|
|
|
76
76
|
|
|
77
77
|
prefixes = set(self.M_.M.keys())
|
|
78
78
|
S = dict()
|
|
79
|
+
print("num prefixes: ",len(prefixes))
|
|
79
80
|
for p in prefixes:
|
|
81
|
+
print("processing: ",p)
|
|
80
82
|
P,d0,v0 = self.process_prefix(p)
|
|
81
83
|
self.prefix2mcs_map[p] = P
|
|
82
84
|
self.prefix2score_map[p] = (d0,v0)
|
|
85
|
+
print("")
|
|
83
86
|
return
|
|
84
87
|
|
|
85
88
|
"""
|
|
@@ -149,6 +152,7 @@ class CycleMetric:
|
|
|
149
152
|
|
|
150
153
|
prefix_info = self.M_.key_to_seq_by_type(prefix,measure_type)
|
|
151
154
|
##print("PREFIX: ",prefix_info)
|
|
155
|
+
## print("MCS LEN: ",len(prefix_info))
|
|
152
156
|
ms = MCSSearch(prefix_info,self.cast_func)
|
|
153
157
|
ms.search()
|
|
154
158
|
|
|
@@ -75,7 +75,10 @@ class PIDValueOutputter(GenericIntSeqOp):
|
|
|
75
75
|
stat = (self.adder_i % self.fvec_frequency) == 0
|
|
76
76
|
|
|
77
77
|
if stat:
|
|
78
|
-
|
|
78
|
+
try:
|
|
79
|
+
self.pic.modulate_dcurve_of_point(x)
|
|
80
|
+
except:
|
|
81
|
+
print("...strange...")
|
|
79
82
|
|
|
80
83
|
q = self.pic.differential_at(x,lps_first=True)
|
|
81
84
|
self.adder_i += 1
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from .prng_stats import *
|
|
2
|
+
from .make_cmd import MAIN_method_for_object
|
|
3
|
+
|
|
4
|
+
class ChainedPRNGComparator:
|
|
5
|
+
|
|
6
|
+
def __init__(self,prng_struct_seq,prg_varname,ngram_info,partition_size,\
|
|
7
|
+
output_prg_range=None,do_embed_generators:bool=True):
|
|
8
|
+
|
|
9
|
+
if type(output_prg_range) != type(None):
|
|
10
|
+
assert is_valid_range(output_prg_range,True,False) or is_valid_range(output_prg_range,False,False)
|
|
11
|
+
assert len(prng_struct_seq) > 1
|
|
12
|
+
assert type(do_embed_generators) == bool
|
|
13
|
+
|
|
14
|
+
self.prng_struct_seq = prng_struct_seq
|
|
15
|
+
self.prg_varname = prg_varname
|
|
16
|
+
self.ngram_info = ngram_info
|
|
17
|
+
self.psize = partition_size
|
|
18
|
+
self.output_prg_range = output_prg_range
|
|
19
|
+
self.do_embed = do_embed_generators
|
|
20
|
+
|
|
21
|
+
self.pstat_seq = None
|
|
22
|
+
self.preproc()
|
|
23
|
+
self.processed = False
|
|
24
|
+
return
|
|
25
|
+
|
|
26
|
+
def preproc(self):
|
|
27
|
+
|
|
28
|
+
# set every prng struct's parameter `prg_varname` to the previous prng.
|
|
29
|
+
if self.do_embed:
|
|
30
|
+
for i in range(1,len(self.prng_struct_seq)):
|
|
31
|
+
q0 = deepcopy(self.prng_struct_seq[i-1])
|
|
32
|
+
prg = MAIN_method_for_object(q0)
|
|
33
|
+
setattr(self.prng_struct_seq[i],self.prg_varname,prg)
|
|
34
|
+
|
|
35
|
+
prgs = [MAIN_method_for_object(p) for p in self.prng_struct_seq]
|
|
36
|
+
|
|
37
|
+
# apply modulii range if not None
|
|
38
|
+
if type(self.output_prg_range) != type(None):
|
|
39
|
+
prgs = [wrap_ranged_modulo_over_generator(p,self.output_prg_range) for p in \
|
|
40
|
+
prgs]
|
|
41
|
+
|
|
42
|
+
# initialize PRNGStats for every generator
|
|
43
|
+
self.pstat_seq = [PRNGStats(p,self.ngram_info,self.psize) for p in prgs]
|
|
44
|
+
|
|
45
|
+
def run(self):
|
|
46
|
+
for (i,x) in enumerate(self.pstat_seq):
|
|
47
|
+
print("* running input prng #{}".format(i))
|
|
48
|
+
x.run()
|
|
49
|
+
self.processed = True
|
|
50
|
+
|
|
51
|
+
# NOTE: duplicate code with <PRNGIOStats.cmp_matrix>.
|
|
52
|
+
def cmp_matrix(self,metric_numbers:set = {1,2,3,4,5,6,7}):
|
|
53
|
+
if not self.processed:
|
|
54
|
+
print("[!] comparator has not processed all PRNGs")
|
|
55
|
+
return
|
|
56
|
+
|
|
57
|
+
M = np.zeros((len(self.prng_struct_seq),len(self.prng_struct_seq))) + np.nan
|
|
58
|
+
|
|
59
|
+
for i in range(len(self.pstat_seq) - 1):
|
|
60
|
+
for j in range(i+1,len(self.pstat_seq)):
|
|
61
|
+
b = self.boolcmp_stats(j,i,metric_numbers)
|
|
62
|
+
M[i,j] = b
|
|
63
|
+
return M
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# NOTE: duplicate code of method<PRNGIOStats.boolcmp_stats>
|
|
67
|
+
"""
|
|
68
|
+
return:
|
|
69
|
+
1(more random)|-1(less random)|0(equally random)
|
|
70
|
+
"""
|
|
71
|
+
def boolcmp_stats(self,i0,i1,metric_numbers:set):
|
|
72
|
+
|
|
73
|
+
G0,G1 = self.pstat_seq[i0],self.pstat_seq[i1]
|
|
74
|
+
|
|
75
|
+
q0,c0 = G0.latest_results()
|
|
76
|
+
q1,c1 = G1.latest_results()
|
|
77
|
+
|
|
78
|
+
return is_PRNG_more_QC_random((q0,c0),(q1,c1),metric_numbers)
|
|
79
|
+
|
|
80
|
+
"""
|
|
81
|
+
uses a unique copy of `prg` to generate every struct in `struct_name_list`
|
|
82
|
+
(no embedded generators). Then uses a <ChainedPRNGComparator> to produce a
|
|
83
|
+
cumulative comparison matrix over `num_iter` segments.
|
|
84
|
+
"""
|
|
85
|
+
def prg_to_chained_PRNG_cmp_matrix(prg,struct_name_list,ngram_info=[8],partition_size=5,\
|
|
86
|
+
output_prg_range=[-50000,50000],num_iter=1,include_source_prg_in_cmp:bool=False):
|
|
87
|
+
|
|
88
|
+
a = int(include_source_prg_in_cmp)
|
|
89
|
+
M = np.zeros((len(struct_name_list) + a,len(struct_name_list) + a))
|
|
90
|
+
S = [one_P_random_struct(l,deepcopy(prg)) for l in struct_name_list]
|
|
91
|
+
if include_source_prg_in_cmp: S.insert(0,prg)
|
|
92
|
+
|
|
93
|
+
X = ChainedPRNGComparator(S,"prg",ngram_info,partition_size,output_prg_range,do_embed_generators = False)
|
|
94
|
+
|
|
95
|
+
for _ in range(num_iter):
|
|
96
|
+
X.run()
|
|
97
|
+
q = X.cmp_matrix()
|
|
98
|
+
print("{}: {}".format(_,q))
|
|
99
|
+
M = M + q
|
|
100
|
+
return M
|
|
@@ -1102,22 +1102,31 @@ class TimeBasedCommLangFileGenerator:
|
|
|
1102
1102
|
DEFAULT_TBCLF_TMP_FILE_PATH = os.path.join(BASE_COMM_LANG_FOLDER,"tmp_file_that_no_one_should_use__HIOTRNGINRE.txt")
|
|
1103
1103
|
|
|
1104
1104
|
def one_T_random_struct(struct_name,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
1105
|
+
return one_X_random_struct(struct_name,None,tmp_filepath)
|
|
1106
|
+
|
|
1107
|
+
"""
|
|
1108
|
+
outputs a PRNG generated by PRNG `prg`
|
|
1109
|
+
"""
|
|
1110
|
+
def one_P_random_struct(struct_name,prg,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
1111
|
+
return one_X_random_struct(struct_name,prg,tmp_filepath)
|
|
1112
|
+
|
|
1113
|
+
def one_X_random_struct(struct_name,prg,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
1105
1114
|
|
|
1106
1115
|
q = None
|
|
1107
1116
|
|
|
1108
1117
|
while not q:
|
|
1109
|
-
q =
|
|
1118
|
+
q = one_X_random_struct_(struct_name,prg,tmp_filepath)
|
|
1110
1119
|
return q
|
|
1111
1120
|
|
|
1112
1121
|
"""
|
|
1113
1122
|
outputs a time-based pseudo-random generated PRNG Python object
|
|
1114
1123
|
"""
|
|
1115
|
-
def
|
|
1116
|
-
|
|
1124
|
+
def one_X_random_struct(struct_name,prg,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
1117
1125
|
assert struct_name in DEFAULT_TBCLF_STRUCT_NAMES
|
|
1126
|
+
is_gen_time = type(prg) == type(None)
|
|
1118
1127
|
|
|
1119
1128
|
base_gen_name = "rxx"
|
|
1120
|
-
use_prng_for_prng_pr = 0.5
|
|
1129
|
+
use_prng_for_prng_pr = 0.5 if is_gen_time == "t" else 0.
|
|
1121
1130
|
vector_files = []
|
|
1122
1131
|
comm_lang_files = []
|
|
1123
1132
|
consistent_prng_output = False
|
|
@@ -1125,10 +1134,14 @@ def one_T_random_struct_(struct_name,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
|
1125
1134
|
|
|
1126
1135
|
tbclf = TimeBasedCommLangFileGenerator(tmp_filepath,base_gen_name,use_prng_for_prng_pr,\
|
|
1127
1136
|
vector_files,comm_lang_files,consistent_prng_output,verbose)
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1137
|
+
|
|
1138
|
+
if is_gen_time == "t":
|
|
1139
|
+
for _ in range(3):
|
|
1140
|
+
S,g = tbclf.generate_CL_LCG_bunch()
|
|
1141
|
+
tbclf.update_CL_file(S)
|
|
1142
|
+
else:
|
|
1143
|
+
assert type(prg) in {MethodType,FunctionType}
|
|
1144
|
+
tbclf.pdd = prg
|
|
1132
1145
|
|
|
1133
1146
|
S,g = tbclf.generate_one_struct_(struct_name)
|
|
1134
1147
|
tbclf.update_CL_file(S)
|
|
@@ -1137,4 +1150,18 @@ def one_T_random_struct_(struct_name,tmp_filepath=DEFAULT_TBCLF_TMP_FILE_PATH):
|
|
|
1137
1150
|
q = tbclf.clp.vartable[g]
|
|
1138
1151
|
tbclf.close()
|
|
1139
1152
|
|
|
1140
|
-
return q
|
|
1153
|
+
return q
|
|
1154
|
+
|
|
1155
|
+
#-------------------------------------------------------
|
|
1156
|
+
|
|
1157
|
+
def chain_generate_P_random_structs(starting_prg,struct_name_list):
|
|
1158
|
+
prngs = []
|
|
1159
|
+
q = deepcopy(starting_prg)
|
|
1160
|
+
|
|
1161
|
+
for x in struct_name_list:
|
|
1162
|
+
q2 = one_P_random_struct(x,q)
|
|
1163
|
+
q = deepcopy(MAIN_method_for_object(q2))
|
|
1164
|
+
|
|
1165
|
+
prngs.append(q2)
|
|
1166
|
+
|
|
1167
|
+
return prngs
|
|
@@ -5,7 +5,6 @@ from .prng_bool_cmp import *
|
|
|
5
5
|
|
|
6
6
|
DEFAULT_QUALTEST_SEGMENT_LENGTH = 200
|
|
7
7
|
DEFAULT_CHAINTEST_SEGMENT_LENGTH = 1000
|
|
8
|
-
DEFAULT_CHAINTEST_RADIUS = 0.5
|
|
9
8
|
|
|
10
9
|
"""
|
|
11
10
|
Method<run> conducts QUALTEST and CHAINTEST for their respective
|
|
@@ -45,9 +44,9 @@ class PRNGStats:
|
|
|
45
44
|
return
|
|
46
45
|
|
|
47
46
|
def run(self):
|
|
48
|
-
|
|
49
47
|
self.qtest()
|
|
50
48
|
self.ctest()
|
|
49
|
+
print("============================================================")
|
|
51
50
|
return
|
|
52
51
|
|
|
53
52
|
def latest_results(self):
|
|
@@ -102,10 +101,13 @@ class PRNGStats:
|
|
|
102
101
|
Q2 = self.cqueue
|
|
103
102
|
s = DEFAULT_QUALTEST_SEGMENT_LENGTH
|
|
104
103
|
|
|
104
|
+
print("populating {}->{}".format(len(Q),s))
|
|
105
|
+
|
|
105
106
|
while len(Q) < s:
|
|
106
107
|
x = self.prg()
|
|
107
108
|
Q.append(x)
|
|
108
109
|
Q2.append(x)
|
|
110
|
+
print("done populating")
|
|
109
111
|
|
|
110
112
|
'''
|
|
111
113
|
A comparator class for input PRNGs, of `input_prg_list`, when they are each used as a
|
|
@@ -129,7 +131,7 @@ boolean metrics from file<face.prng_bool_cmp> to use), these comparisons output
|
|
|
129
131
|
class PRNGIOStats:
|
|
130
132
|
|
|
131
133
|
def __init__(self,input_prg_list,input_prg_varname,output_prg_struct,ngram_info,\
|
|
132
|
-
partition_size,absdiff:bool=True,output_prg_range=None):
|
|
134
|
+
partition_size,absdiff:bool=True,output_prg_range=None,collect_variance_over_runs:bool=False):
|
|
133
135
|
|
|
134
136
|
assert len(input_prg_list) > 0
|
|
135
137
|
|
|
@@ -141,9 +143,12 @@ class PRNGIOStats:
|
|
|
141
143
|
assert is_valid_range(output_prg_range,True,False) or \
|
|
142
144
|
is_valid_range(output_prg_range,False,False)
|
|
143
145
|
|
|
146
|
+
assert type(collect_variance_over_runs) == bool
|
|
147
|
+
|
|
144
148
|
self.input_prg_list = input_prg_list
|
|
145
149
|
self.input_prg_varname = input_prg_varname
|
|
146
150
|
self.output_prg_struct = output_prg_struct
|
|
151
|
+
self.cvar_over_runs = collect_variance_over_runs
|
|
147
152
|
self.ngram_info = ngram_info
|
|
148
153
|
self.psize = partition_size
|
|
149
154
|
self.absdiff = absdiff
|
|
@@ -151,11 +156,16 @@ class PRNGIOStats:
|
|
|
151
156
|
self.input_prng_stats = []
|
|
152
157
|
self.output_prng_stats = []
|
|
153
158
|
self.output_prg_range = output_prg_range
|
|
159
|
+
|
|
160
|
+
# index -> score term -> list of values over runs
|
|
161
|
+
self.input_prng_summary = defaultdict(None)
|
|
162
|
+
self.output_prng_summary = defaultdict(None)
|
|
154
163
|
self.preproc()
|
|
164
|
+
|
|
155
165
|
return
|
|
156
166
|
|
|
157
167
|
def preproc(self):
|
|
158
|
-
for x in self.input_prg_list:
|
|
168
|
+
for (i,x) in enumerate(self.input_prg_list):
|
|
159
169
|
|
|
160
170
|
G = deepcopy(self.output_prg_struct)
|
|
161
171
|
setattr(G,self.input_prg_varname,deepcopy(x))
|
|
@@ -170,16 +180,91 @@ class PRNGIOStats:
|
|
|
170
180
|
self.input_prng_stats.append(G0)
|
|
171
181
|
|
|
172
182
|
G1 = PRNGStats(Q,deepcopy(self.ngram_info),self.psize)
|
|
173
|
-
self.output_prng_stats.append(G1)
|
|
183
|
+
self.output_prng_stats.append(G1)
|
|
184
|
+
|
|
185
|
+
self.input_prng_summary[i] = defaultdict(list)
|
|
186
|
+
self.output_prng_summary[i] = defaultdict(list)
|
|
187
|
+
|
|
188
|
+
def update_summary(self,index,is_input_prg:bool):
|
|
189
|
+
assert type(is_input_prg) == bool
|
|
190
|
+
assert 0 <= index < len(self.input_prg_list)
|
|
191
|
+
|
|
192
|
+
x = self.input_prng_stats[index] if is_input_prg else \
|
|
193
|
+
self.output_prng_stats[index]
|
|
194
|
+
|
|
195
|
+
q0,q1 = x.latest_results()
|
|
196
|
+
qc = QCInfo((q0,q1))
|
|
197
|
+
|
|
198
|
+
D = qc.retrieve_all()
|
|
199
|
+
|
|
200
|
+
D2 = self.input_prng_summary[index] if is_input_prg else \
|
|
201
|
+
self.output_prng_summary[index]
|
|
202
|
+
|
|
203
|
+
for k,v in D.items():
|
|
204
|
+
D2[k].append(v)
|
|
174
205
|
|
|
175
206
|
def run(self):
|
|
176
207
|
for (i,x) in enumerate(self.input_prng_stats):
|
|
177
208
|
print("* running input prng #{}".format(i))
|
|
178
209
|
x.run()
|
|
210
|
+
|
|
211
|
+
if self.cvar_over_runs: self.update_summary(i,True)
|
|
179
212
|
|
|
180
213
|
for (i,y) in enumerate(self.output_prng_stats):
|
|
181
214
|
print("* running output prng #{}".format(i))
|
|
182
|
-
y.run()
|
|
215
|
+
y.run()
|
|
216
|
+
|
|
217
|
+
if self.cvar_over_runs: self.update_summary(i,False)
|
|
218
|
+
|
|
219
|
+
"""
|
|
220
|
+
Compares the intra-variance between two PRNGs.
|
|
221
|
+
|
|
222
|
+
index_type_pair0 := (PRNG index, ?is input PRNG?)
|
|
223
|
+
index_type_pair1 := (PRNG index, ?is input PRNG?)
|
|
224
|
+
"""
|
|
225
|
+
def cmp_var_over_runs(self,index_type_pair0,index_type_pair1):
|
|
226
|
+
assert len(index_type_pair0) == len(index_type_pair1) == 2
|
|
227
|
+
|
|
228
|
+
G0 = self.input_prng_summary[index_type_pair0[0]] if \
|
|
229
|
+
index_type_pair0[1] else self.output_prng_summary[index_type_pair0[0]]
|
|
230
|
+
G1 = self.input_prng_summary[index_type_pair1[0]] if \
|
|
231
|
+
index_type_pair1[1] else self.output_prng_summary[index_type_pair1[0]]
|
|
232
|
+
|
|
233
|
+
var0 = {k:np.var(v) for k,v in G0.items()}
|
|
234
|
+
var1 = {k:np.var(v) for k,v in G1.items()}
|
|
235
|
+
|
|
236
|
+
D = dict()
|
|
237
|
+
|
|
238
|
+
for k,v in var0.items():
|
|
239
|
+
r = to_trinary_relation(v,var1[k])
|
|
240
|
+
D[k] = r
|
|
241
|
+
|
|
242
|
+
print("** variance comparison")
|
|
243
|
+
Q = sorted(SCORE_TERMS)
|
|
244
|
+
for q in Q:
|
|
245
|
+
print("{} -> {}".format(q,D[q]))
|
|
246
|
+
|
|
247
|
+
return to_trinary_relation_v2(sum(list(D.values())),None,True,False)
|
|
248
|
+
|
|
249
|
+
# TODO: test
|
|
250
|
+
def cmp_matrix(self,cmp_type:str,metric_numbers:set=None):
|
|
251
|
+
assert cmp_type in {"i","o","io"}
|
|
252
|
+
|
|
253
|
+
l = len(self.input_prg_list)
|
|
254
|
+
M = np.zeros((l,l)) + np.nan
|
|
255
|
+
|
|
256
|
+
if cmp_type == "i":
|
|
257
|
+
F = self.input_cmp
|
|
258
|
+
elif cmp_type == "o":
|
|
259
|
+
F = self.output_cmp
|
|
260
|
+
else:
|
|
261
|
+
F = self.pairwise_io_cmp
|
|
262
|
+
|
|
263
|
+
for i in range(l - 1):
|
|
264
|
+
for j in range(i+1,l):
|
|
265
|
+
c = F(j,i,metric_numbers)
|
|
266
|
+
M[i,j] = c
|
|
267
|
+
return M
|
|
183
268
|
|
|
184
269
|
"""
|
|
185
270
|
input PRNG#0 - input PRNG#1
|
|
@@ -280,4 +365,28 @@ class PRNGIOStats:
|
|
|
280
365
|
q0,c0 = G0.latest_results()
|
|
281
366
|
q1,c1 = G1.latest_results()
|
|
282
367
|
|
|
283
|
-
return is_PRNG_more_QC_random((q0,c0),(q1,c1),metric_numbers)
|
|
368
|
+
return is_PRNG_more_QC_random((q0,c0),(q1,c1),metric_numbers)
|
|
369
|
+
|
|
370
|
+
def rank_prng_cmp_matrix(M,verbose=True):
|
|
371
|
+
assert len(M.shape) == 2
|
|
372
|
+
assert M.shape[0] == M.shape[1]
|
|
373
|
+
|
|
374
|
+
M_ = deepcopy(M)
|
|
375
|
+
M_[np.isnan(M_)] = 0.
|
|
376
|
+
|
|
377
|
+
D = []
|
|
378
|
+
|
|
379
|
+
for i in range(M_.shape[0]):
|
|
380
|
+
s0 = np.sum(M_[:,i])
|
|
381
|
+
s1 = np.sum(M_[i,:])
|
|
382
|
+
D.append((i,s0 - s1))
|
|
383
|
+
|
|
384
|
+
D = sorted(D,key=lambda x:x[1],reverse = True)
|
|
385
|
+
I = [d[0] for d in D]
|
|
386
|
+
|
|
387
|
+
for i in range(M_.shape[0]):
|
|
388
|
+
x = I.index(i)
|
|
389
|
+
y = D[x][1]
|
|
390
|
+
if verbose: print("index {} -> {} -> {}".format(i,x,y))
|
|
391
|
+
|
|
392
|
+
return D
|
|
@@ -191,15 +191,18 @@ class N2MIndexMapGen:
|
|
|
191
191
|
|
|
192
192
|
msize = int(modulo_in_range(self.prg(),self.ms_range))
|
|
193
193
|
msize = min([msize,len(ai)])
|
|
194
|
+
|
|
195
|
+
prg_ = prg__single_to_int(self.prg)
|
|
194
196
|
mset_index = prg_choose_n([i for i in range(len(ai))],\
|
|
195
|
-
msize,
|
|
197
|
+
msize,prg_,is_unique_picker=True)
|
|
196
198
|
mset = sorted([ai[mi] for mi in mset_index])
|
|
197
199
|
mset = sorted(mset)
|
|
198
200
|
|
|
199
201
|
# nset is from static even distribution
|
|
200
202
|
nsize = int(modulo_in_range(self.prg(),self.ns_range))
|
|
201
203
|
sx = [i for i in range(self.nm[0])]
|
|
202
|
-
|
|
204
|
+
|
|
205
|
+
nset = prg_choose_n(sx,nsize,prg_,is_unique_picker=True)
|
|
203
206
|
nset = sorted(nset)
|
|
204
207
|
|
|
205
208
|
# try adding the generated (nset,mset)
|
|
@@ -4,7 +4,8 @@ from collections import deque
|
|
|
4
4
|
|
|
5
5
|
DEFAULT_AFSGEN_NUM_CENTROIDS = 5
|
|
6
6
|
|
|
7
|
-
DEFAULT_AFSGEN_CENTROID_UPDATE_RANGE = [2,13]
|
|
7
|
+
DEFAULT_AFSGEN_CENTROID_UPDATE_RANGE = [2,7]#13]
|
|
8
|
+
DEFAULT_AFSGEN_CENTROID_UPDATE_FREQUENCY = 12
|
|
8
9
|
|
|
9
10
|
"""
|
|
10
11
|
(A)ffine (F)it (S)earch (Gen)erator.
|
|
@@ -32,7 +33,8 @@ diff_mode := ~
|
|
|
32
33
|
"""
|
|
33
34
|
class AFSGen:
|
|
34
35
|
|
|
35
|
-
def __init__(self,prg,prg2,prg3,prg4,num_vectors,diff_mode:bool=True
|
|
36
|
+
def __init__(self,prg,prg2,prg3,prg4,num_vectors,diff_mode:bool=True,\
|
|
37
|
+
update_frequency=DEFAULT_AFSGEN_CENTROID_UPDATE_FREQUENCY):
|
|
36
38
|
assert type(prg) in {MethodType,FunctionType}
|
|
37
39
|
assert type(prg2) in {MethodType,FunctionType,type(None)}
|
|
38
40
|
assert type(prg3) in {MethodType,FunctionType,type(None)}
|
|
@@ -40,9 +42,11 @@ class AFSGen:
|
|
|
40
42
|
|
|
41
43
|
assert type(num_vectors) == int and num_vectors > 0
|
|
42
44
|
assert type(diff_mode) == bool
|
|
45
|
+
assert update_frequency > 0 and type(update_frequency) == int
|
|
43
46
|
|
|
44
47
|
self.num_vectors = num_vectors
|
|
45
48
|
self.diff_mode = diff_mode
|
|
49
|
+
self.update_frequency = update_frequency
|
|
46
50
|
|
|
47
51
|
self.prg = prg
|
|
48
52
|
self.prg2 = prg2
|
|
@@ -57,19 +61,25 @@ class AFSGen:
|
|
|
57
61
|
self.instantiate_AFSearch()
|
|
58
62
|
|
|
59
63
|
self.queue = deque()
|
|
64
|
+
|
|
65
|
+
self.c = 0
|
|
60
66
|
return
|
|
61
67
|
|
|
62
68
|
def __next__(self):
|
|
63
69
|
|
|
64
70
|
if len(self.queue) == 0:
|
|
65
71
|
q = self.prg()
|
|
72
|
+
##print("mapping")
|
|
66
73
|
x = self.afsearch.map_input(q)
|
|
74
|
+
##print("got ",x)
|
|
67
75
|
x = self.output_difference(x)
|
|
68
76
|
v = list(x.flatten())
|
|
69
77
|
v = prg_seqsort(v,self.prg)
|
|
70
78
|
|
|
71
79
|
self.queue.extend(v)
|
|
80
|
+
##print('adjusting')
|
|
72
81
|
self.adjust_centroids()
|
|
82
|
+
##print('post')
|
|
73
83
|
return self.queue.popleft()
|
|
74
84
|
|
|
75
85
|
def output_difference(self,q):
|
|
@@ -81,6 +91,12 @@ class AFSGen:
|
|
|
81
91
|
return q - L
|
|
82
92
|
|
|
83
93
|
def adjust_centroids(self):
|
|
94
|
+
self.c += 1
|
|
95
|
+
|
|
96
|
+
if self.c % self.update_frequency:
|
|
97
|
+
return
|
|
98
|
+
self.c = 0
|
|
99
|
+
|
|
84
100
|
x = modulo_in_range(int(self.prg()),DEFAULT_AFSGEN_CENTROID_UPDATE_RANGE)
|
|
85
101
|
for _ in range(x):
|
|
86
102
|
next(self.afsearch)
|
|
@@ -43,9 +43,11 @@ class CongruenceShifterGen:
|
|
|
43
43
|
if self.c == self.next_shift:
|
|
44
44
|
if x_ != self.prev:
|
|
45
45
|
self.super_range = modrange_for_congruence(x_,self.prev,self.super_range)
|
|
46
|
-
if self.super_range[0]
|
|
46
|
+
if self.super_range[0] > self.super_range[1]:
|
|
47
47
|
print("...strange...")
|
|
48
48
|
self.super_range = sorted(self.super_range)
|
|
49
|
+
elif self.super_range[0] == self.super_range[1]:
|
|
50
|
+
self.super_range = (self.super_range[0],self.super_range[1] + 5.0)
|
|
49
51
|
|
|
50
52
|
self.c = 0
|
|
51
53
|
self.set_next_shift()
|
|
@@ -68,8 +70,12 @@ class CongruenceShifterGen:
|
|
|
68
70
|
|
|
69
71
|
start = self.super_range[0] + (s0 * l / 2)
|
|
70
72
|
end = self.super_range[1] + (s1 * l / 2)
|
|
73
|
+
|
|
74
|
+
# NOTE: null range case
|
|
75
|
+
if start == end: end += 5.0
|
|
76
|
+
|
|
71
77
|
##print('before: ',self.super_range)
|
|
72
|
-
self.super_range = (start,end)
|
|
78
|
+
self.super_range = (start,end)
|
|
73
79
|
##print('after: ',self.super_range)
|
|
74
80
|
|
|
75
81
|
self.c2 = 0
|
|
@@ -224,8 +224,6 @@ class MDRGen:
|
|
|
224
224
|
c2 = 0
|
|
225
225
|
while len(terminated_seeds) < len(intseed_cycle) and \
|
|
226
226
|
c < max_sequences and c2 < max_sequences * 2.5:
|
|
227
|
-
print("TT: ",terminated_seeds,len(intseed_cycle))
|
|
228
|
-
print("CC: ",c,max_sequences)
|
|
229
227
|
r, stat = self.add_sequence__type_novelgen_(intseed_cycle[i])
|
|
230
228
|
|
|
231
229
|
if not stat:
|
|
@@ -139,6 +139,21 @@ class RCHAccuGen:
|
|
|
139
139
|
else:
|
|
140
140
|
assert is_vector(x)
|
|
141
141
|
|
|
142
|
+
if self.verbose:
|
|
143
|
+
print("\t\t** CHAIN VALUES W/: ",x)
|
|
144
|
+
|
|
145
|
+
## NOTE: for viewing input-output values before actual calculation
|
|
146
|
+
"""
|
|
147
|
+
x2 = x
|
|
148
|
+
for s_ in self.rch.s:
|
|
149
|
+
print(s_)
|
|
150
|
+
x2 = deepcopy(s_.f)(x2)
|
|
151
|
+
x2_ = safe_npint32_value(x2)
|
|
152
|
+
x2_ = modulo_in_range(x2_,self.output_range)
|
|
153
|
+
print("$ $ $ $ $: ",x2,x2_)
|
|
154
|
+
#print("== ",self.rch.s[i])
|
|
155
|
+
"""
|
|
156
|
+
|
|
142
157
|
##self.rch.vpath.clear()
|
|
143
158
|
try:
|
|
144
159
|
self.rch.apply(x)
|
|
@@ -150,16 +165,13 @@ class RCHAccuGen:
|
|
|
150
165
|
tmp_queue = []
|
|
151
166
|
last_length = 0
|
|
152
167
|
|
|
153
|
-
|
|
154
|
-
print("\t\t** CHAIN VALUES W/: ",x)
|
|
155
|
-
|
|
156
|
-
for v in self.rch.vpath:
|
|
168
|
+
for (i,v) in enumerate(self.rch.vpath):
|
|
157
169
|
if type(v) != np.ndarray:
|
|
158
170
|
v = safe_npint32_value(v)
|
|
159
171
|
v = modulo_in_range(v,self.output_range)
|
|
160
172
|
|
|
161
173
|
if self.verbose:
|
|
162
|
-
print("-- ",v)
|
|
174
|
+
print("-- {}: {}".format(i,v))
|
|
163
175
|
tmp_queue.append(v)
|
|
164
176
|
last_length = 1
|
|
165
177
|
else:
|
|
@@ -169,7 +181,7 @@ class RCHAccuGen:
|
|
|
169
181
|
for v_ in v]
|
|
170
182
|
|
|
171
183
|
if self.verbose:
|
|
172
|
-
print("-- ",v)
|
|
184
|
+
print("-- {}: {}".format(i,v))
|
|
173
185
|
|
|
174
186
|
tmp_queue.extend(v)
|
|
175
187
|
last_length = len(v)
|
|
@@ -307,12 +319,13 @@ class RCHAccuGen:
|
|
|
307
319
|
else:
|
|
308
320
|
d = modulo_in_range(self.prg(),self.dim_range)
|
|
309
321
|
|
|
310
|
-
|
|
322
|
+
prg_ = prg__single_to_int(self.prg)
|
|
323
|
+
q1 = np.array(prg_choose_n(self.acc_queue,d,prg_))
|
|
311
324
|
|
|
312
325
|
# case: LinCombo, change both 'rf' and 'cf'
|
|
313
326
|
if type(mg.base_func) == LinCombo:
|
|
314
327
|
d2 = d - 1
|
|
315
|
-
q2 = np.array(prg_choose_n(self.acc_queue,d2,
|
|
328
|
+
q2 = np.array(prg_choose_n(self.acc_queue,d2,prg_))
|
|
316
329
|
self.tmpset_rch_updatepath(rci_index,q2)
|
|
317
330
|
self.rch.s[rci_index].inst_update_var()
|
|
318
331
|
|
|
@@ -47,6 +47,7 @@ class UDLSGen:
|
|
|
47
47
|
self.verbose = verbose
|
|
48
48
|
|
|
49
49
|
self.udls = None
|
|
50
|
+
self.udls_ = None
|
|
50
51
|
|
|
51
52
|
self.cache = deque()
|
|
52
53
|
|
|
@@ -59,8 +60,15 @@ class UDLSGen:
|
|
|
59
60
|
self.set_next_shift(2)
|
|
60
61
|
|
|
61
62
|
def __next__(self):
|
|
62
|
-
V =
|
|
63
|
-
|
|
63
|
+
V,x = None,None
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
V = self.one_input_vector()
|
|
67
|
+
x = self.udls.apply(V)
|
|
68
|
+
# NOTE: for catching cases where `prg` cannot produce a UDLinSysSolver
|
|
69
|
+
except:
|
|
70
|
+
self.cache.append(self.prg())
|
|
71
|
+
return self.cache.popleft()
|
|
64
72
|
|
|
65
73
|
self.cache.extend(V)
|
|
66
74
|
self.cache.append(x)
|
|
@@ -81,7 +89,8 @@ class UDLSGen:
|
|
|
81
89
|
def load_udls(self,draw_from_cache:bool=False,num_attempts_remaining=3):
|
|
82
90
|
|
|
83
91
|
X,Y = self.new_XY_dataset(draw_from_cache)
|
|
84
|
-
|
|
92
|
+
self.udls_ = deepcopy(self.udls)
|
|
93
|
+
|
|
85
94
|
if self.verbose:
|
|
86
95
|
print("\t\t** new dataset")
|
|
87
96
|
print("-- input")
|
|
@@ -101,7 +110,8 @@ class UDLSGen:
|
|
|
101
110
|
except:
|
|
102
111
|
if num_attempts_remaining > 0:
|
|
103
112
|
return self.load_udls(draw_from_cache,num_attempts_remaining - 1)
|
|
104
|
-
|
|
113
|
+
else:
|
|
114
|
+
self.udls = self.udls_
|
|
105
115
|
return
|
|
106
116
|
|
|
107
117
|
def new_XY_dataset(self,draw_from_cache:bool=False):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{seqbuild-0.0.73 → seqbuild-0.0.74}/seqbuild/face/sample_script/seqbuild_realtime_command.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|