title | project | image | author | dateCreated | dateModified | categories | tags | featured | draft | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Lorem ipsum dolor sit amet |
Lorem One |
|
|
1/8/2021 |
|
|
true |
true |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque convallis purus vitae ipsum imperdiet condimentum. Nunc vel vehicula augue. Vestibulum luctus nulla nisl, at congue augue maximus et. Mauris eget massa dui. Cras sagittis accumsan lacus.
An example JavaScript code.
const srcPath = "./articles/";
const dstPath = "./content/posts/";
fs.watch(srcPath, { persistent: true }, function (event, filename) {
if ((event = "change")) {
const srcFile = filename;
const dstFile = srcFile.split(".")[0] + ".json";
processor.process(
toVFile.readSync(srcPath + srcFile, "utf8"),
function (error, file) {
if (error) throw error;
console.error(reporter(error || file));
let jsonOutput = {
schema: file.data.frontmatter,
body: file.contents,
};
let article = JSON.stringify(jsonOutput).replace(/\n/g, " ");
// console.log(article);
fs.writeFileSync(dstPath + dstFile, article);
}
);
}
});
A Python
code sample.
if __name__ == "__main__":
import doctest
doctest.testmod()
network = Perceptron(
sample=samples, target=exit, learning_rate=0.01, epoch_number=1000, bias=-1
)
network.training()
print("Finished training perceptron")
print("Enter values to predict or q to exit")
while True:
sample: list = []
for i in range(len(samples[0])):
user_input = input("value: ").strip()
if user_input == "q":
break
observation = float(user_input)
sample.insert(i, observation)
network.sort(sample)
MIT