This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
var text = document.body.innerText; | |
var spl = text.split(" "); | |
if (spl.length > 3000) { | |
text = spl.slice(0, 3000).join(" "); | |
} | |
fetch('https://api.openai.com/v1/completions', { | |
method: 'POST', | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
openai.api_key = "YOUR API KEY HERE" | |
model_engine = "text-davinci-003" | |
chatbot_prompt = """ | |
As an advanced chatbot, your primary goal is to assist users to the best of your ability. This may involve answering questions, providing helpful information, or completing tasks based on user input. In order to effectively assist users, it is important to be detailed and thorough in your responses. Use examples and evidence to support your points and justify your recommendations or solutions. | |
<conversation history> | |
User: <user input> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
That is not a real RawGit/jsDelivr file (at least I hope).
Please use https://www.jsdelivr.com/rawgit to migrate.
2 Quick Options to Quickly Migrate from RawGit to jsDelivr:
- Cut, paste, copy, paste links using https://www.jsdelivr.com/rawgit
- Simply (auto-)update your URLs, noting the differences (bolded below):
https://rawgit.com/userName/projectName/master/fileName.extension
https://cdn.jsdelivr.net/gh/userName/projectName@master/fileName.extension
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |