Categories
Artificial Intelligence (AI) Mastering Development

Why does the result when restoring a saved DDPG model differ significantly from the result when saving it?

I save the trained model after a certain number of episodes with the special save() function of the DDPG class (the network is saved when the reward reaches zero), but when I restore the model again using saver.restore(), the network gives out a reward equal to approximately -1800. Why is this happening, maybe I’m doing […]

Categories
Mastering Development

How to count the number of letters that exist without repeated

I want a way to count the letters in an string for example: My string : “Hello my friends “ The characters in the string : {H,e,l,o, ,m,y,f,r,i,n,d,s} These letters exist without repeating them (with a blank space) So the result I want is: 13 The goal of all of this is, I want to […]

Categories
Cryptocurrency Ethereum Mastering Development

what is the best to signing a message , from javascript or solidity?

i am new in ethereum and smart contract, now i try to make a small DApp using: web3, ganache, Metamask, javascript connect with remix to write a contract, so my DApp have to sign a message and verify it so i am confused i see two ways to sign a message one use javascript function […]

Categories
Mastering Development

‘utf-8’ codec can’t decode byte – Python

My Django application is working with both .txt and .doc filetypes. And this application opens a file, compares it with other files in db and prints out some report. Now the problem is that, when file type is .txt, I get ‘utf-8′ codec can’t decode byte error (here I’m using encoding=’utf-8′). When I switch encoding=’utf-8′ […]

Categories
Artificial Intelligence (AI) Mastering Development

Efficient algorithm to obtain near optimal policies for an MDP

Given a discrete, finite Markov Decision Process (MDP) with its usual parameters $(S, A, T, R, \gamma)$, it is possible to obtain the optimal policy $\pi^{*}$ and the optimal value function $V^{*}$ through one of many planning methods (policy iteration, value iteration or solving a linear program). I am interested in obtaining a random near-optimal […]

Categories
Mastering Development

Can anyone explain what this is

},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&”radio”===b&&n.nodeName(a,”input”)){var c=a.value;return a.setAttribute(“type”,b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{“for”:”htmlFor”,”class”:”className”},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&”set”in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&”get”in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute(“tabindex”)||b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each([“tabIndex”,”readOnly”,”maxLength”,”cellSpacing”,”cellPadding”,”rowSpan”,”colSpan”,”useMap”,”frameBorder”,”contentEditable”],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=”string”==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||””).match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(” “+c.className+” “).replace(ac,” “):” “)){f=0;while(e=b[f++])d.indexOf(” “+e+” “)<0&&(d+=e+” “);g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||”string”==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||””).match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(” “+c.className+” “).replace(ac,” “):””)){f=0;while(e=b[f++])while(d.indexOf(” “+e+” “)>=0)d=d.replace(” “+e+” “,” “);g=a?n.trim(d):””,c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return”boolean”==typeof b&&”string”===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if(“string”===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||”boolean”===c)&&(this.className&&L.set(this,”className“,this.className),this.className=this.className||a===!1?””:L.get(this,”className“)||””)})},hasClass:function(a){for(var b=” “+a+” “,c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(” “+this[c].className+” “).replace(ac,” “).indexOf(b)>=0)return!0;return!1}});var […]

Categories
Artificial Intelligence (AI) Mastering Development

Efficient algorithm to obtain near optimal policies for an MDP

Given a discrete, finite Markov Decision Process (MDP) with its usual parameters $(S, A, T, R, \gamma)$, it is possible to obtain the optimal policy $\pi^{*}$ and the optimal value function $V^{*}$ through one of many planning methods (policy iteration, value iteration or solving a linear program). I am interested in obtaining a random near-optimal […]

Categories
Mastering Development Software

When to use known languages/libraries vs. investing in learning new ones?

This question is asked in a general way. In case it is hard to understand, I have added a concrete example below. I am interested in the answer to the general question. I have a lot of experience writing programs of type X, but now I need to write a program of type Y. Everybody […]

Categories
Artificial Intelligence (AI) Mastering Development

Can this be a possible deep q learning pseudocode?

I am not using replay here. s – state a – action r – reward n_s – next state q_net – neural network representing q step() { get s,a,r,n_s q_target[s,a]=r+gamma*max(q_net[n_s,:]) loss=mse(q_target,q_net[s,a]) loss.backprop() } while(!terminal) { totalReturn+=step(); }

Categories
Linux Mastering Development

Command to create/connect to an I/O stream?

So I’m trying to connect to a (Lua) debugger embedded in a program by redirecting the I/O. Currently I create a pair of FIFOs for the read and write streams and connect to them using cat /tmp/dbg_write & cat > /tmp/dbg_read. This is workable and pretty straightforward, but if you don’t exit everything just right […]