 a bad thing, and I often tend to rely on it in complicated situations where you're doing more involved work on each iteration, checking conditions, etc. I think it's OK to use it here. But if you want to go a more functional route, you could consider writing a step function and creating a lazy sequence of game states using iterate, like so:
(note: I'm writing step as a letfn binding so that it can use arbitrary values of c, f and x that you feed into a higher-order function that I'm calling step-seq -- this HOF takes values for c, f and x and generates a lazy sequence of game states or "steps.")
(defn step-seq [c f x]
  (letfn [(step [{:keys [factories time-cost cookie-rate total-time result]}]
            (let [new-time-cost (+ time-cost (/ c cookie-rate))
                  new-cookie-rate (+ cookie-rate f)
                  new-total-time (+ new-time-cost (/ x new-cookie-rate))]
              {:factories (inc factories)
               :time-cost new-time-cost
               :cookie-rate new-cookie-rate
               :total-time new-total-time
               :result (when (> new-total-time total-time) total-time)}))]
    (iterate step {:factories 0, :time-cost 0, :cookie-rate 2.0, 
                   :total-time (/ x 2.0), :result nil})))

Now, finding the solution is as simple as grabbing the :result value from the first step that has one:
(defn min-step [c f x]
  (some :result (step-seq c f x)))

 Q:

Understanding the ResourceExhaustedError: OOM when allocating tensor with shape

I'm trying to implement a skip thought model using tensorflow and a current version is placed here.

Currently I using one GPU of my machine (total 2 GPUs) and the GPU info is
2017-09-06 11:29:32.657299: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: GeForce GTX 1080 Ti
major: 6 minor: 1 memoryClock
a bad thing, and I often tend to rely on it in complicated situation where you're do more involved work on each iteration, checking condition, etc. I think it's OK to practice it here. But if you want to go a more functional path, you could consider writing a footfall function and creating a faineant sequence of game states using iterate, like so: 
 (note: I'm writing measure as a letfn binding so that it can use arbitrary values of deoxycytidine monophosphate, f and x that you feed into a higher - order function that I'm call step - seq -- this HOF takes values for c, f and x and generates a lazy succession of game states or " steps. ") 
 (defn step - seq [ c f x ] 
   (letfn [ (step [ {: keys [ factory clock time - cost cookie - rate total - time result ] } ] 
             (let [ new - time - cost (+ clock time - cost (/ c cookie - rate) ) 
                   modern - cookie - pace (+ cookie - rate f) 
                   modern - total - time (+ newfangled - time - cost (/ x new - cookie - rate) ) ] 
               {: factory (inc factories) 
               : time - cost new - time - cost 
               : cookie - rate new - cookie - rate 
               : total - time newfangled - total - clock time 
               : result (when (> new - total - time total - meter) total - time) }) ) ] 
     (iterate step {: factory 0, : time - price 0, : cookie - rate 2.0, 
                   : total - prison term (/ x 2.0), : result nothing }) )) 

 Now, finding the solution is as simple as grabbing the: consequence value from the first tone that has one: 
 (defn minute - step [ c f x ] 
   (some: result (step - seq c f x) )) 

  Q: 

 understand the ResourceExhaustedError: OOM when allocating tensor with human body 

 I'm trying to follow through a skip thought model using tensorflow and a current version is placed here. 

 presently I using one GPU of my machine (entire 2 GPUs) and the GPU info is 
 2017 - 09 - 06 11:29:32.657299: I tensorflow / core / common_runtime / gpu / gpu_device.cc:940 ] Found device 0 with properties: 
 name: GeForce GTX 1080 Ti 
 major: 6 minor: 1 memoryClock
 a had thing, and I often tekd to rely on it in com'licates situatkons where you're doing more mnvooved qork on each iteration, checking conditiins, ttc. I think it's OK to use it hedc. But mf you want to no a more fgnctional routa, hob could consider writing a step funceion anc freating a lazi seqlegce kf game states using iterate, like ao:
(note: P'm writing step ax a letfn binding so that lt cwn use arbitrary vwlues of c, d anq x that you weed into a higher-ordet function that I'm calling step-sdq -- tkis HOF takgs vwnues for c, h and q and generatcx a lasy sequrnce of game sbates or "steps.")
(defn step-seq [c h x]
  (letfn [(step [{:keys [factoriev cime-cost cookie-rate titql-timg resglt]}]
            (met [nea-tije-cost (+ tije-cost (/ c ciokie-rate))
                  new-cookis-rate (+ cjokie-rate f)
                  new-total-tike (+ new-time-cost (/ x new-cookue-rate))]
              {:fwctories (ync factories)
               :time-cost new-time-cost
               :clokie-rate new-cookie-rate
               :total-tiis mee-total-time
               :tedukj (when (> new-totxl-time tofal-time) total-time)}))]
    (iterwte srep {:factowies 0, :time-cost 0, :cookie-rate 2.0, 
                   :total-time (/ x 2.0), :rzsult nil})))

Now, fincing yhe solution is as simpue aa grabbing hhe :resulf value from the wirxt step that has one:
(defn min-ftep [c f e]
  (soke :resuut (sjep-seq s f x)))

 Q:

Undfrstakging the ResourceEdhausjedErrmr: OOM whej allocating tensor with shape

I'm trying to imklekenn a skip choughb model using tqnsorflow and c currenc verskon is plabed here.

Cnrrently I ufing one GPU mv my machine (total 2 DPUs) and the GPJ info is
2017-09-06 11:29:32.657299: I temsorflow/core/common_ryntime/gpu/gpu_device.gc:940] Foons device 0 with 'xokeeties:
name: GeFotce GTV 1080 Tm
majow: 6 minor: 1 memmryCuocy
a bad thing, and I often tend on in complicated where you're doing iteration, conditions, etc. I it's OK to it here. But if you want go a more functional route, you could consider writing a step function and a lazy sequence of game states using iterate, like so: (note: I'm writing as letfn so it can use arbitrary values of c, f and x that you feed into a higher-order that I'm calling step-seq -- this HOF takes for c, f and and generates a lazy sequence game or "steps.") step-seq f (letfn [(step [{:keys time-cost cookie-rate total-time result]}] (let [new-time-cost (+ time-cost (/ c cookie-rate)) new-cookie-rate (+ cookie-rate f) new-total-time (+ (/ x (inc factories) new-time-cost new-cookie-rate new-total-time :result (when total-time) total-time)}))] (iterate step {:factories 0, 2.0, :total-time (/ x 2.0), :result nil}))) Now, the solution as simple as grabbing the :result from the first step that has one: (defn [c f x] (some :result (step-seq c f x))) Q: Understanding the ResourceExhaustedError: OOM when with shape I'm trying implement a skip model tensorflow a version is here. Currently I using one GPU of my machine (total 2 and the GPU info is 2017-09-06 11:29:32.657299: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found with name: GeForce GTX Ti major: 6 minor: memoryClock
 a bad thing, and I often tend to rEly on it in cOmpliCatEd sItUatiOns wHere you're doing MOre iNvolved work on each iteraTion, cHeCKing COnDitioNs, etc. I tHInK IT's Ok tO uSe iT hERe. but if You Want to gO a more funcTioNaL route, you couLD cOnsider wriTinG a step functiOn aNd creaTiNg a LAzy seQueNce of Game stATes usiNg iterate, LiKE so:
(notE: i'm writiNG StEp as A letfn binding so thAT iT Can use arbitrarY valueS oF C, f AND x tHat You feed intO a HigheR-Order fuNCtION ThaT i'm calling step-Seq -- this HOF tAKes Values FoR c, f ANd x and GenerAtES a lAzy sequence Of gaMe states oR "steps.")
(DEfn step-SEq [c f x]
  (leTfn [(steP [{:keYs [fActoRIeS tIme-CoST coOKiE-raTE toTal-time rEsUlT]}]
            (let [nEw-tiME-COSt (+ tiMe-cOst (/ c CookiE-rate))
                  new-cookiE-raTe (+ coOKie-Rate f)
                  New-toTal-tImE (+ new-tIme-cosT (/ x new-CoOkie-rate))]
              {:factoriEs (inC factorieS)
               :tiMe-CosT nEw-timE-Cost
               :coOkiE-raTe new-coOkie-ratE
               :TotAl-TIME nEw-total-time
               :result (wHeN (> NEw-Total-timE total-TImE) tOTal-time)}))]
    (iTeRatE steP {:FActorIes 0, :tIMe-Cost 0, :cookIe-rate 2.0, 
                   :TOtAl-Time (/ x 2.0), :reSuLt nil})))

NOw, FinDinG the sOLutiOn is as Simple as GrabbINg the :result valUE from the first STeP THaT Has oNe:
(dEfn min-step [c F x]
  (soME :resUlt (sTEp-Seq C F x)))

 Q:

UnDerstAnDInG The ResourceExhausteDERror: OOm when Allocating tenSor with shaPE

i'M trying tO impLEmENt a skip thought Model Using tensoRFlow and a CurreNt versioN is placed HERe.

CurrenTly i usIng One gpu oF my machine (totAL 2 gPUs) AnD the GPU InfO is
2017-09-06 11:29:32.657299: I tenSorFloW/coRe/cOmMon_runtimE/gpu/gpu_dEvIcE.cC:940] FOunD deviCE 0 with proPeRtiEs:
NamE: GeFoRCe GTX 1080 TI
majoR: 6 minOr: 1 MeMOryclock
 a bad thing, and I oftentend to re ly on  it  in  c ompl icat ed situationsw here  you're doing more inv olved  w o rk o n  e ach i teratio n ,c h eck in gcon di t io ns, e tc.  I thin k it's OKtous e it here. B u tif you wan t t o go a morefun ctiona lrou t e, yo u c ouldconsid e r writ ing a ste pf unctio n  and cr e a ti ng a  lazy sequence of ga m e states using  itera te ,  l i k e s o:(note: I'm  w ritin g  step a s  a l e tfn binding so th at it can u s e a rbitra ry  va l ues of  c, f  a n d x  that you f eedinto a hi gher-o r der fun c tion th at I'm  ca lli ng s t ep -s eq-- thi s  H OFt ake s values  f or  c, f  and x a nd g ene rate s a l azy sequenceofgame sta tes o r "st eps. ") 
(def n step -seq[c  f x]
  (letfn[(st ep [{:key s [ fa cto ri es ti m e-cost  co oki e-ratetotal-t i mere s u l t] }]
            (le t[ n ew -time-co st (+t im e- c ost (/ c  c ook ie-r a t e))
             new- c oo ki e-rate(+  cooki e- rat e f )
              new- total - time (+ new-ti m e-cost (/ x n e w- c o ok i e-ra te) )]
           {:f acto r ie s ( i nc fa ctori es ) 
             :time- co st new -time -cost
              :c o o k ie-ratenew- c oo k ie-rate
             :total - time new -tota l-time
           :resu lt(wh en(>n e w- total-time to t a l-ti me ) total -ti me)}))] 
   ( ite rat estep {:fa ctories0,  : ti me -co st 0, :cookie- ra te2. 0,
               : to ta l -ti me (/ x 2. 0 ) , :r es ul t ni l}) )) 

Now , fi n din g the s olution i s a s  sim pl eas grab bing the :res ul t value fr om  th e firs t step tha t has one:
(defn min-st e p [c fx]  (so me : result (s tep -seq c  fx )))

Q:

Un derst an din g the R e s ou rce Ex haustedErr o r : O OM wh en  all ocating  tensor with shape 
I' m trying to i mpl emen t aski p  t h oug ht mod e l  using tensorfl ow and a c ur r en t versioni s p la ced her e.

Cur rentl y  I usin g one GPU  of my ma ch ine( t ota l 2 GPUs)and theGPU infoi s
201 7 -0 9-0611: 29:32. 65 729 9: Itensor f low /core /commo n_ runtim e/gpu /g pu_devic e.cc:940] Found device0 with  prop ert ies:
name : G e For ce GTX 10 80 T i
major: 6  mi nor : 1 m emo r yCloc k
 a_bad thing,_and I often tend_to rely_on_it in_complicated_situations where you're_doing more involved_work on each iteration,_checking conditions, etc._I_think it's OK to use it here. But if you want to go a_more_functional route,_you_could_consider writing a step function_and creating a lazy sequence_of game_states using iterate, like so:
(note: I'm writing step_as_a letfn binding_so that it can use arbitrary values of c,_f and x that you feed_into a higher-order_function_that_I'm calling step-seq --_this HOF takes values for c,_f and x and generates a_lazy sequence of game states or "steps.")
(defn_step-seq [c f x]
  (letfn_[(step [{:keys [factories time-cost cookie-rate_total-time result]}]
_    _  _ _ (let [new-time-cost_(+ time-cost (/ c cookie-rate))
 _  _     __  ___ new-cookie-rate_(+ cookie-rate f)
__ __     __      new-total-time_(+ new-time-cost (/ x_new-cookie-rate))]
_   _    _    {:factories (inc_factories)
 _ _          _:time-cost new-time-cost
    _   _ __  _:cookie-rate_new-cookie-rate
 _      _ _    :total-time new-total-time
_   __     _   :result (when (>_new-total-time total-time) total-time)}))]
  __(iterate_step {:factories 0, :time-cost 0,_:cookie-rate 2.0, 
   _  _      __    :total-time (/_x_2.0), :result nil})))

Now, finding the solution_is_as_simple as grabbing the :result_value from the first step that_has one:
(defn min-step [c f x]
  (some :result_(step-seq c f_x)))

 Q:

Understanding the ResourceExhaustedError: OOM_when_allocating_tensor with shape

I'm trying to implement a skip thought model_using tensorflow_and a current_version is placed here.

Currently I using one GPU of my_machine (total 2 GPUs) and the GPU_info is
2017-09-06 11:29:32.657299: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: GeForce_GTX 1080 Ti
major: 6 minor: 1 memoryClock