Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
.5f %.5f' % (macd[0][-1], macd[1][-1], macd[2][-1]))

# Temporarily MODIFY THE GENOME at the current locus
storage.genome[storage.locus] = allele
# use genome definition to return ideal position
sim_position = genome(
macd[0][-1], macd[1][-1], macd[2][-1], all_bull, all_bear)
# Undo MODIFY THE GENOME
storage.genome[storage.locus] = original_state

# check what each simulation is holding
sim_state = np.argmax(portfolio, axis=1)

# if the the simulator wants to change position
if sim_position != sim_state[allele]:
#if (cut == depth): log('allele %s simulator trade signal: to' % allele)

#update simulated portfolio via the last price
#last[0] 'ltcbtc close'
#last[1] 'ltcusd close'
#last[2] 'btcusd close'
if sim_position == 0:
#if (cut == depth): log('move to usd')
if sim_state[allele] == 1:
#if (cut == depth): log('via btcusd')
portfolio[allele][0] = portfolio[allele][1] * last[2]
portfolio[allele][1] = 0
if sim_state[allele] == 2:
#if (cut == depth): log('via ltcusd')
portfolio[allele][0] = portfolio[allele][2] * last[1]
portfolio[allele][2] = 0

if sim_position == 1:
#if (cut == depth): log('move to btc')
if sim_state[allele] == 0:
#if (cut == depth): log('via btcusd')
portfolio[allele][1] = portfolio[allele][0] / last[2]
portfolio[allele][0] = 0
if sim_state[allele] == 2:
#if (cut == depth): log('via ltcbtc')
portfolio[allele][1] = portfolio[allele][2] * last[0]
portfolio[allele][2] = 0

if sim_position == 2:
#if (cut == depth): log('move to ltc')
if sim_state[allele] == 0:
#if (cut == depth): log('via ltcusd')
portfolio[allele][2] = portfolio[allele][0] / last[1]
portfolio[allele][0] = 0
if sim_state[allele] == 1:
#if (cut == depth): log('via ltcbtc')
portfolio[allele][2] = portfolio[allele][1] / last[0]
portfolio[allele][1] = 0
#if (cut == depth):
# log('sim_position %s' % sim_position)
# log('sim_state %s' % sim_state)
# log(portfolio)

# move postion back to usd at the end of the simulated backtest
sim_state = np.argmax(portfolio, axis=1)
if sim_state[allele] != 0:
if sim_state[allele] == 1:
#if (cut == depth): log('via btcusd')
portfolio[allele][0] = portfolio[allele][1] * last[2]
portfolio[allele][1] = 0
if sim_state[allele] == 2:
#if (cut == depth): log('via ltcusd')
portfolio[allele][0] = portfolio[allele][2] * last[1]
portfolio[allele][2] = 0

log(portfolio)

# determine which allele has highest USD ROI
winner = -1
if portfolio[0][0] > max([portfolio[1][0], portfolio[2][0]]): winner = 0
if portfolio[1][0] > max([portfolio[0][0], portfolio[2][0]]): winner = 1
if portfolio[2][0] > max([portfolio[0][0], portfolio[1][0]]): winner = 2


# if mutation improves ROI
if (winner != original_state) and (winner > -1):
# evolve genome at this locus to winning allele
storag
Is it possible to share cache between each user?

Django is using cache per session strategy right?, So what if this cache is shared between users? That makes user each user don't need to hit Database but first. Have you guys done the same before?

#Update
it's rest API

/r/django
https://redd.it/aetbd1
[N] OpenAI releasing the 345M model of GPT-2 and sharing the 1.5B model "with partners working on countermeasures"

OpenAI has decided to adopt a staged release approach to their GPT-2 language model.

Announcement on Twitter: https://twitter.com/OpenAI/status/1124440412679233536

The following quotes are from the update on their blog: https://openai.com/blog/better-language-models/#update

#Staged Release

>Staged release involves the gradual release of a family of models over time. The purpose of our staged release of GPT-2 is to give people time to assess the properties of these models, discuss their societal implications, and evaluate the impacts of release after each stage.

>As the next step in our staged release strategy, we are releasing the 345M parameter version of GPT-2. This model features improved performance relative to the 117M version, though falls short of the 1.5B version with respect to the ease of generating coherent text. We have been excited to see so many positive uses of GPT-2-117M, and hope that 345M will yield still more benefits.

>While the misuse risk of 345M is higher than that of 117M, we believe it is substantially lower than that of 1.5B, and we believe that training systems of similar capability to GPT-2-345M is well within the reach of many actors already; this evolving replication landscape has informed our decision-making about what is appropriate to release.

>In making our 345M release decision, some of the

/r/MachineLearning
https://redd.it/bkejvb