mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
fixed enable/disable chaos 'if chain' in iter kernel function
This commit is contained in:
parent
b732a3c244
commit
44f897f28e
@ -92,7 +92,7 @@ void iter(mwc_st *msts, iter_info *infos, float4 *accbuf, float *denbuf) {
|
||||
while (nsamps > 0) {
|
||||
float xfsel = mwc_next_01(&rctx);
|
||||
|
||||
{{if packer.get("cp.chaos_used")==True}}
|
||||
{{if features.chaos_used}}
|
||||
{{for density_row_idx, prior_xform_idx in enumerate(features.std_xforms)}}
|
||||
{{for density_col_idx, this_xform_idx in enumerate(features.std_xforms)}}
|
||||
if (last_xf_used == {{prior_xform_idx}} &&
|
||||
|
@ -46,11 +46,8 @@ class Genome(object):
|
||||
# Chaos support
|
||||
num_std_xf = len(dens)
|
||||
self.chaos_densities = np.zeros( (num_std_xf,num_std_xf) )
|
||||
self.chaos_used = False
|
||||
for r in range(num_std_xf):
|
||||
chaos_row = np.array([ctypes_genome.chaos[r][c] for c in range(num_std_xf)])
|
||||
if np.any(chaos_row != 1.0):
|
||||
self.chaos_used = True
|
||||
chaos_row = chaos_row * dens
|
||||
chaos_row /= np.sum(chaos_row)
|
||||
chaos_row = [np.sum(chaos_row[:i+1]) for i in range(len(dens))]
|
||||
@ -458,6 +455,14 @@ class Features(object):
|
||||
self.acc_height = genomes[0].height + 2 * self.gutter
|
||||
self.acc_stride = 32 * int(math.ceil(self.acc_width / 32.))
|
||||
self.std_xforms = filter(lambda v: v != self.final_xform_index, range(self.nxforms))
|
||||
self.chaos_used = False
|
||||
for cp in genomes:
|
||||
for r in range(len(self.std_xforms)):
|
||||
for c in range(len(self.std_xforms)):
|
||||
if cp.chaos[r][c] != 1.0:
|
||||
self.chaos_used = True
|
||||
|
||||
|
||||
|
||||
class XFormFeatures(object):
|
||||
def __init__(self, xforms, xform_id):
|
||||
|
Loading…
Reference in New Issue
Block a user