This file contains hidden or 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 tensorflow as tf | |
class Graph(): | |
""" Importing and running isolated TF graph """ | |
def __init__(self, loc): | |
# Create local graph and use it in the session | |
self.graph = tf.Graph() | |
self.sess = tf.Session(graph=self.graph) | |
with self.graph.as_default(): | |
# Import saved model from location 'loc' into local graph |
This file contains hidden or 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 tensorflow as tf | |
class ImportGraph(): | |
""" Importing and running isolated TF graph """ | |
def __init__(self, loc): | |
# Create local graph and use it in the session | |
self.graph = tf.Graph() | |
self.sess = tf.Session(graph=self.graph) | |
with self.graph.as_default(): | |
# Import saved model from location 'loc' into local graph |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
def combined_loss(gan_model, **kwargs): | |
"""Wrapper function for combine adversarial loss, use as generator loss""" | |
# Define non-adversarial loss - for example L1 | |
non_adversarial_loss = tf.losses.absolute_difference( | |
gan_model.real_data, gan_model.generated_data) | |
# Define generator loss | |
generator_loss = tf.contrib.gan.losses.least_squares_generator_loss( | |
gan_model, | |
**kwargs) |
This file contains hidden or 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
# Version: 2.4.1 | |
import tensorflow as tf | |
class MaliciousModule(tf.keras.Model): | |
def __init__(self): | |
super(MaliciousModule, self).__init__() | |
self.dense = tf.keras.layers.Dense(1, activation='sigmoid') | |
@tf.function |
This file contains hidden or 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
# This workflow will build 'client' folder, test and deploy to github pages on branch gh-pages | |
# For more information see: | |
# - https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
# - https://github.com/marketplace/actions/deploy-to-github-pages | |
name: Build and Deploy Frontend | |
on: | |
push: | |
branches: [ main ] |
This file contains hidden or 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
{ | |
"dependencies": { | |
"@types/jest": "^27.0.3", | |
"@types/node": "^17.0.0", | |
"@types/react": "^17.0.37", | |
"@types/react-dom": "^17.0.11", | |
"typescript": "^4.5.4", | |
... | |
}, | |
"scripts": { |
This file contains hidden or 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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"lib": [ | |
"dom", | |
"dom.iterable", | |
"esnext" | |
], | |
"allowJs": true, | |
"skipLibCheck": true, |
This file contains hidden or 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
{ | |
"env": { | |
"browser": true, | |
"es2021": true | |
}, | |
"extends": [ | |
"plugin:react/recommended", | |
"airbnb", | |
"plugin:@typescript-eslint/recommended" | |
], |
This file contains hidden or 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
node_modules | |
src/**/*.js |