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
-keep class com.google.unity.** { | |
*; | |
} | |
-keep public class com.google.android.gms.ads.**{ | |
public *; | |
} | |
-keep public class com.google.ads.**{ | |
public *; | |
} | |
-keepattributes *Annotation* |
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
// TFjs and gcs are using a lot of memory, so increasing it will speed up the functions | |
exports.train = functions | |
.runWith({ memory: "2GB" }) | |
.https.onRequest(async (request, response) => { | |
const existJSON = await bucket.file("model.json").exists().then(ex => ex[0]); | |
const existBIN = await bucket.file("weights.bin").exists().then(ex => ex[0]); | |
if (!existJSON || !existBIN) { | |
const model = tf.sequential(); | |
model.add(tf.layers.dense({ units: 2, inputShape: [vocabulary.length] })); |
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
const trainSave = async (model, querySnapshot) => { | |
if (!querySnapshot.docs.length) return false; | |
const xs_data = querySnapshot.docs.map(doc => fitData(doc.data().text)); | |
const ys_data = querySnapshot.docs.map( | |
doc => (doc.data().y === "positive" ? [1] : [0]) | |
); | |
const xs = tf.tensor2d(xs_data); | |
const ys = tf.tensor2d(ys_data); |
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
exports.runLinearModel = functions.https.onRequest((request, response) => { | |
// Get x_test value from the request body | |
const x_test = Number(request.body.x); | |
// Check if the x value is number. Otherwise request a valid one and terminate the function. | |
if (typeof x_test !== "number" || isNaN(x_test)) | |
response.send("Error! Please format your request body."); | |
// Define a model for linear regression. | |
const linearModel = tf.sequential(); |
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
// simple vocabulary with positive and negative terms | |
const vocabulary = ["bad", "slow", "ugly", "overrated", "expensive", "wrong", "good", "amazing", "fast", "kind", "cheap"]; | |
const fitData = string => { | |
const stringSplit = string.replace(/[^a-zA-Z ]+/g, "").split(" "); | |
const words = {}; | |
stringSplit.forEach(ev => { | |
words[ev] = | |
typeof words[ev] === "number" ? (words[ev] += 1) : (words[ev] = 1); |
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
.keyboard { | |
position: absolute; | |
width: 600px; | |
height: 300px; | |
color: darkslategray; | |
border: 2px solid currentColor; | |
border-radius: 12px; | |
margin: 300px 10px 10px 65px; | |
transform: rotateX(30deg) rotateZ(0deg); | |
box-shadow: 2px 5px 12px currentColor; |
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
// Before | |
import { RSGButton } from 'rsg-components' | |
import { RSGBox } from 'rsg-components'; | |
import { RSGCheckbox, RSGLabel } from 'rsg-components' | |
import { RSGProgressBar as PB } from 'rsg-components' | |
// After 3.0.0-beta.1 | |
import { Button } from 'rsg-components' | |
import { Box } from 'rsg-components'; | |
import { Checkbox, Label } from 'rsg-components' |