https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0
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 | |
| def model_fn(features, labels, mode): | |
| # Deve conter os seguintes passos: | |
| # 1. Definir o modelo via TF | |
| # 2. Definir como gerar predições | |
| # 3. Definir a loss function para treino e avaliação | |
| # 4. Definir como otimizar o modelo (optimizer) | |
| # 5. Definir métricas para avaliação | |
| # 6. Retornar um EstimatorSpec definindo os passos acima |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import tensorflow as tf | |
| import numpy as np | |
| print ('Versão do TensorFlow:', tf.__version__) |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import tensorflow as tf | |
| import numpy as np | |
| print ('Versão do TensorFlow:', tf.__version__) |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import tensorflow as tf | |
| import numpy as np | |
| def build_cnn(input_layer, mode): |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import tensorflow as tf | |
| import numpy as np | |
| # Input functions |
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 json | |
| from urllib2 import Request, urlopen | |
| html = Request('http://codeforces.com/api/problemset.problems') | |
| response = urlopen(html) | |
| x = response.read() | |
| data = json.loads(x) | |
| print len(data['result']['problems']) # dict with data from ~ 3912 problems | |
| html = Request('http://codeforces.com/api/user.ratedList') |
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
| % funcao auxiliar que corta uma palavra adequadamente para flexiona-la | |
| reduzir(VERBO, VERBO_REDUZIDO, N) :- | |
| % tamanho do verbo eh TAM_VERBO | |
| string_length(VERBO, TAM_VERBO), | |
| % devemos retirar as ultimas N letras do verbo | |
| FIM_VERBO is TAM_VERBO-N, | |
| % o resultado eh guardado em VERBO_REDUZIDO | |
| sub_atom(VERBO, 0, FIM_VERBO, _, VERBO_REDUZIDO). | |
| % EU |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.